Introduction: Arduino Mood Lamp

Picture of Arduino Mood Lamp

Hello Instructables Users!!! This is a simple, fun, and useful project for arduino beginners. You will be building the lamp and then uploading the code to make the lamp light up to a color of your liking. The color is smooth and lights up the area of your room you put it in.

Step 1: Step 1: Needed Parts

Picture of Step 1: Needed Parts

These are the parts needed to build the lamp:

1.) Jumper wires

2.) 120k Ohm resistor

3.) The LED color of your choice

4.) LDR (photo light resistor)

5.) Arduino Uno

6.) Breadboard

Step 2: Step 2: Building the Lamp

Picture of Step 2: Building the Lamp

The following photo above is a schematic to build your mood lamp

Step 3: Step 3: Coding the Arduino

Copy and Paste the following code to use for your lamp:

void setup(){
pinMode(redLed,OUTPUT); pinMode(greenLed,OUTPUT); pinMode(blueLed,OUTPUT); digitalWrite(redLed,HIGH); digitalWrite(greenLed,LOW); digitalWrite(blueLed,LOW); }

void loop(){ for (int y=0; y<=3; y++) { if (y=1){ for (int x=0;x<=255;x++){ RGB[0]=255-x; RGB[1]=0; RGB[2]=0+x; analogWrite(redLed,RGB[0]); analogWrite(greenLed,RGB[1]); analogWrite(blueLed,RGB[2]); delay(delaymood); } } if (y=2){ for (int x=0;x<=255;x++){ RGB[0]=0; RGB[1]=0+x; RGB[2]=255-x; analogWrite(redLed,RGB[0]); analogWrite(greenLed,RGB[1]); analogWrite(blueLed,RGB[2]); delay(delaymood); } } if (y=3){ for (int x=0;x<=255;x++){ RGB[0]=0+x; RGB[1]=255-x; RGB[2]=0; analogWrite(redLed,RGB[0]); analogWrite(greenLed,RGB[1]); analogWrite(blueLed,RGB[2]); delay(delaymood); } } } }

Step 4: Step 4: Final Result

Picture of Step 4: Final Result

The final outcome of the lamp is a smooth color added to your room for light!


__dan__ (author)2017-08-24

The LDR related code is missing in the Arduino sketch!

Seems like you just copied parts of the code from the original "Arduino Mood Lamp" instructable by ricardouvina! (

You have also copied and used the schematics and photos/images from the original author and made screenshots of his video!

Can you please share any code, schematics, photos and videos of your own working mood lamp?

Please be fair and honest and give credits to the original author (ricardouvina) and include a link to the original instructable if you knock off any source code, schematics, images and videos!

The original author (ricardouvina) spend a lot of time and effort on his project. He did a great job and deserves better!

You_know_me (author)2016-10-31

Can you please describe a bit more about how you made that tall lamp shade of yours ? It looks rather interesting!

seamster (author)2016-05-13

Looks good! :)

About This Instructable



More by EddyL00:Arduino Mood Lamp
Add instructable to: