# Acelerometer usage

Discussion in 'The Projects Forum' started by cts_casemod, Jun 16, 2013.

1. ### cts_casemod Thread Starter Member

May 14, 2013
35
0
Hiya,

Can anyone tell me how to use an accelerometer?
I want to activate an LED if the acceleration rate is higher than 2m/s

How shall I do this?

Thanks

Nov 30, 2010
16,687
7,327
3. ### sq-aristo New Member

Jun 1, 2013
20
1
What are you reading the signal with or what are you switching with the final signal?

4. ### cts_casemod Thread Starter Member

May 14, 2013
35
0

Sure it has to be a bit more complex than that? Why are commercial approaches using 3 axis accelerometers?

5. ### cts_casemod Thread Starter Member

May 14, 2013
35
0

Most likely an accelerometer or a speed sensor. The output should be an LED

6. ### kubeek AAC Fanatic!

Sep 20, 2005
4,689
806
Well it is simple only if you care about acceleration in a single axis. If you want to know the total acceleration, you need to compute sqrt(x^2 + y^2 + z^2) which is not very easy to do in analog domain. That is if you have an accelerometer with analog output. If it is digital then it is a completely different question and you will probably need a microcontroller anyway.

sq-aristo likes this.
7. ### crutschow Expert

Mar 14, 2008
13,497
3,373
Just a nit. 2m/s is a velocity. 2m/s/s is an acceleration.

#12 likes this.
8. ### sq-aristo New Member

Jun 1, 2013
20
1
Single or 3 axis would help or even more. Pick an accelerometer and it will be easy to help. I'm not sure if it could output an anologue voltage if it could it should be easy. If not you will need a digital interpreter of some sort.
What is the overall purpose for the project?

Nov 30, 2010
16,687
7,327

10. ### cts_casemod Thread Starter Member

May 14, 2013
35
0
All valid comments, but my point is that that the deceleration force will only be accurate if the device is horizontal to the x axis. It will vary with the slop of the plane.

What about using a pulse count sensor? I have access to one of the phases of the stepper, so I could use this to have an average and detect if the pulse count was increasing or decreasing. I just have no experience whatsoever with micros, so I am not sure if someone could guide me into something I could use.

Regards

11. ### cts_casemod Thread Starter Member

May 14, 2013
35
0
The purpose of the project is to simulate a brake light on a bike, without using wires. I have access to a stepper being used as a small generator for the lights, so I could install a RF module to get the frequency or I could use some kind of accelerometer.

The idea is to have everything self contained without any wires on the bike.

12. ### RichardO Well-Known Member

May 4, 2013
1,339
429
Nice idea.

If I were doing it, I would use the single accelerometer and comparator as suggested by #12. Some analog filtering may be needed to reject vibrations from the signal.

I would put the accelerometer, red LED's and a battery in a single box. The LED's draw little power and only for a short amount of time and allows a battery to run the circuit for quite a number of hours. By keeping the power needs low and putting everything in one place, there is no need for a generator or RF link.

The only hitch in this plan is the amount of power needed to run the accelerometer. Some sort of real low power circuit may be needed to periodically power up the accelerometer, check for a braking condition and then power the accelerometer back down. The easiest way to do this is a microcontroller such as a PIC. Of course, a power switch is even simpler.

Another way of sensing acceleration would be to build a mechanical detector using a weight and a micro-switch. This may, however, be difficult to do in the environment of a bouncing bike.

13. ### sq-aristo New Member

Jun 1, 2013
20
1
3months ago I had never used one. I bought an arduino and have made a remote control lawn mower with a 3 axis compass and accel for autopilot. All it took was some reading you will find everything you need for an arduino they are easy