We are now going to build this beautiful RGB cellular lamp that can be controlled over
WiFi. The control page consists of a color wheel which allows you to quickly change colors
and you can also specify the RGB values directly to create a total of over 16 million color
combinations.
This build will use a Wemos D1 mini compatible board that consists of an ESP8266 module.
We will also use a microUSB breakout board to supply power as well as several WS2812B
addressable RGB LEDs. The D1 mini board has a microUSB connector and 5V output but power
from the USB connector first passes through a diode and a 500mA fuse before reaching the
pin. We need much higher current than this as each LED can take up to 60mA at full brightness.
That’s the reason why we will use a microUSB breakout board to power this lamp.
The cellular design has been downloaded from Thingiverse and it features the cellular structure,
along with a base to diffuse the light and also a stand that is a little flimsy. I used
the files marked 140 and scaled them back to 70% as I didn’t want something too big
You can either stick the stand to the base using some glue or you can try to insert it
inside the base by trimming the base a little. I decided on the latter and started off by
chipping away the base. This didn’t work out very well so I then used an old soldering
iron to melt away the edges such that the stand could fit in. Once this was done, it
was time to work with the LEDs.
The strip I’m using is made up of 5V WS2812B LEDs and it contains 60LEDs/meter. They are
also available as 144 LEDs/meter and these would be better depending on what you’re
going for. I started by measuring the strip length, cutting them to size and then sticking
them one at a time. I decided to add as many LEDs as possible and this meant that I wanted
to create a second layer. But first, I soldered some wires to the small strips before covering
them with the second layer. Here’s what the layout looks like.
I then had to wire it all in place but before doing this, I used a multimeter to determine
the pin out for the LED strip. The data has to flow from the input pin to the output so
keep this in mind. The power pins are all wired in parallel so this does not matter
as much as long as the polarity is correct. I decided to rotate the middle strip in the
top layer to make the wiring a little simpler and ideally, you’d want to flip the first
layer as well but I did not want to take it all apart.
Carefully solder all the individual LED strips keeping a note of the direction of the data
pins. Here’s what the final layout looks like for me and here’s how the data will
flow through the strips. I then cut a slight opening in the stand to allow the cables to
pass through which should help with the final assembly.
Now that this bit was done, it was time to work on the code. I found this sketch on github
which was simple yet perfect for this project and decided to use it. I added a serial print
line to give us the IP address of the lamp as we need this to control it. Simply download
the updated sketch from the link in the description and open it up using the Arduino IDE.
You need to specify the number of pixels or LEDs contained in the final strip. I have
a total of 26 LEDs connected. You also need to specify the WiFi network SSID and password
as the board needs to connect to your local network. You can also specify the default
RGB values when the lamps boots up. All the LEDs will have the same color to give us a
uniform look.
Before we can upload the sketch, we need to install the ESP8266 board support package
in the Arduino IDE. Open up the preferences window, add the following URL to the board
manager section and then close the window. Open up the board manager, type in ESP8266
and install the package as shown here. Wait for it to complete and then close the window.
You should see the new boards available for use so connect the board, and select the correct
board settings as shown here.
Once done, hit the upload button and wait for it to complete. Open up the serial monitor
and wait for the IP address to get printed on the port. Generally, the same IP address
will be assigned to the board but this depends on your WiFI router and you can reserve an
IP address for the board if needed.
We then start wiring the LED strip to the board, followed by the microUSB breakout board
by using the reference wiring diagram shown here. Power on the lamp using a suitable power
supply. Remember that each LED will consume maximum current of about 60mA so for 26 LEDs
the maximum current draw would be about 26*60mA or about 1.56A. To be on the safe side, it
is better to use a power supply that can deliver up to 2A of current at 5V. The USB power hub
we built earlier will work just fine.
Now that the LEDs work correctly, it is time to wire it all in place. Start by removing
the wires and mounting the boards first. I decided to use double sided tape to hold the
PCBs in place. I then cut the wires to the correct length and soldered them to the correct
pins. Finally, I soldered the power pins from the USB breakout board.
Simply slide the stand into the base and plug in a microUSB cable. At this point I realized
that it was probably a better idea to glue the stand on the outside rather than pushing
it inside the base. Gluing it in place would have also allowed for a more rigid finish.
I will be building a second lamp like this so I’ll do that the next time. It’s also
a better idea to use a USB connector with a slim profile or you can also trim the base
a little.
Enter the IP address into
a web browser – either on the phone or computer and click the control button. You should then
obtain a color wheel. Simply tap or click the color you want and the lamp color should
get updated. You can also specify the RGB values directly and the lamp should accept
these.
Apart from the slight instability with the base and stand due to my fault, I’m pretty
happy with the outcome, given how simple this build is. Like I said, I will build another
lamp to use them both as my desktop light and I will also reprint the base and stand
to do it the other way. Using the web browser is not entirely convenient but I will be integrating
this lamp into a home automation project along with some more sensors. That should improve
the overall usability. If home automation does interest you then do subscribe to stay
notified.
If you liked this build then do hit that like button. Thank you for watching and I will
see you in the next one!