LED Mood Lamp

by indoorgeek in Circuits > LEDs

19711 Views, 171 Favorites, 0 Comments

LED Mood Lamp

Make your own LED Mood Lamp | Arduino + WS2812
Thumbnail_Instruc.jpg

I recently came across an LED Cube by Greg Davill. It's a great piece of artwork. Getting inspired by it, even I wanted to make something like that. But this one was way out of my league. I decided to take one step at a time and made a way smaller version of LED Cube as a Mood Lamp. It can be a good starting point to learn about the hardware, which are mostly LEDs and microcontrollers, and software to control them (creating animations).

In this Instructable, I will show you how I made an LED Cube using the popular WS2812 LEDs.

Let's get started!

Things You Will Need

DSC_4755.JPG
DSC_4753.JPG
DSC_4736.JPG

96x WS2812 LEDs

6x PCBs

1x Arduino Nano

1x 5V/1A Power Supply

The Plan

IMG_20191124_013911.jpg
Sequence 01.00_00_08_15.Still001.jpg

The plan is to make a mood lamp. I wanted to keep it simple and so I decided to go with the popular WS2812 Individually Addressable LEDs. The LEDs are connected in cascade which means that you can control as many LEDs you want by just one signal line/wire from the microcontroller. This makes wiring a lot easy.

The LEDs are available only in SMD format. So, the next step will be to design the PCBs.

The next step is to design and 3D print a structure to hold the PCBs in the shape of a cube.

The LEDs will be controlled using Arduino Nano. The last step will be to design and 3D print an enclosure for Arduino.

PCB Designing

1.jpg
3.jpg
DSC_4736.JPG

You can use any software you like for designing PCBs. I am using EasyEDA as it is suitable for newbies like me. I have attached the schematic. Click here to download Gerber files for the PCB.

LED has 4 pins:

  1. VDD - 5V
  2. DOUT - Signal Out
  3. VSS - Ground
  4. DIN - Signal In

As mentioned earlier, the LEDs are connected in cascade which means that the signal comes IN from the microcontroller to the 1st LED at the DIN pin. From DOUT pin, the signal goes to the DIN pin of the 2nd LED.

While designing the PCBs, I had thought of hand soldering the LEDs and so I have kept sufficient space between the LEDs for the soldering iron to reach the pads. But later, as you will see, I went with reflow soldering with my makeshift setup since this method is quick and neat (and satisfying to watch) if done correctly.

Once you have completed designing the PCB, get it fabricated from the manufacturer of your choice. I chose JLCPCB because of its quick service.

Assembling the PCBs

Sequence 01.00_00_51_17.Still002.jpg
Sequence 01.00_01_01_25.Still003.jpg
Sequence 01.00_01_09_25.Still004.jpg
Sequence 01.00_01_18_06.Still005.jpg
Sequence 01.00_01_30_05.Still006.jpg
IMG_20191122_194535.jpg
Sequence 01.00_01_34_24.Still007.jpg

At first, I started hand soldering the LEDs one by one. The result was not good and the LEDs were getting overheated which is not a good sign. Also, it is a time-consuming process and soldering 96 LEDs will require a lot of time.

The most widely used method to solder SMD components is called Reflow Soldering. In this method, solder paste (a mixture of solder and flux) is applied to the pads on the PCB and the components are placed on it. The solder paste is then made to melt or 'reflow' by heating it in a reflow oven. This is a quick and neat method if done correctly.

Using this method means I would require a Reflow Oven. But then I remembered a project by Moritz König wherein he used an old flat iron and Wemos to control the temperature. The only thing I had on hand was a flat iron which was still being used. The temperature of the iron reached about 220 degree celsius at its maximum setting and the solder paste I bought melts at 183 degrees. Taking a look at the reflow soldering temperature profile from the datasheet of LED, we can see that the maximum temperature (Tp) is 240 degrees for 10 secs. Everything looks promising and so I gave it a try.

I applied the paste onto the pads using a toothpick and placed the components. The placement is not critical as the solder pulls the components in place when it melts. I placed the PCB on the iron as shown in the photo and turned ON the iron. I turned OFF the iron when all the solder has melted and removed the PCB from the iron.

It worked a treat!

Assembling the Cube

Sequence 01.00_01_47_17.Still008.jpg
2.jpg
Sequence 01.00_01_52_16.Still009.jpg
Sequence 01.00_01_56_16.Still010.jpg
IMG_20191214_130715.jpg
Layout.jpg
Sequence 01.00_01_59_13.Still011.jpg
Sequence 01.00_02_00_13.Still012.jpg

I 3D printed a structure to hold the PCBs in place. The 3D files have been attached here. You need to print 1x Skeleton and 6x Holder. Attach the holders at the back of the PCB using superglue as shown in the picture. The PCBs can then be snapped into place on the skeleton structure. It is a friction fit. Sanding may be required.

Do the wiring as shown in the layout. Soldering can be a bit tricky here.

Assembling the Base

Sequence 01.00_02_03_03.Still013.jpg
Sequence 01.00_02_07_15.Still014.jpg
Sequence 01.00_02_10_07.Still015.jpg
5.jpg
4.jpg
Sequence 01.00_02_13_16.Still016.jpg

3D files for the base have been attached here. The base will house the Arduino Nano. There will be a total of 3 wires going to the cube viz. DIN, 5V and GND. I am powering the cube through a USB Phone charger. Make sure that it is capable of handling at least 1A.

DIN pin can be connected to any of the digital pins on the Arduino. I chose D4.

Time for Coding

6.jpg

For now, I will be using an example sketch from FastLED Library. Install the library using the Library Manager. Open up the DemoReel100 from the example sketches. File > Examples > FastLED > DemoReel100

Before uploading the code, make the following changes:

  • Define DATA_PIN (pin on Arduino to which DIN of the cube is connected) to whatever you have chosen. In my case, 4 (Digital Pin 4)
  • Define LED_TYPE as WS2812
  • Define NUM_LEDS as 96

And, hit Upload!

Enjoy!

Power up your lamp and enjoy staring at it!

Thank you for sticking to the end. Hope you all love this project and learned something new today. Let me know if you make one for yourself. Subscribe to my YouTube channel for more such projects. Thank you once again!

Future Plans

  • Connecting the cube to the internet (IoT) using ESP8266 and to notify me whenever an 'event' occurs.
  • Creating my own animations.