Introduction: Smart Lamp

Ever since the discovery of fire, we managed to stay warm and survive in a small colony. Primitive humans can gather around and watch out for wild animals for each other during night time.

And then Thomas Edison literally lights up the world by replacing oil lamp with incandescent lamp, which works via a tungsten filament in a vacuum tube.

In this tutorial, let's move forward by building a smart lamp with RGB LEDs on it and as well as control of it over the internet so that you can control it from anywhere else in the planet so long as you have an internet connection.


  • 20x 5mm White LEDs
  • ESP8266
  • Arduino
  • Any Toggle Switch
  • MicroUSB female PCB Adapter
  • RGB LED Strip
  • 3x TIP31C Transistor

Step 1: Gather Up All the Parts

The first step would be to 3D print all the needed parts. They are all available here. It would really help if you have more than one printers available. Still works if you have 1 printer but it will take some time. For me, I'm using white PLA plastic and my college's army of 3D Printers to build this beast.

Step 2: Give the Parts a Nice Finish

I would love a smooth finish on my smart lamp so I sand down all the staircase surfaces from the 3D Printer and then added some white paint to the blue top. (I only have that many white filaments to use at once.)

To sand 3D printed parts, start with about 100 grid sandpaper and then slowly move up to 500 grid or higher. And to wash off all the powdered plastic, just use alcohol to get the job done.

Step 3: Add Frosted Panel Onto the 3D Printed LED Holder

One of the 3D Printed parts is the bottom LED holder, the one with a large rectangular hole. We'll need to create a frosty and somewhat transparent finish on that to diffuse the sharp white LED.

To do that, I melted a bunch of hot glue and cast it onto the rectangular hole. You can use other casts such as candle wax but it may not stay in place as well.

Step 4: Work on the Electronics

You'll need 20 white LEDs and some RGB LED strip to light up the lamp like a Christmas light. The white LED goes into the holder which is the one with a bunch of circular holes in it. The legs will fit through the hole and you'll need to connect them in parallel. Since it draws so much current, you can try power it up directly with the 5V but I recommend adding a 10-ohm resistor in series.

The circuit, on the other hand, consist of the DC to dc converter, Arduino, TIP31 transistor and ESP8266. The DC to DC converter steps up the 5v to 12v for the RGB Led and it gets controlled by the transistor. Meanwhile, the ESP8266 will allow for TCP and UDP requests for the internet of things.

Step 5: Code!

The firmware for the Arduino will have to communicate with the ESP8266 and perform some TCP request to get information on what amount of power is desired to drive the colors of the RGB Led and the white led.

The server is my self made Python and Flask IoT server. More projects will be using the same server in the future. If you're not confident with web development, try using Blynk instead. Just modify my code a little bit for it.

Both the IoT server and the Arduino firmware is available on my GitHub.

Step 6: Enjoy Your Futuristic Lamp

Who needs IKEA when you can create your own Smart Lamp? You can now control your light using the Internet. Thus, you can shut it off at school if you forgot about it. In the event that there is no WiFi available, it will just time out and default to turning up all the light to the max brightness.

Go ahead and impress your friends and family with your creation! I'm sure they will be in awe over it.

IoT Challenge

Participated in the
IoT Challenge