G Force to control RC car

Looking for help !

I have started a project where I am using a 3 axis accelerometer (located on a remote controlled car) to monitor the g force when driving. The accelerometer is MMA8451 connected to Arduino UNO. I would like to write a program/code so when the accelerometer detects g force over 0.4g it temporarily actives a LED. Then when this occurs three times a second LED is permanently activated until rest on the Arduino UNO board.

Is this possible ?

What additional components do I need to integrate ?

Where can I find a suitable code ?

Best to get an accelerometer and learn how they work. It will always be detecting 1 g, indirectly due to the Earth's gravity, in addition to whatever accelerations other forces produce.

What will produce the "g force over 0.4g" that you wish to detect?

Hi jremington,

When the RC car impacts an object, the g force will exceed a set limit example 0.4g. Once exceeded, this should temperately active a LED. If the car exceeds this limit 3 times then another LED will be permanently activated to indicate the car has being impacted 3 times.

I just need help written the code to active the LED's accordingly. Also how to connect the LED's on my board ? Do I need to install an SD card breakout w/level shifting circuit to the accelerometer ?

Any assistance is greatly appreciated.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.

Have you any working code that reads the accelerometer?
Before thinking about LEDs, lets get you basic code working and calibrated.

Tom..... :slight_smile:

stephenfitz32:
Any assistance is greatly appreciated.

You are going to light up and LED?
Try out the Blink tutorial.
This is a good way to make sure you have the arduino hooked up to your computer and can push a sketch on to the arduino.

In reply #2, MrMark gave you a link to the Adafruit page for the sensor you have.
Have you looked at it?
It has sample code there.
Have you tried that?

Working on projects like this is best approached in steps. And guess what! We will help you if you have difficulty with any of those steps. So get up and start putting one foot in front of the other. Do the blink tutorial. Do the Adafruit samples. Then try working them together.
Let us know how it goes or if you have questions along the way.

Hi,

Thank you vinceherman, TomGeorge and MrMark for the info and suggestion so far. Let me do some more tutorials and testing with the accelerometer and reply with the progress. Hopefully I haven't taken on more then I can handle with this project ! ! !