Go Down

Topic: Hall effect sensors (Read 4752 times) previous topic - next topic

Nick Gammon

Personally I would use interrupts. PulseIn is just a timed loop.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

robtillaart

The advantage of pulseIn is that you can detect standstil by timeout.
MOst important drawback imho is that pulseIn() is blocking...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jay2012

I actually made one rpm sensor for my CVT using a pulse in function and it gives very exact values,..i can help you out wit it,..pulse in does give you the duration,all you do is take the duration for the "on" time and the "off" time,..this will give you the sampling time.Now you have time,so you can get frequency,and then rpm.
The driver side of my side has an idling speed of about 1800 rpm,and i get the value at 1805 rpm ,constant till i throttle the engine,and gives a value of 3760 rpm ,for a max theoritical value of 3800 rpm.
so i can tell you that pulseIn works for sure

robtillaart


Pulsein() works very well I know but as I stated above it has some drawbacks, most important it blocks the code, and to lesser extend you will not necessary get all pulses. This latter may or may not be important. Example if you only want to have speed it does not matter much. If you also want to have the distance measured you need every pulse.

Still pulseIN() is a valid option.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up