How to Make an LED Ambient Mood Light: A Beginner Tutorial

Powered by Instructables.
<

Step 1: How to Make an LED Ambient Mood Light: A Beginner Tutorial

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 2: Gather the Materials

The following materials are used:

  • 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
  • scissors
  • tape

Also, you will need the code for this project, which is linked to in the "Program the Arduino" step, and can be found here: http://pastebin.com/1dyWpRuw.

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.

If this is the first time the Arduino has been used, connect the Arduino to the computer using the USB connector to make sure it turns on. A green LED should light up on the board to indicate that it is on and receiving power.


Step 3: Assemble the LED circuit

Assemble the LED circuit on the breadboard:

  1. 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.
  2. Connect the three resistors from pins 9, 10, and 11 to separate rows on the breadboard.
  3. 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.
  4. 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.

Check to make sure the wiring is correct before continuing. Improperly wired circuits can cause the Arduino board to short the USB connection. If this happens, the USB port may deactivate itself. If the USB port on the computer becomes deactivated, restart the computer.








Step 4: Program the Arduino

Load the program onto the Arduino board:

  1. Open the Arduino IDE software (or your preferred IDE).
    The Arduino software can be found here: http://www.arduino.cc/en/Main/software
  2. Copy and paste the project code into the software.
    The project code can be found here: http://pastebin.com/1dyWpRuw
  3. Save the code.
  4. Compile the code.
  5. Connect the Arduino to the computer with the USB connector cord.
  6. Upload the program to the Arduino.

After a few seconds, the LEDs should light up and begin fading in and out.

Troubleshooting:

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.

An LED (or all LEDs) won't light up.
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 LEDs don't fade in and out.
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 5: Add a Cover to Diffuse the Light

Add a paper cover to the Arduino Board to blend the RGB values into a single, uniform color:

  1. 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).
  2. Fold the paper so that the creases divide the paper into nine equal squares.
  3. Cut four of the outside creases (as shown).
  4. Fold the paper into a cube with one open face.
  5. Tape the edges together.
  6. Place the paper cube over the Arduino.
    Optionally, cut a small hole for the USB cable to fit into.
  7. Turn on the Arduino by connecting it to the computer.

The paper cover will diffuse the light from the three LEDs so that the light is mixed together. The cube will now appear to smoothly transition through various colors.









Step 6: Tweak the Project

The LED mood light should now be adding a soothing ambient glow to the room. Now, make the project unique. There are many things that can be done to tweak the mood light. Here are a few things to try:

  • 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.

Hopefully this project inspires further experimentation. The Arduino board is incredibly versatile and accessible to hobbyists of all backgrounds. This is just one of many simple projects which can be constructed using this technology. Keep tinkering!


License: Attribution-NonCommercial-ShareAlike.

Tools and Space
Age Level
Category
Time Per Project
1div id="in-node-search">

Search

C