Introduction: Direction Indicators for Bikes
I made this project for my father on Father's Day. He bikes to his work every morning. There are a lot of cars on the road so I wanted to make biking safer. Cars have Direction Indicators, I wanted to give my dad's bike Direction Indicators too. To light up the right direction indicator just push the button on the right side of your handlebar, to light up the left direction indicator just push the button on the left side of your handlebar. I hope you like my project & you want to build yourself one too.
The one thing that can be a little challenging is wiring the cables of the lights. I included a wiring diagram for the push buttons, but not a wiring diagram for the indicator lights. This is because there are a lot of wires, and they can be "converted" into 3 wires: ground, right indicator light, left indicator light. Because you don't want to lose track of some wires, you may want to give ground one color wires, right indicator light one color wires, and left indicator light one color wires.
I have the same tutorial on the Arduino project hub .
To make it work, just attach the USB cable to the Powerbank & enjoy the Direction Indicators for Bikes!
Step 1: Gathering the Materials
For the Direction Indicators for Bikes, you need:
- Arduino Uno
- 2 small plastic boxes (mine perfectly fitted my breadboards)
- 10 LED's (I used Red ones)
- 2 push buttons ( https://www.amazon.com/6x6x6mm-Momentary-Push-But... )
- A powerbank (or a way to get your Arduino working on your bike)
- A USB cable (to connect the Arduino to the powerbank)
- Lots of wires (in 3 colors??)
- 1 mini breadboard 55 tie points( https://www.amazon.com/Cylewet-Solderless-Circuit... )
- 4 breadboards 170 tie points ( https://www.amazon.com/Solderless-Breadboard-poin... )
Step 2: Building the Lights
Follow the photos, there is one of each step
- Dril 4 holes into one of the boxes
- Put the 10 LED's into the same box (look at the photo for the pattern)
- Make sure you can still close the box
- Wire it all up. Push your cables through the holes. Make sure you keep track of your cables. I labeled each hole(right Direction Indicator Ground, Left Direction Indicator Ground, etc) I put a drinking straw in the middle to make it neater.
- Make sure you can still close the box
- Get a new box. Put the 55 tie points breadboard into it
- Turn around the box with the LED's and put the box with the 5 holes on top of it.
- Get the wires from the box beneath and push them through the four holes. Keep the fifth hole free. Wire this up too and make sure you have three wires left: Ground, + Left, and + Right. Push these 3 cables through the fifth hole, these are going to go to the Arduino.
- I put a rubber band around the two boxes to keep them together.
Step 3: Setting Up the Arduino
- Get a new box for the Arduino
- Drill 1 hole for the wires into it.
- Drill 1 hole for the USB cable into it.
- Make sure you can close the box and put the USB cable into the Arduino
Step 4: Building the Pushbuttons
- Make the 2 circuits on the photo (or look in the Fritzing attatched)
- One for the right side of the handlebar (blue breadboard)
- One for the left side of the handlebar (green breadboard)
Attachments
Step 5: Wiring the Arduino
- Put all the wires into the Arduino & make sure you can still close
I put the push buttons to pin 2 & 3
The lights to 12 & 13
The grounds to ground
Step 6: The Code for the Direction Indicators
Add this code to the Arduino console:
const int button1 = 2;
const int button = 3;
void setup() { // put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(button, INPUT_PULLUP);
pinMode(button1, INPUT_PULLUP); }
void loop() { // put your main code here, to run repeatedly:
if (digitalRead(button1) == HIGH) { digitalWrite(12, LOW); }
if (digitalRead(button1) == LOW) { digitalWrite(12, HIGH); }
if (digitalRead(button) == HIGH) { digitalWrite(13, LOW); }
if (digitalRead(button) == LOW) { digitalWrite(13, HIGH); } }
It may work better when using the file I attached:
Attachments
Step 7: Attaching Everything to the Bike
- Attach the push buttons to the handlebar
- The Arduino behind the lamp
- The direction Indicator box to the luggage carrier