Introduction: Arduino Leonardo LED Bicycle Tail Light

*Picture of "transparent bicycling backpack that can be tied to the rail under the seat" mentioned in the supplies section*

For bicycle riders! Have you ever forgotten to turn on your bicycle tail light at night, or forgot to turn them off when you are done riding? With an automatic tail light, this will no longer be a problem.

By following the instructions of this project, you will be able to create an automatic tail light that will not only automatically turn on and off, but will blink at different paces according to your surroundings.

Supplies

1x LED Light

1x Photoresistor

1x 120 Ω Resistor

1x 1K Ω Resistor

1x Portable Charger

1x MicroUSB Cable

1x Transparent bicycling backpack that can be tied to the rail under the seat

4x Crocodile/ Alligator Clip

7x Jump Wires

Step 1: Setting the Circuit

Organize the circuit according to the pictures above

remember to check whether or not if you have:

1. Connected D12 with your alligator clip, and the alligator clip with the light.

2. Connected 5v to the positive row marked with "+", connected GND to the negative row "-".

3. Used all of your materials listed in the supplies section, if not, you probably missed something.

4. Connected the crocodile clip with the light, as well as connected the second crocodile clip to the photoresistor.

5. Engineered your circuit according to the pictures.

Step 2: Programing the Arduino

Program your Arduino! If you've done this step and the previous one correctly, your machine should work!

The code is given, and if the embedded version does not work, see:

https://create.arduino.cc/editor/03_lucky/a53146bf...

Step 3: Constructing the Final Product

After uploading the code, find a portable charger that contains enough energy to support your ride. Plug your Arduino to the portable charger. Then, put the Arduino board into the backpack that was prepared. Take out your LED light and your photoresistor, they should be extended using the alligator clip enough so it can be placed in the transparent section of your backpack.

Tie/place your backpack onto your bicycle, and we are done!!!

Step 4: Product Display

Here is a picture of the tail light tied to the bicycle.

The first video shows how the Arduino should respond to different lightings.

The second video displays how the tail light should work. In real-life scenarios, you do not need to press to activate the taillight, as the "button" is a photoresistor and should be able to turn on the light itself. However, the garage is not dim enough to activate the taillight, and because of the Covid-19, a bicycle ride at night is not reasonable, so the taillight is activated by pressing down the photoresistor, tricking the photoresistor into thinking it is night as it no longer receives light.