MAKING RGB DECORATIVE LIGHTS: Using An Arduino And WS2812B LEDs – DIY #20 #Arduino

MAKING RGB DECORATIVE LIGHTS: Using An Arduino And WS2812B LEDs – DIY #20 #Arduino


Since Christmas Eve is only a week away, I
decided to build this simple decorative light using an Arduino. This video is going to show
you how you can build one yourself, so let’s dive in. The first thing we need are some RGB LEDs
and I had these spare WS2812B LEDs so that’s what I will be using. These particular ones
have a waterproof tubing but you can also get them as a simple strip – either one will
work just fine. We then need these small plastic or acrylic containers and this is purely for
decorative purposes. The light tends to reflect off the surface and it gives you a nice effect.
We then need a microcontroller and I will be using an Arduino Nano clone. The code will
work with virtually any Arduino compatible board so you can use whichever one you have
with you. We then need some wire to connect them together and I purchased this three core,
twisted wire, purely for aesthetics and again, you can use any suitable wire you have with
you. Let’s start by testing the LED strip. The
strip is made up of individual LEDs that are connected in series. The LEDs themselves have
4 pins each – 2 for power and 2 for data. Data enters through the DIN or data input
pin and is sent out from the DOUT or data output pin. The data output pin needs to be
connected to the data input pin of the next LED. This can also be seen on the markings
themselves. We have the data output of one LED connected to the data input of the next,
giving you the direction in which the data will travel. What this means is that we can control multiple
LEDs by using a total of only 3 pins – 2 for power and 1 for data. This is extremely
convenient and it is also the reason why these types of LEDs gained popularity very quickly.
For testing the strip, simply connect the 5V and GND pins and the data pin to the digital
pin 2 on the Arduino board. This strip has a connector as seen here, but you can also
solder wires directly to the strip and they do contain markings as shown here. That’s
all we need to do now so let’s open up the Arduino IDE and work on the sketch. I will be using the fastLED library for this
project as I think it is very versatile and has a lot of features. You can even use the
Neopixel library from adafruit. Either way, open up the library manger, type in fastLED
and install the library. Then open up the demoReel 100 example sketch. We need to specify
the data pin and the number of LEDs. In our case, we are using pin 2 as the data pin and
this particular strip has 23 LEDs. Once this is done, simply connect the board, select
the right board and COM port from the tools menu and then hit the upload button. Wait
for it to complete and you should see some patterns on the LED strip which will tell
you that everything is working as expected. I update the number of LEDs to 5 and upload
the code again, as I will only be using 5 LEDs. Let’s now build the final version. Start
by cutting the individual LEDs from the strip. The strip can be cut at the lines shown here.
I’m going to remove the LEDs from the waterproof tubing as we do not need that. Next, we need
to decide on a mounting location. The plastic containers that I am using have a lid that
can be screwed open, which is very handy. I decided to drill a hole in the center of
the lid and stick the LED on the outside. This way, you can even draw something on this
top surface to add some more effects to the light ouput. You can add a bit of tape to prevent the drill
bit from slipping. Then drill holes into all the containers you will be using. Cut 4 pieces
of wire with the required length, I will be using equal lengths but you can adjust this
to suit the final positioning. We also need some wire to connect the microcontroller to
the first LED and cut the appropriate length so that you can hide the board. Once done,
solder all the LEDs together by making sure you connect the right wires to the 3 pins.
Then, solder the wires between the microcontroller and the first LED. Remember, the data pin
has to be connected to the DI or data input pin as this is the first LED. Once done, simply
plug in the microcontroller to make sure everything works as expected. All that’s left to do now is to stick the
LEDs to the plastic containers and place them in position. I’m using double sided tape
for this but you can also use some glue or simply add some tape to the bottom of the
container. Also, use some heatshrink or tape to insulate the microcontroller board. I’m
using Kapton tape here. Then, screw the lids in place and position them as required. Plug
in the USB cable and you should see them glow. You can change the patterns as required and
you can even program the board to display a few colors if you are looking for a particular
color theme for instance. Do also check out the Neopixel demos for some ideas or inspirations.
Since they use the same LEDs, the sketches will work with this build as well. Each of
the LEDs consume about 60mA, so make sure you have a power supply that’s capable of
providing the required power. We have built two power supply projects so far so do watch
those videos if you plan on building one yourself. And that’s how you can quickly build some
decorative lights using an addressable LED strip and an Arduino board. I do hope you
liked this video. Please don’t forget to like share and subscribe, if you haven’t
already. Thank you for watching and I will see you in the next one!

About the Author: Earl Hamill

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *