Header Ads Widget

How to make high power RGB Lamp (Mood Lamp) using ESP01?

Colorful lights attracts every one, be it a kid or middle aged or old aged people. But based on age and mood our choices keeps changing. RGB lamps are good choice to select the color of lamp of your choice based on mood or time or any function. As we can set the color of our own choice and mood, hence this is also called "Mood Lamp". Since the different combination of Red, Green and Blue lights can create any color of visible spectrum, hence these lamps are best to select color of your choice. Here I am presenting a design of RGB lamp or mood lamp which can be controlled through a mobile application over wi-fi without internet. It is one of the applications of IoT (Internet of Things).

High Power RGB Lamp

The lamp act as an wireless access point (AP) based on ESP01 module and connects with your mobile. The android application allows to select different modes to control the lamp color and choose color of your choice. Apart from manual color selection, there are some modes to select from like flasher mode, auto color change mode, single color etc.

Parts Required:


The circuit diagram is shown below. I have used  pair of BS170 low power mosfets to drive each LED leg whose connection diagram is shown in next diagram. Although single BS170 is capable to drive string of each color LED, still I have used two in parallel to avoid heating over long run. For resistance 'R8', I have used 12Ω + 4.7Ω in series to get 16.7Ω.

RGB lamp circuit

The connection of red, green and blue color LED is shown below. Three 1watt LEDs are connected in series to achieve 3watt power. You can use RGB led also to minimize the space required to place the LEDs. I had 1watt LEDs in hand hence used this way. You can see two legs of blue LED because light emitted by blue LED are low as compared to red and green one, hence I added additional leg to compensate. I am using common anode mode here.
  
RGB LED Assembly

The code is written in Arduino as below.

Program the ESP 01 with above Arduino code and connect the parts on general purpose board or you may create PCB as suggest below.

High Power RGB light PCB

For preparing the base of LEDs, I have taken tin lid of paint box, you can take any circular metallic base. Clean the surface with sand paper. Make holes to pass the wires for common anode and individual color LED wires. Solder each color LED is series and take the final output wire for connecting to circuit. You may use some glue to fix the LED heat sink on the metallic base. It will be better if you use dual sided tape which comes for heat sinks.
                                  
RGB Light

I have used a PVC pipe of 2 inch height and 4.25 inch diameter, covered one side with circular disc to make base. Make small cut on side of PVC pipe or make holes with drill to allow passage of air so that components get circulated air. 
Make some arrangement to fix the PCB and 12V DC adapter in the base and connect the LED base wire to controller PCB. Solder long wire at the AC input side of 12V adapter and take out from hole in PVC pipe to power the light. To make diffuser you can use diffuser from any old defective high power LED lamp as per size to cover your LED assembly. I have used a milky plastic food container here as it fits and work properly for me. I have made few small pin holes on top of my diffuser as my LED base was heating up as hot air inside it was trapped and made it hot in long run. With only three pin holes this issue was resolved.
        
Mood Lamp

Once hardware setup is done, download the android application from here and install on your android phone.

There are three screens in this application, one is home screen, second is setting screen and third is help screen as shown below. Help screen guide you how to setup the application and connect with RGB lamp. 

RGB Controller Android App

Click on setting screen and enter IP - 192.168.1.5 as you can see in arduino code, we have set this IP. You may change it to any of your choice in code. Once IP is entered, click OK. It will be stored in application database for ever.
If you click "Clear" in setting screen, any stored IP will be deleted from application.
Power ON the mood lamp/RGB lamp, it will start operating in default color change mode i.e. RGB flash and fade mode.
Switch ON the wi-fi on your mobile, you should see new AP named "Mood_Light", connect to it. You may change the name in Arduino code if you wish.
It will ask for password, enter "12345678" as we have set in Arduino code. You may change password of your own choice in code itself before programming the ESP 01 module.
Once connected, comeback to home screen and start enjoying your mood lamp.

There are multiple options to choose from:

1- Select individual color that is Red, Green or Blue

2- Select Auto color change mode which has four sub modes

i - Slow Auto Color change mode - Color automatically change to whole spectrum mixing individual colors through cycle very slowly. 
ii - Fast Auto Color change mode -  Color automatically change to whole spectrum mixing individual colors through cycle fast. 
iii - RGB Mode - Each color fades in and fades out and then flashes in cycle. 
iv - Flasher Mode -  Lamp flashes in eight colors in cycle. You can change values in sub routine "void flasher ()" to get flash color of your choice. Ensure the value is some where between '0' to '255'. To choose the color, you can use manual drag mode as mentioned in next mode and note the value of 'r', 'g' & 'b' from application and change in Arduino code.

3-  This is manual color selection mode. Drag the black ball in the color window of application to select the color of your choice. The RGB value of selected screen color is displayed in the "Color Value" field below color canvas.

Watch out the video to get the idea how it works.



Return to List of content                                                Return to DIY Project List

Post a Comment

0 Comments