loading

This is an automotive G meter created from and Arduino Micro, an ADXL335 3-axis sensor and other parts. It displays left to right or front to rear G load. When calibrated the limits are +/- 1 g. The meter uses 9 LED's for the display. The center (green) LED is always on as a center reference. The 3 LED's (yellow) to the left and right are pulse width modulated (PWM) so that the intensity can be varied to indicate g load. The 2 outside LED's (red) are the limits of the meter and should indicate a G load of approximately 1 g.

Step 1: Parts

1 - Arduino Micro

1 - ADXL335

1 - LM7809

1 - LED, Green

6 - LED, Yellow

2 - LED, Red

9 - Resistor, 220 ohm, 1/4 watt

1 - Resistor, 10K, 1/4 watt

1 - Capacitor, 4.7uF, 50V

1 - Push Button Switch

1 - Coaxial Power Jack

1 - Protoboard

1 - Project Box, Digikey HM355-ND

1 - DC Power Cord

Most of the parts I used were from my parts boxes with the exception of the Arduino Micro and ADXL335 (from http://www.adafruit.com) and the Project Box (from http://www.digikey.com/). Most of the other parts can be obtained from electronic suppliers such as DigiKey, Jameco, Mouser, etc. The power cord I used plugs into a 12V auto power outlet and has a DC coaxial plug that matches the DC power jack.

Step 2: Assembly

Assemble the electronics according to the schematic. I used pieces from two different prototyping boards. Personally I prefer boards with ground and power traces such at Radio Shack part #276-0168. I cut the boards using a band saw and Dremel tool.

I mounted the LED's on a separate board along with the current limiting resistors to make mounting in the case easier. It took some time to work out the exact placement of the parts to allow them to fit inside the case.

I had photos of my prototyping on a breadboard but the SD card with the images died. I will not mention the brand name of the SD card but I have had 2 of them fail recently and will not purchase any more.

Step 3: Programming the Arduino

Using an Arduino development application, create a new project and copy the source code to the project or download the "INO" file. Connect the Arduino using a USB cable and deploy the application.

I used Microsoft Visual Studio 15 with the "Arduino IDE for Visual Studio" extension but there are other developments tools available for Windows, MAC OS X and Linux.

Step 4: Calibration

When the meter is first assembled and programmed it is not calibrated and uses default values for each axis. Although it should function it will not be very accurate. When the meter is not calibrated, all LED's will flash 3 times after the startup sequence.

For best result the meter should be calibrated. In order to calibrate the meter, apply power and wait until the startup light sequence is complete. Press and hold the button for at least 2 seconds. The LED's will begin lighting from center to the left. This is to indicate the first position. The user must hold the meter vertical for each axis and press the button when in each position.

1. Hold the left side down and press the button.

2. Hold the right side down and press the button.

3. Hold front down and press the button.

4. Hold back down and press the button.

All LED's flashing indicates a calibration error.

When calibrated only the center LED should be lit when the device is placed on a flat surface.

Step 5: Mount and Have Fun

When mounting in your vehicle I would recommend that your vehicle be on a flat and level surface. Also it is a good idea to have power to the meter in order to make sure the meter is level (only the green LED on).

Pressing the button will swap between left and right to font and rear measurements.

<p>Is it possible to add more LED's to the code as well as higher g forces?</p><p><a href="https://www.thinglink.com/scene/685862500100472833" rel="nofollow">https://www.thinglink.com/scene/685862500100472833</a></p><p>I am wanting to create an airplane G-Meter similar to the RedBull Air Race guys.</p>
<p>The 3 inner LEDs use a PWM output to vary the brightness. The outer LEDs are simply on/off so the available PWMs are the limiting factor. There may be other Arduino's with more PWMs or you could add more on/off LEDs. The ADXL335 is +/-3 Gs so the meter in it's current state can handle more Gs. You would just have to find some method to calibrate it.</p>

About This Instructable

1,234views

25favorites

More by DavidH666:Automotive G Meter 
Add instructable to: