Go Down

Topic: Hall Sensor to Find Speed (Read 1 time) previous topic - next topic


If you measure the width of a single pulse (I assume this is what you mean with measuring peaks), it will be subject to calibration as the slope (rise/fall time) of the opposing edges is likely to be somewhat unpredictable. The PulseIn() function will cancel out such errors  when you calculate the time difference between two sequential pulses and so is more accurate and appropriate for RPM/frequency calculations.


That project uses an A1302 linear hall effect sensor. This is not the right sort of sensor. The web poster says it is his first project and it shows.

The problem with a linear sensor is that you have to read the value with the analogue input A/D converter. This takes quite a long time and is going to add errors to your measurement. You need to use a hall effect switch, this gives a logic level output that you can use with pulseIn().


If you wanted to use the analogue vr sensor it would be easier to find the zero point crossing.

But as mike says it is easier to use a sensor that is active and outputs a digital square wave


Another approach... and it has its cons as well as its pros!... is to send the output from the Hall sensor to a counter. You can then visit the counter from time to time, and see the number of pulses since the last time you looked.

Implementing the counter is something I haven't tried... although it is discussed in various posts.

"... since the last time you looked..." will use "millis", and a stored record of what millis returned the last time you looked, and what the counter was at back then.


i have used the counter approach in other hardware and it works well

count the number of revolutions since you last looked and the time and you know the rpm / speed

i suggest you use the clock in the arduino and not the clock in windows !

Go Up