Pages: 1 2 [3]   Go Down
Author Topic: Hall effect sensors  (Read 4123 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Offline Offline
Brattain Member
*****
Karma: 495
Posts: 19035
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Personally I would use interrupts. PulseIn is just a timed loop.
Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

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

New Delhi,India
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Rob Tillaart

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

Pages: 1 2 [3]   Go Up
Jump to: