Can i find the speed of the vehicle using ADXL335?. My idea is to send an email alert if the vehicle speed exceeds the defined limit using raspberry pi. Just like in zoomcar or the other rental cars.
-
\$\begingroup\$ ADXL is an accelerometer, how would you get the speed ? \$\endgroup\$– Marko BuršičApr 2, 2017 at 7:05
1 Answer
Short answer: No
To get velocity out of your accelerometer you would need to perform some integration eg:
v_k = v_(k-1) + T*a_k
Where v
is the velocity, T
is the sample period, a
is the measured acceleration and subscript k
is the sample number.
This is saying that "velocity is equal to previous velocity, plus the product of measured acceleration and sample period" where you might assume constant acceleration in between samples (k).
Already this is a problem, because we're working in discrete time and acceleration is not constant between samples. To make matters worse, any error (bias, drift) of the accelerometer is integrated as well, which means that after only a few (tens?) of samples your velocity has large error.
The rental cars are probably doing it either with GPS or direct from the speedometer.
-
\$\begingroup\$ What about hall effect speed sensor? \$\endgroup\$ Apr 2, 2017 at 7:16
-
\$\begingroup\$ @gurudattakr, that's what I meant by measuring direct from the speedometer. \$\endgroup\$– MichaelApr 2, 2017 at 7:20