In this Instructable I'll show you how to make a electronic dashboard for a bicycle. We'll be using an Arduino and a few off-the-shelf parts to create a system with light control and an LED speedometer.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials
Arduino Micro (RadioShack #: 276-258)
12V 10W halogen bulb (RadioShack #: 272-011)
(2x) 12V lamp (RadioShack #: 272-336)
(6x) LED holder (RadioShack #: 276-080)
(3x) green LED (RadioShack #: 55050659) web only
(2x) yellow LED (RadioShack #: 276-021)
red LED (RadioShack #: 55050657) web only
1 uF capactior (RadioShack #: 55047769) web only
(6x) 330 ohm resistor (RadioShack #: 271-1315)
(4x) 10K ohm resistor (RadioShack #: 271-1126)
(3x) N-channel MOSFET (RadioShack #: 276-2072)
74HC14 Schmitt Trigger (RadioShack #: 55050984) web only
reed switch (RadioShack #: 55050593) web only
on/off toggle switch (RadioShack #: 275-602)
(2x) SPST toggle switch (RadioShack #: 275-612)
(6x) terminal block (RadioShack #: 55055598) web only
(2x) 4 cell D battery holder (RadioShack #: 270-396)
(8x) D battery (RadioShack #: 23-2220)
(16x) 8-32 x 5/8" screw
(16x) 8-32 nut
(4x) 4-40 x 1/2" screw
(4x) 4-40 x 1.5" screw
(8x) 4-40 nut
~40" double sided Velcro
.2 inch plywood
Step 2: Build the Circuit: Schematic
The circuit is composed of five main parts:
Power: Eight 1.5V batteries in series will give us ~12V. This system is attached to a large SPST toggle switch for control.
Debouncer: The reed switch is connected across the capacitor of an RC circuit. The analog output is fed into a 74HC14 Hex Inverting Schmitt Trigger which converts it into a digital signal, which is then fed into Arduino Micro interrupt 1 (digital pin 2). This chip is powered by the 5V from the Arduino.
Speedometer: Six LEDs are attached via current limiting resistors directly to the digital output pins of the Arduino.
Lamp Control: Three lamps are connected to N-channel MOSFETs. Each MOSFET has a 10k pulldown resistor on its gate pin, which is control by a digital output pin.
Step 3: Build the Circuit: Assembly
First we'll attach the wires for the taillights. Cut four 36 inch lengths of wire and solder them to the lamps. The lamps do have polarity, so keep note of which wire is your anode or cathode.
Solder a few inches of wire to a terminal block. This will be the attachment for the lamp.
Attach two lengths of wires to each of the toggle switches. A few inches should do.
Take the LEDs and slide them into the rubber stoppers. Solder a few inches of wire to each.
Place the Arduino Micro on the proto-board with the micro USB connector facing out.
Place three terminal blocks along the edge with one of the pins in the power rail and the other in the main rows.
Place two terminal blocks with both pins in the power rail near the Arduino.
Place the MOSFETS on the board with the drain (the middle pin) aligned with the terminal block.
Place the 74HC14 to the left of the Arduino with the divot facing left as well.
Place a 10K resistor across the 74HC14 from pin one to pin fourteen.
Place a 10K resistor from the gate (leftmost when facing) pin of the MOSFET to the source (rightmost when facing) pin.
Place the six 300 ohm resistors next to the 74HC14, bridging the gap in the middle of the board.
Place the 1uF capacitor in line with the first pin of the 74HC14, making sure the cathode is connected to the ground rail at the bottom.
Solder the remaining LEDs, switches, and jumper wires to the board. Refer to the schematic on the previous step for the connections.
Make sure every connection is properly powered and grounded. The 74HC14 is powered by the 5V out pin of the Arduino, but the Arduino is powered directly from the 12V line via its VIN pin.
Step 4: Software
You'll need the Arduino IDE to download the code to the Micro. Any version 1.0 or beyond should work just fine. Be sure to select the the proper board and serial port in the tools menu. Download the attached .INO sketch. We'll need to modify the sketch for things to work properly.
Open the sketch in the IDE.
Change the variable value of "wheelDiameter" in the sketch to the diameter of your front bicycle wheel. You can find this variable at the top of the sketch.
The sketch is set up to display speed in kilometers per hour. There are ranges down near the bottom of the sketch that determine when the LEDs light up. Adjust these numbers to suit your needs.
Step 5: Dashboard and Battery Box
I designed the compartments for the dashboard and battery box in Adobe Illustrator and cut them out of .2" plywood on an Epilog laser cutter. The dashboard itself could be made of any flat material really. As is, the system is designed to be modular and without needing glue for major assembly. Attached you'll find the vectors for the parts to cut out.
Step 6: Build Battery Box
The battery box we'll be using holds 8 D batteries for about 12+ hours of continuous use. The case consists of a shell for enclosing the plastic D battery holders and a lid that allows for securing the batteries in place.
The box holds together with 8-32 screws and is attached to the frame with Velcro straps.
From the roll of Velcro, cut three 8 inch pieces and two 7 inch pieces. Weave the two short straps with the "hook" side inward and "loop" side outward from the slots in the top panel of the battery box.
Cut down, strip, and solder the two wires in between the holders.
Measure and cut two 36 inch lengths of wire. Solder one side of each to the wires extending from the battery box.
Place the combined holders over the solid back plate. Line up the holes in the battery holders with the plate.
Screw in the eight 3/8" screws through the holder to the plate. Tighten the nut on the back.
On one side of the plate with the large cutout, glue a 4-40 nut centered over the hole on the top.
Slide the back plate into the slots on the long base plate.
Thread the wires from the holders through one of the side plates. Slide the side plates into the slots on the base plate.
Slide the large cutout piece into the slots on the base plate. Make sure the nut is on the inside.
Place the top plate with the Velcro on to the tabs from the other plates.
Slide an 8-32 nut into each of the slots near the edge and fasten with the 8-32 screw.
Place the eight batteries into the holder. Fasten the last remaining plate over the cutout window with a 4-40 screw.
Solder the red wire extending from the box to the large power switch. Remember to put the heat shrink tube on first!
Solder another short length of wire from the power switch.
Step 7: Build the Dashboard
Place the chrome LED mounts in the dashboard plate and tighten them.
Grab the main circuit and slide the LEDs and rubber stoppers into the mounts.
Slide the toggle switches into the holes near the emergency symbol and the "light" circle. Screw on their panel nuts.
Cut three 8 inch strips of Velcro and slide them through the slots of the rectangular baseplate with the "hook" side facing down.
Screw in the main circuit with the 4-40 x 1/2" screws
Slide the LEDs and rubber stops into the chrome holders. They're tightly packed, so keep track of the order.
Slide the toggle switches into their respective holes and fasten with their mounting nuts.
Take one of the small octagonal plates and place one of the long 4-40 screws into each of the four holes.
Place the halogen face down over the the hole in the plate.
Place the remaining octagonal plate over the back of the halogen.
Over two of the screws, place a couple of the tiny wooden spacers.
Slide the matching side plate over the headlamp assembly and fasten with the remaining nuts.
Place the completed headlight plate in between the top and bottom plates.
Screw in the lamp wires into the matching terminal block (the leftmost one in this case).
To complete the dash box, we'll need it mounted to the bike.
Step 8: Attaching the System
Before we complete the dash box, we'll first attach the other electronics. Grab a few zip ties and fasten the taillights to your seat. Weave the wires together to keep them compact.
Strap the battery box to your top tube, running the power wires underneath it.
Strap the base of the dashboard box to the stem and handlebars of your bike.
Slide the power switch and wires through the hole in the back plate. Screw in the loose red wire into the 12V terminal block and the black wire in to the GND terminal block.
Slide the reed switch out the hole in the back plate, so that it will be free when the box is sealed.
Slide the taillight wires into the back plate and connect them to the two terminal blocks near the edge. The anode of each light should connect to the 12V rail, and the cathode should connect to the other terminal block socket, which is connected to the drain (middle) pin of the MOSFET.
Slide up the back panel and slot it into place.
Slot in the side planels.
Tighten the box with the 8-32 screws and nuts.
Place the sticky back of the reed switch on the fork of your bike and slide zip ties through the holes in its flange.
Trim the flange off the magnet piece and tape it to a spoke near your magnet. Test with the power on to see if it's close enough to the switch by spinning the wheel.
Step 9: Usage
Instructions: See how fast you can go! (Remember to wear a helmet)
The bicycle dashboard is a fairly simple system, so it's ripe for modification.
Sound system (perhaps with a smartphone cozy holder)
More LEDs (for a more accurate speedometer)