This Instructable lays out how to construct and code an ambient LED light using an Arduino board and some common circuit components. This project mixes a red, green, and blue LED to get a wide range of colors, and the Arduino cycles through them. The paper cover is used to diffuse the light from the discrete LEDs into a more uniform hue. This project is ideal to add some mood lighting to a dark room using the Arduino and some common, cheap materials.
The Arduino is a useful, versatile board for the electrical hobbyist, but it takes practice to master. This tutorial is accessible to anyone starting to work with or interested in using an Arduino board for electrical or art hobby projects. No prior electrical or coding experience is necessary to complete or tweak this project. However, some knowledge on the C programming language and basic circuitry will be useful to expand on the design. The project takes about 15 minutes to assemble.
Step 1: Gather the Materials
- Arduino Uno board (older boards should be compatible)
- USB A to USB B connector cable
- Computer with Arduino IDE software
- Arduino solder-less breadboard shield
- 3 resistors (330 ohm)
- Red LED
- Green LED
- Blue LED
- breadboard connector wire
- white paper
The Arduino Software (compiler and IDE) can be found here: http://www.arduino.cc/en/Main/software
Some of these materials can be substituted if they are not readily available:
- A regular breadboard can be used instead of the breadboard shield.
- Other resistors can be used, just try to find three identical resistors between 330 and 1000 ohms.
- Any different color LEDs can be used in this project.
Step 2: Assemble the LED Circuit
- Disconnect the Arduino board from any power supply or computer.
Caution: Unintentional electrical contact could damage the components. Make sure the Arduino is not powered when wiring components.
- Connect the three resistors from pins 9, 10, and 11 to separate rows on the breadboard.
- Connect the anodes of the three LEDs to the three rows of the resistors and the cathodes to a common row.
Note: The anode is the longer lead on an LED, and the cathode is the shorter. The LED will not get damaged if it is plugged in backwards, it just won't turn on.
- Connect the LED cathodes to ground (GND).
Caution: The resistors are used to reduce current to the LED. Do not connect an LED directly from a voltage source to GND, as this can damage the LED.
Step 3: Program the Arduino
- Open the Arduino IDE software (or your preferred IDE).
The Arduino software can be found here: http://www.arduino.cc/en/Main/software
- Copy and paste the project code into the software.
The project code can be found here: http://pastebin.com/1dyWpRuw
- Save the code.
- Compile the code.
- Connect the Arduino to the computer with the USB connector cord.
- Upload the program to the Arduino.
The Arduino won't turn on.
There is a small LED on the Arduino board which lights up when it has power. If there is no light:
- Ensure the Arduino is correctly connected to the computer using the USB connector cable.
- Try using another USB device on that port such as a mouse or a keyboard. If those don't work, the Arduino may have shorted the USB port. The USB port is self-repairing. Restarting the computer should fix the problem.
The program should light up the LEDs after a few seconds. They may blink while the program is loading. If the Arduino ON light is lit, but the LEDs are not:
- Check which pins the LEDs/resistors are connected to. Make sure these pins (9, 10, 11) match the PIN_RED, PIN_GREEN, and PIN_BLUE variables in the project code.
- Check the LEDs manually by connecting the resistor to 5V instead of a pin. If the LED does not light, replace the LED.
- If the LEDs light up using the 5V but not the pins, the program is not running correctly. Upload the Blink code example (from File -> Examples -> Basics -> Blink) to the Arduino. If the Arduino is working, a little LED should start blinking regularly. If it is not, the Arduino may need to be replaced.
- If the Arduino is working, but the program is not running, unplug the Arduino and repeat this step.
The program should change the intensity of the LEDs. If the LEDs are on but not fading:
- The delay time may just be too long to notice LEDs changing. Set DELAY_TIME to 1 and re-upload the program. The LEDs should fade in and out rapidly. Change the DELAY_TIME to any desired value.
Step 4: Add a Cover to Diffuse the Light
- Cut the paper into a square.
The easiest way to do this is to fold the paper diagonally and cut off the excess (as shown).
- Fold the paper so that the creases divide the paper into nine equal squares.
- Cut four of the outside creases (as shown).
- Fold the paper into a cube with one open face.
- Tape the edges together.
- Place the paper cube over the Arduino.
Optionally, cut a small hole for the USB cable to fit into.
- Turn on the Arduino by connecting it to the computer.
Step 5: Tweak the Project
- Edit the code.
Change the values of the delay or color starting values, or re-write the transition() function to fade the LEDs differently.
- Re-wire the circuit.
Swap out LED colors for a different color variety, or add a variable resistor to the circuit to adjust brightness.
- Stylize the cover.
Draw on the paper cover or use a different material to add extra effects.
- Combine with other projects.
Try syncing the colors with music.