Sei sulla pagina 1di 9

Food

Living

Outside

Play

Technology

Workshop

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


by elevenbytes on October 25, 2011

Table of Contents
How to Make an LED Ambient Mood Light: A Beginner Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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

Step 1: Gather the Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Assemble the LED circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: Program the Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Add a Cover to Diffuse the Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: Tweak the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Intro: 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 1: 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.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. Arduino Breadboard sheild (optional, but nice)
2. Arduino Board
3. clear tape
4. breadboard connector wire
5. scissors
6. Red, green, and blue LEDs
7. 3 Resistors (330 ohm)
8. USB A to USB B connector cable
9. white paper

Step 2: 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.

Image Notes
1. The breadboard shield fits right on top of the Arduino board.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. Stick the resistors into pins 9, 10, and 11.

Image Notes
1. Pin 9
2. Pin 10
3. Pin 11
4. red LED
5. blue LED
6. green LED

Image Notes
1. Connect the red LED anode (long lead) to the resistor connected to pin 9.

Image Notes
1. Connect the green LED to the resistor connected to pin 10 and the blue LED to
the resistor connected to pin 11. Connect all three LED cathodes (short lead)
together.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. Use the wire to connect all three LED cathodes to ground (GND).

Step 3: 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 selfrepairing. 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.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. Code window.
2. Console window.
3. Compile
4. Save
5. New
6. File name
7. Upload

Image Notes
1. 3. Save file.
2. 1. Paste code.
3. 2. Verify

Image Notes
1. Connect the Arduino board to the computer.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. This text means that the compile completed successfully.
2. Click this button to upload the program to the Arduino.

Image Notes
1. A few seconds after uploading, the LEDs should turn on.

Step 4: 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.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Image Notes
1. Cut on these creases.

Image Notes
1. The finished cube taped together (the bottom face is open).

Image Notes
1. The Arduino and shield will fit nicely.

Image Notes
1. This hole is for the USB cord.

Image Notes
1. The paper cover diffuses the light so that the red, green, and blue mixes
together.

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Step 5: 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!

Related Instructables

Arduino mood
lighting by sapc

Ambient Cube
Lighting.
(Photos) by
Lftndbt

How To Capture
- A Fallen Star.
(Photos) by
Lftndbt

Mobius LED
Lantern by
susannes
Flicker up to 6
LEDs with
Arduino by
gotcha99

Cheap obstacle
sensor - with
Arduino! by
dunnos

http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/

Potrebbero piacerti anche