Author: Projects For Beginners

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);
}

Blinking The On Board LED

Component need for this project

  1. One Arduino Uno.
  2. One LED.
  3. Arduino IDE

If you don’t have an Arduino IDE don’t worry

  1. Just Goto https://www.arduino.cc/en/Main/Software
  2. Then choose Windows Installer if your operating system

is Windows else choose the suitable one according to your OS.

STEP I

Connect the Arduino Uno to your computer via data cable.

 picture1

 

 

STEP II

take a led and connect the positive leg to pin number 13 and negative to ground.

                                                                                                           

 picture2


STEP III

Write the code

Open arduino ide and go to file > example > basics > blink and open sketch or copy paste the given code bellow.

picture3

CODE

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin 13 as an output.

pinMode(13, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)

delay(1000);              // wait for a second

digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW

delay(1000);              // wait for a second

}

STEP IV

Uplode the code

To upload the code to the Arduino Board click on the forward arrow mark on the Toolbar

picture4

picture5

Wait for few second for program to be uploaded to the board ,after that LED will START BLINKING.