Mood Light Using Arduino

How to Make an LED Ambient Mood Light

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.

you can watch it working just click the link below

https://youtu.be/O2sjgZcJnQs

picture1

Component we need for this

Arduino Uno

  1. Three 220 ohm resistor
  2. One red led
  3. One blue led
  4. One green led
  5. Breadboard
  6. Breadboard cables
  7. White paper/ A plastic cap
  8. Scissors
  9. Tape

Step I

Firstly we have to connect all component

Step I

we have to take common ground take a breadboard wire and connect it to the ground of the

arduino and take the other end to breadboard.

picture2

Then connect 3 220 ohm resistor to ground

picture3

Now connect leds negative terminal to the ground and positive end to pin no 9,10,11 of

arduino respectively and the final assembly look like this.

picture4

Step II

In this step we have to make a box like structure to cover LED BULBS .

step3

Step III

Now we are going to upload program on arduino board

picture5
COPY AND PASTE THE FOLLOWING CODE TO ANRDUINO IDE

/*
Fade

This example shows how to fade an LED on pin 9
using the analogWrite() function.

This example code is in the public domain.
*/

int led9 = 9;
int led10 = 10;
int led11 = 11; // the pin that the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led9, OUTPUT);
pinMode(led10,OUTPUT);
pinMode(led11,OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(led9, brightness);
analogWrite(led10,brightness);
analogWrite(led11,brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) { fadeAmount = -fadeAmount ;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

Leave a comment