Take an accelerometer, add a microcontroller and display, and watch the dollars fly out of your carburetor
Posted 07.03.2008 at 10:46 am
Gas Guzzler Meter: Dave Prochnow
TIME: 8 HOURS
- Rock bottom Freeduino kit plus (Wulfden at Hawk’s Mountain #RBFK+; $12)
- Parallax Memsic 2125 accelerometer (Mouser #619-28017; $29.00)
- Kingbright LED green display (Mouser #604-BC5612GWA; $2.73)
- PacTec plastic box (Mouser #616-69313-510-000; $2.19)
- Hammond nylon belt clip (Mouser #546-1599-CLIP; $1.00)
- Resistor 220-ohm (Mouser #660-CFS1/4CT52R221J; $0.03)
- SPDT switch (SparkFun Electronics #COM-00102; $1.50)
- 8-pin IC socket (Mouser #571-1-390261-2; $0.15)
- (1) Hookup wire (RadioShack #278-1224; $5.99)
- (1) 9-Volt battery snap (All Electronics #BST-3; $1.00)
- 9V battery (local purchase; $3.00)
- Custom Arduino Sketch code (free)
- Build the Rock Bottom Freeduino Kit plus. You will need an FTDI USB TTL-232RL cable for programming the Sketch code onto the Freeduino. Download our Sketch code and burn the .pde onto your Freeduino.
- Drill eight holes (matching the configuration of the 8-pin IC socket) in the plastic box’s lid. Solder three shorts lengths of wire to pins 5-7 of the socket. Route these wires through the holes in the lid and into the inside of the box. Mount the socket to the box’s lid. Solder a jumper between pins 4 and 5 of the socket on the inside of the box.
- Drill three holes (matching the alignment of the SPDT switch) in the plastic box’s lid. Mount the SPDT switch to the outside of the lid with its leads routed through these three holes.
- Cut two slots in the upper and lower sides of the plastic box’s front panel. These slots will receive the LED display’s pins/wires. Mount the LED display to the outside of this front panel with its pins centered in the two slots.
- Solder one lead of the 220-ohm resistor to pin 6 of the LED display. Solder one of the Freeduino GND pins to the other lead of the resistor. Use the wiring guide in the Sketch documentation to connect both the Parallax accelerometer and the LED display to the Freeduino pins.
- Wire the black lead of the 9-Volt battery snap to the G pad of the Freeduino’s voltage regulator. The red lead is soldered to one of the outside pins of the SPDT switch. Connect a short wire between the middle pin of the SPDT switch to the +V pad of the Freeduino’s voltage regulator.
Gas Guzzler Meter Assembly: Dave Prochnow
- Plug the Parallax accelerometer into the 8-pin IC socket on the box’s lid. Match the six pins of the accelerometer with pins 2-7 of the socket. Make sure that the arrow on the top of the accelerometer is pointing towards the back of the plastic box.
- Test your work by temporarily installing a 9V battery in the snap and turning the switch on. You should see the “PopSci” splash screen followed by a display of numbers (cents + dollars) as you tilt the box’s lid. If you don’t see this display, immediately turn off the switch, remove the battery, and check all of your wiring.
- Once you’ve tested your meter and you’re satisfied with its operation (also make all code modifications prior to this step), you must modify the Freeduino. Remove both the Pin 13 LED/resistor combination and the 6-pin right angle FTDI programming header. These components must be removed, otherwise the Freeduino will not fit inside the plastic box. Alternatively, you could use a larger project box.
- Carefully pack the Freeduino, 9V battery, and wiring inside the plastic box. The Freeduino should be installed on its side, resting against the front of the two screw posts. The 9V battery should be insulated with tape and placed behind the two screw posts. Everything will fit inside the box when the Freeduino is placed in front of the two screw posts.
Now take your Gas Guzzler Meter for a test drive. Just clip it under one of your front windshield visors and turn it on. Ensure that the accelerometer is perfectly level and its arrow is pointing towards the front of your automobile. The display shows a calculated value for the amount of money being consumed by your engine. This value is displayed in U.S. dollars format (e.g., X.xx). Impress your friends, drive responsibly, and keep those dollars in your pocket.