Mood Lamp
![bleu.jpg](/proxy/?url=https://content.instructables.com/FRF/N6LM/IK4AETAJ/FRFN6LMIK4AETAJ.jpg&filename=bleu.jpg)
![voorkant.jpg](/proxy/?url=https://content.instructables.com/FJL/9O59/IK4AETAI/FJL9O59IK4AETAI.jpg&filename=voorkant.jpg)
![roo0d.jpg](/proxy/?url=https://content.instructables.com/FWG/3W3H/IK4AETAK/FWG3W3HIK4AETAK.jpg&filename=roo0d.jpg)
![groen.jpg](/proxy/?url=https://content.instructables.com/FEH/7WJ8/IK4AETAL/FEH7WJ8IK4AETAL.jpg&filename=groen.jpg)
![DSC_0331.JPG](/proxy/?url=https://content.instructables.com/FOS/SGIY/IK4AETAO/FOSSGIYIK4AETAO.jpg&filename=DSC_0331.JPG)
![DSC_0330.JPG](/proxy/?url=https://content.instructables.com/FO9/ISFQ/IK4AETAP/FO9ISFQIK4AETAP.jpg&filename=DSC_0330.JPG)
This instructable will show you how to build a mood lamp.
Gather Materials
- Arduino
- 8 WS2812B leds
- Wires to connect the leds
- Wood (any will do i used Walnut)
- Perspex 3mm
- Screws
- Wood glue
TOOLS
- Table saw
- Glue gun
- Wire stripper
- Solder iron/gun
Connecting the Leds
![DSC_0304.JPG](/proxy/?url=https://content.instructables.com/FST/5R1G/IJYUZO3E/FST5R1GIJYUZO3E.jpg&filename=DSC_0304.JPG)
![DSC_0318.JPG](/proxy/?url=https://content.instructables.com/F75/KFDS/IJYUZO70/F75KFDSIJYUZO70.jpg&filename=DSC_0318.JPG)
![DSC_0319.JPG](/proxy/?url=https://content.instructables.com/FCJ/6WIS/IJYUZO8K/FCJ6WISIJYUZO8K.jpg&filename=DSC_0319.JPG)
These Leds are not pre-soldered, that means you will have to solder them yourself.
Make sure you connect the 5V with the 5V of the next led following the arrow.
Do the same with the GND (Ground).
Connect the Dout (Data Out) of the first led with the DIN (Data IN) of the second led etc.
Connect the DIN of the first LED with pin 3 on your Arduino, the 5V with the 5V on the Arduino and the GND with the GND on the arduino.
THE CODE
This is the Code i used.
You can change the speed of the cycle by changing this number
void loop() { rainbowCycle(3000)
.
#include
#define PIN 3
// Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(8*14, PIN, NEO_GRB + NEO_KHZ800);
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across // pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input // and minimize distance between Arduino and first pixel. Avoid connecting // on a live circuit...if you must, connect GND first.
void setup() { strip.begin(); strip.show(); // Initialize all pixels to 'off' }
void loop() { rainbowCycle(3000); }
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) { for(i=0; i< strip.numPixels(); i++) { strip.setPixelColor(i, Wheel((((i) * 256 / strip.numPixels()) + j) & 255)); } strip.show(); delay(wait); } }
// Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(WheelPos < 85) { return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else { WheelPos -= 170; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } }
Making the Stand
![DSC_0313.JPG](/proxy/?url=https://content.instructables.com/FF2/MFJ9/IK2X9BIN/FF2MFJ9IK2X9BIN.jpg&filename=DSC_0313.JPG)
![DSC_0315.JPG](/proxy/?url=https://content.instructables.com/FLO/Q5NM/IJYUZQPM/FLOQ5NMIJYUZQPM.jpg&filename=DSC_0315.JPG)
![DSC_0314.JPG](/proxy/?url=https://content.instructables.com/FA1/4TDT/IK4AETH8/FA14TDTIK4AETH8.jpg&filename=DSC_0314.JPG)
The Wooden stand is made up of 4 identical pieces.
To make this you will need a piece of wood thats at least 520x30x50mm
with this piece of wood you need to saw the profile of the first picture
Now you will need to saw this piece in to 4 pieces of 130mm in a 45 degree angle.
now glue them together with wood glue
Perspex
![lijmen.jpg](/proxy/?url=https://content.instructables.com/FR6/BTNM/IJYUZT0I/FR6BTNMIJYUZT0I.jpg&filename=lijmen.jpg)
For this bit you will need a sheet of perspex of atleast 550*150*3mm
you wil need to saw this sheet in 5 pieces under a 45 degree angle.
take the last piece and saw this into a square of 11mm.
First glue the 4 identical pieces. this can be done by laying all the pieces next together on piece of tape to secure them in place.
now glue them together 1 by 1 and finish with the top.
Putting It Together
![DSC_0334.JPG](/proxy/?url=https://content.instructables.com/F76/0SKE/IK2V3JMW/F760SKEIK2V3JMW.jpg&filename=DSC_0334.JPG)
![DSC_0318.JPG](/proxy/?url=https://content.instructables.com/F97/M5N3/IK2V3JUO/F97M5N3IK2V3JUO.jpg&filename=DSC_0318.JPG)
![DSC_0322.JPG](/proxy/?url=https://content.instructables.com/FM1/YZWW/IK4AET2Y/FM1YZWWIK4AET2Y.jpg&filename=DSC_0322.JPG)
![DSC_0331.JPG](/proxy/?url=https://content.instructables.com/F8R/5E11/IK2V3JN1/F8R5E11IK2V3JN1.jpg&filename=DSC_0331.JPG)
![DSC_0332.JPG](/proxy/?url=https://content.instructables.com/FTU/WBBA/IK2V3JN4/FTUWBBAIK2V3JN4.jpg&filename=DSC_0332.JPG)
![DSC_0330.JPG](/proxy/?url=https://content.instructables.com/FBB/IRBA/IK2V3JP9/FBBIRBAIK2V3JP9.jpg&filename=DSC_0330.JPG)
if you did everything correctly you now have color changing leds, a wooden stand and a perspex top.
now you will have to hide the arduino in de wooden stand.
To fit the arduino in the stand you will have to screw it onto the bottom plate.
to fit the power supply you will have to make a hole in one of the sides.
glue the bottom plate to the stand where the hole fits the power port
now you can place another wooden plate onto the arduino buit make a little hole for the wires to go through.
i used double sided tape to secure the led inplace you can also do this with hot glue.
now slide the perpex top into the wooden groove.