LED Christmas Light (with On/off)

by lyw_jh_yq in Circuits > Arduino

184 Views, 0 Favorites, 0 Comments

LED Christmas Light (with On/off)

Screen Shot 2020-04-20 at 11.36.32 AM.png

This project is a modified version of https://www.instructables.com/id/Arduino-Christma... , in which I added a button for the user to control when to turn the light on.

Supplies

9 LED light bulbs (random or any colors)

10 220-ohm resistors

Arduino Leonardo

USB cable

12 M-M wires

A button

A Breadboard

Construct Your Lights and Button

Screen Shot 2020-04-15 at 5.43.28 PM.png
Screen Shot 2020-04-15 at 5.43.21 PM.png

I aligned my LED light bulbs in a straight row, leaving space between each bulb so they won't crash into each other. For the LED light bulbs, I believe using 220-ohm resistor fits better for my eyes because the LED lights gets too bright while using the other weaker resistor. In addition, I changed the LED light's color to red, green, and white, which I believes gives off more of a Christmas vibe. After working with the lights, attach the button onto the breadboard, connect one of the legs of the button to 5V and the other leg to the negative rail including a 220-ohm resistor too (as the image shows).

Modify or Paste Code.

Screen Shot 2020-04-15 at 5.48.07 PM.png

After constructing the lights and the button, open the Arduino application and paste this code onto it.

For my modification, I added a if/else code in the loop part with the setup of input on D2, which is where my button is connected too. With this change, the user would be able to run the light when they want to just by pressing the button. This way, we could save energy and prevent unwanted waste of energy.

Done! Enjoy!

Arduino 2020 Ariel Lin