Diwali Decor Using WS2812 LEDs
Hello and welcome back to another Instructables. On the occasion of Diwali, the festival of lights, I made a small PCB resembling an oil lamp that is lit during Diwali which represents enlightenment, knowledge, or wisdom. Lamps are a part of Indian culture, as a representative for auspicious reasons, as well as an indicator of light that destroys darkness.
This is going to be a simple one. Let's get started!
Supplies
The Plan
The plan is very simple. I will be designing a PCB shaped like a lamp. WS2812B individually addressable LEDs will be placed along the outline of the PCB. These types of LEDs are very easy to control and connect together by cascading them. I will be then connecting many such lamps together to form a string. I first wanted to write animations by myself but then decided to use the example code which comes with the FastLED library.
PCB Design & Electronics
I designed these PCBs in Altium Designer. Click here to get a free trial and start designing your beautiful boards.
I wanted to go for a 'pixelated' look, one pixel being the size of an actual LED. I first started by drawing the outline of the board. At the time of designing the PCB, I was not having these LEDs on hand and so I was not sure about the current draw of LEDs. The datasheet (which is in Chinese) was not much of the help either. So, I made 5V rails to be thick. I later found after testing that they are too thick for the current drawn by the circuit.
I ordered the PCBs from JLPCB along with the stencil. Click here to get your PCBs professionally made from JLCPCB for just 2$. I have attached a schematic in this step. Click here to download the Gerber files if you wish to make one.
I received my boards within a week of ordering. Using the stencil makes the job easy and so satisfying. I prepared around 10 boards that were connected in a cascade i.e. output of the first board goes to the input of the next board and so on.
Downloads
Enjoy!
After soldering all the PCBs, I connected the first one to Arduino (any model will work) as follows:
- '+' to 5V
- '-' to GND
- IN to D3
Install the FastLED library. As said earlier, I used an example sketch from the FastLED library. In the Arduino IDE, go to Files>Examples>FastLED>DemoReel101. I set the brightness to 50 which led to the current consumption of approximately 70mA per board (42 LEDs). Make sure all the other parameters are defined correctly as per the connection.
LED_TYPE - WS2812B
DATA_PIN - 3
NUM_LEDS - 42 (for one board)
I have used a total of 10 such boards (420 LEDs) which led to a current draw of 700mA. This was way too less than I anticipated. A 5V/1A was enough to power the LEDs along with the Arduino.
Thank you for sticking to the end. I hope you love this project.
Stay safe and I’ll see you in the next one!