9
http://www.instructables.com/id/How-to-Make-an-LED-Ambient-Mood-Light-A-Beginner-/ 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: How to Make an LED Ambient Mood Light: A Beginner Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Gather the Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 2: Assemble the LED circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Program the Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 4: Add a Cover to Diffuse the Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Step 5: Tweak the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

How to Make an LED Ambient Mood Light for a Beginner

Embed Size (px)

DESCRIPTION

Make an LED Ambient Mood Light

Citation preview

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

Food      Living       Outside        Play        Technology       Workshop

How to Make an LED Ambient Mood Light: A Beginner Tutorialby elevenbytes on October 25, 2011

Table of Contents

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

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

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

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

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

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

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

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

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 moreuniform 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 inusing an Arduino board for electrical or art hobby projects. No prior electrical or coding experience is necessary to complete or tweak this project. However, someknowledge 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 MaterialsThe following materials are used:

Arduino Uno board (older boards should be compatible)USB A to USB B connector cableComputer with Arduino IDE softwareArduino solder-less breadboard shield3 resistors (330 ohm)Red LEDGreen LEDBlue LEDbreadboard connector wirewhite paperscissorstape

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 onthe 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 Notes1. Arduino Breadboard sheild (optional, but nice)2. Arduino Board3. clear tape4. breadboard connector wire5. scissors6. Red, green, and blue LEDs7. 3 Resistors (330 ohm)8. USB A to USB B connector cable9. white paper

Step 2: Assemble the LED circuitAssemble the LED circuit on the breadboard:

Disconnect the Arduino board from any power supply or computer.1.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.2.Connect the anodes of the three LEDs to the three rows of the resistors and the cathodes to a common row.3.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).4.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 USBport may deactivate itself. If the USB port on the computer becomes deactivated, restart the computer.

Image Notes1. 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 Notes1. Pin 92. Pin 103. Pin 114. red LED5. blue LED6. green LED

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

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

Image Notes1. Connect the green LED to the resistor connected to pin 10 and the blue LED tothe 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 Notes1. Use the wire to connect all three LED cathodes to ground (GND).

Step 3: Program the ArduinoLoad the program onto the Arduino board:

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

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 theproject 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 Notes1. Code window.2. Console window.3. Compile4. Save5. New6. File name7. Upload

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

Image Notes1. Connect the Arduino board to the computer.

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

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

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

Step 4: Add a Cover to Diffuse the LightAdd a paper cover to the Arduino Board to blend the RGB values into a single, uniform color:

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

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 Notes1. Cut on these creases.

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

Image Notes1. The Arduino and shield will fit nicely.

Image Notes1. This hole is for the USB cord.

Image Notes1. The paper cover diffuses the light so that the red, green, and blue mixestogether.

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

Step 5: Tweak the ProjectThe 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 themood 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 manysimple projects which can be constructed using this technology. Keep tinkering!

Related Instructables

Arduino moodlighting by sapc

Ambient CubeLighting.(Photos) byLftndbt

How To Capture- A Fallen Star.(Photos) byLftndbt

Mobius LEDLantern bysusannes

Flicker up to 6LEDs withArduino bygotcha99

Cheap obstaclesensor - withArduino! bydunnos