bigdogguru
Administrator
- Joined
- Mar 12, 2010
- Messages
- 9,821
- Helped
- 2,350
- Reputation
- 4,694
- Reaction score
- 2,272
- Trophy points
- 1,413
- Location
- Southwest, USA
- Activity points
- 62,394
very nice project as an application of hall effect sensor and it also measures data but the prototype is not easy to build...
ISR countRPM()
{
RPM++;
}
ISR time() //count 1ms
{
tic++;
if(tic >= 500) //example it is 1second
{
tic = 0;
second_has_elapsed = 1;
}
}
An alternative to count pulses/sec would be to use two timers, one set to count the input pulses and the second timer as a gate for the first timer to measure the pulses for a specific time period, for example if you measure for 0.5sec you will get 25 counts , then multiply with two to get the counts /sec and clear the timers to start over (or keep the current value and subtract it).
If there is one hall sensor that gives one pulse per revolution and you want to measure the revolution/min
Your calculation is correct, a higher sample period will probably give more accurate result so theoretically if you measure for 1min you will have the best accuracy
but If I measure the pulses every 1minute it's not exciting. It's more exciting to look at if the numbers are moving...
In that case you can display a number and have it scrolling left and right doing some dance moves while you wait for the correct measurement result :lol::lol::lol::lol::lol:
Alex
--------------------------------------------
|RPM: xxxx |----->> this is the LCD :P
|RPS: xxxx |----> 2x16 LCD -D :-D :-D :-D
---------------------------------------------
RPS will show 0 for any speed below 60RPM and you said that you have a 50 RPM motor
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?