loading

A smart bulb is an internet or Bluetooth-capable LED light bulb that allows lighting to be customized, scheduled and controlled remotely. Smart bulbs are among the most immediately successful offerings in the growing category of home automation and Internet of Things (IoT) products. In today's market many types of smart bulbs are available form price $10 to $100. But, can you think you can convert a low price led bulb to a smart bulb easily? Today I will show you how I converted a cheap Chinese led lamp to a Smart Lamp.

Before going to the details let me explain the basic features of my Smart Lamp.

1. The lamp can be controlled from Android phone using Bluetooth.

2. It can be used as true white lamp as well as color lamp and can produce 16 million colors.

3. Brightness and color can be controlled from smart phone.

4. It operates directly from AC mains.


Project Video Here

Step 1: Collect the Materials

1. Low Price LED Light Bulb (ebay.com)

Many types of LED light bulbs are available in local market. Different types of wattage rating are also available. Select one as your requirement. I bought a $1.5, 7W LED Bulb from my local market.

2. Arduino UNO R3 (ebay.com) (gearbest.com)

As we want to include some control mechanism and communication features to our light bulb a microcontroller will be required. I selected Arduino UNO because developing prototype using Arduino is very easy. I just programmed the board, tested it and then removed the microcontroller from the UNO board. Then, I put the microcontroller to the circuit board.

3. HC-05 Bluetooth Module (ebay.com) (gearbest.com)

For communication with the light bulb from my smart phone I want to use Bluetooth and for the reason I selected low price HC-05 module. The module is working as slave mode and my phone as master.

4. RGB-LED 4 pin 5mm (8pcs) (ebay.com)

There is some power limitation as well as space limitation and for that I used only 8 RGB LEDs. RGB leds are very cool. These have four pin. One is the common and other three pin for three basic colors. You may use datasheet for details pin configuration. Using PWM 16million color can be generated from an RGB led.

5. Optocoupler TLP627 (ebay.com)

Optocoupler has an important role in our project. In the lad light bulb all LEDs are connected in series and connected to 100 V DC. Very simple transformer less power supply is used for step down and rectification and I found enough ripple in the output. If we want to on/off and control brightness of the lamp remotely we have to use a switch between rectifier output and LEDs. A high voltage transistor can be used for the job but for driving the transistor we have to connect it to the microcontroller. As transistor are working in high voltage it may damaged the microcontroller if you directly connect the base of the transistor to the microcontroller. So, an isolation is required between transistor and microcontroller and for the reason I selected opto-transistor instead of general transistor. It is a high voltage opto-transistor and can handle 150mA current which is enough for our circuit.

6. Prototype PCB board (ebay.com)

PCB board is for making connection to all RGB LEDs, transistors and microcontroller.

7. Resistor 100ohm (24pcs, 1/4w), 4.7k (3pcs, 1/4w) (ebay.com)

8. Jumper Cables (ebay.com)

9. Old Android Phone Charger (small size)

This is one of the critical component of our project. It will power the microcontroller and all RGB LEDs. Important fact is that power supply should be small enough and the output should be ripple free 5V, 1A. So, select a good SMP supply of 5V, 1A output. I selected the charger of my old HTC phone and I found it good enough for driving the circuit. Selecting wrong power supply may damaged your circuit, so do it at your own risk.

Tools

1. Soldering Iron (ebay.com) (gearbest.com)

2. Diagonal wire cutter

3. Knife

4. Multimeter (ebay.com) (gearbest.com)

5. Desoldering pump (ebay.com)


Step 2: Open the Lamp

At first, take the led light blub and remove the globe shaped diffuser cap. Bring out the circuit board from the base. You will find led driver circuit is vary simple. You will get two capacitor at the bottom of the circuit board. One capacitor is voltage dropper (rectangular shape) and another is filter capacitor. On the top you will find four diode working as bridge rectifier and a current limiting resistor. So, VERY SIMPLE!

Step 3: Hack the Circuit Board

Two big sized capacitors ware placed in the bottom side of the led driver circuit. Remove these two capacitor carefully using desoldering pump. We will be required enough place in bottom side and for the reason we are removing these from bottom side. Don't be confused, we will resolder these in upper side.

Step 4: Cut the Trace

All leds are connected in series. These are connected to the output of the bridge rectifier. Using an anti cutter cut the trace between rectifier output and leds. The reason behind it is that, we want to on/off the lamp manually form smart phone and we also want to control the brightness of the lamp. So we will be required a transistor switch between these. We will drive the transistor using Arduino microcontroller. Instead of general purpose transistor we will place an optoisolator/optotransistor between rectifier and leds.

Step 5: Re-solder the Capacitors

As we removed the capacitors we have to reconnect these but in opposite side. It is the right time to re-soldering the capacitors we removed before. First solder the filter capacitor at it's original place from top side. Be careful, this is electrolytic and polarity must be correct. Now, solder the voltage dropper capacitor at it's place. It is non polarized, so you can solder it either way. At the last stage, we will connect opto-transistor. Connect collector pin of the optoisolator (pin #4 for TLP627) to the output of bridge rectifier and emitter to the leds (pin #3 of 627). Connect two wires to anode and cathode pin (pin # 1 & 2 respectively) of the optocoupler for next step.

Step 6: Cut the PCB

Take a prototype PCB board and cut it in round shape. Cut it in such a way that we can easily place it within the base of the light bulb. Don't make it too small, we will be required enough place at the bottom of it to place Bluetooth module and adapter circuit. Don't make it to big, we have to place microcontroller, RGB LEDs and white LED circuit board above this.

Step 7: Solder the LEDs

After preparing the perfect sized PCB board, it is high time to make RGB LED circuit. Solder eight RGB leds as shown in pictures. An rgb led has 4 lags, longest one is the common (common anode or common cathode) and another three is for red, green and blue color. Solder a 28 pin IC base to the PCB for Arduino microcontroller. Using IC base is good instead of directly soldering microcontroller or any IC to PCB.

Step 8: Solder the Transistors

Connect a 100 ohm resistor to red, green and blue pin of each led. Now, connect all same color pin together as shown in schematic using jumper wire. Solder three transistors to the PCB board. Connect three separate color pins to the emitter of each transistor. Base of every transistor is connected to the microcontroller I/O pin through a current limiting resistor. For error free connection follow the schematic. Optocoupler connection is also shown in the schematic.

Step 9: Open the Charger

Of-course you should use a good quality charger which has regulated 5 V, 1 A output otherwise it may not work even damaged your microcontroller and Bluetooth module. So, use it at your own risk. A android phone charger is actually a low power switch mode power supply which needs small size transformer and filter capacitor. As it requires very small size transformer, the size of the charger is small enough to place it into lamp base.

To make it prepare for our work open the plastic casing of the charger. Bring it out from the case and cut the wire connection.

Step 10: Hack the Charger

Remove the USB connector from the circuit board. Connect two wires to positive and negative output pin of the charger shown in the picture. Connect two ground together using jumper wire shown in picture.

Step 11: Upload Program to Microcontroller

It is the perfect time to upload the arduino sketch to the microcontroller. Because in the next step we will add the microcontroller to the circuit board. Upload following sketch to Arduino UNO board and then remove ATmega328 microcontroller from the UNO board and place it to the RGB circuit board.

After uploading the program you can test it either working or not.

Step 12: Connect Two Circuits Together

Bend all the RGB LEDs soldered previously as shown in picture. Connect anode pin of the optocoupler to the Arduino pin 6 through a 100 ohm resistor and cathode pin to the ground pin of microcontroller. I used extra wire to do so.

Step 13: Fix Two Circuit Board

Put white LED circuit board on RGB circuit board as shown in pic and bend RGB LEDs again according to the pictures. Do it in a way that two circuit board fixed tightly with one another. You may use hot glue to make the bond tighter.

Step 14: Connect Bluetooth Module

Connect four female headed jumper wire to the RGB circuit board according to schematic attached before to connect the Bluetooth module to the Arduino microcontroller. Don't be confused, TX pin of Bluetooth module should be connected to RX pin of Arduino microcontroller and RX pin of the Bluetooth Module must be connected to the TX pin of Arduino microcontroller. Ground pin should be connected together.

Step 15: Enclose the Circuits

Connect the charger adapter to the RGB circuit board at bottom side as like Bluetooth module. Put adapter circuit and Bluetooth module to the base of the lamp first and then put two circuit board on top. Fix all the thinks to the base as shown in pictures. Finally, attach diffuser cap to the base. Congratulation! our Smart Lamp is ready to operate.

Step 16: Make Android App (NO PROGRAMMING)

Making you own Android app is interesting. Don't be upset, we will not use any programming language. We will use very simple MIT App Inventor to make our android app. I attached complete source and .apk file in below. If you want to modify the app just import the .aia file to App Inventor Environment and change as your requirement. I hard coded the MAC address of my Bluetooth module to the app. You must replace it with your own MAC to connect your lamp with the app.

If you are new in App Inventor please take a look here.

OK, we have completed our project. It is the time to enjoy it.

<p>Dear Tayfur</p><p>I'm mehmet. From istanbul / TURKEY</p><p>very thanks for labor.I offer respect.</p><p>I am a curious old man.</p><p>I am novice.</p><p>Horizontal Arrangement application part. This section has no video. I could not.</p><p>I tried to snap. It did not.</p><p>Help please . If it is possible.</p><p>Respects.</p>
<p>help, how can i make this using common anode??</p>
<p>How much did you pay for parts? </p>
<p>I calculated along with all the tools around 45$. This is including the tools at the end, without which it would be a mere 25$.</p>
<p>Wow, This is an excellent project. You have inspired me to try to create this project using a wifi module instead of Bluetooth. Your documentation and instructions were well done. Thank you for doing this!</p>
<p>Nice workout. One little thing is that your schematic shows common cathode rgb leds while your link to eBay for the leds indicate common anode leds and the technical description is not in line with the heading and the package content which is confusing. Before buying these leds asure that they are common cathode leds, because common anode leds will result in NOT working of the lamp!</p>
<p>Thank you so much! In this one project you've taught me so many things. Even if I never build this, I now know (1) how their inner circuits are (2) How easy arduino programming can be, (3) how easily a blue tooth module can be added to a design, and (4) a great shortcut to creating a basic android app. </p>
bhai gazab ka project hai...hats off
Simple yet awesome.??<br><br> I have a question I always wanted to ask you( if you don't mind answering ).... Are you from India??
sorry, the emojis got transformed into question marks :( <br><br>I'll write the sentence again..<br><br>Simple yet Awesome!!!!
<p>lol nice one,i tought youre gonna use arduino or something</p>
<p>NICE!</p>
Great project.
You can buy the AVR chip with the bootloader preprogrammed by itself and use the Arduino board to program it. Or the AVR plus a USB to TTL serial board.
Any chance of getting this to talk to Amazon Echo/Alexa
<p>Can be, then you should use esp8266 or other wifi module.</p>
No need for the AVR from an Arduino, then. You can program the ESP8266 directly.
<p>Hi. Firstly, thank you for sharing this project.<br>I want to ask you something. Can we use arduino nano or micro instead of removing atmega from Uno?</p>
<p>Yes, you can if you have enough place to put it in.</p>
<p>Awesome....dude</p><p>I will start working on it ...and if i found some problem ....please help me to attach it...</p><p>thankx budy</p>
<p>Great job on this. Thanks for sharing your knowledge here.</p>
Gteat job Taifur bhai.<br>I am soo proud of you as a Bangladeshi.
Bhai apnake onak dhonnobad.
Any other optocoupler that i can used in place of tlp627......
This is an awesome project though unfortunately the cheapest LED light bulb I've seen is at least $6 ...not $2.
<p>In my country Bangladesh it is available at $1.5</p>
<p>awesome!</p>
<p>Thanks</p>
<p>can i use optocoupler 621 in this project............</p>
<p>No, collector-emitter voltage of 621 is only 55 V but you need minimum 100 V for this project.</p>
<p>You could also use an ATtiny in place of the Arduino. It would reduce the circuit size quite a bit but the code would be a little more involved as the ATtiny does not have TX/RX pins so you would have to use some of the ATtiny Serial offerings.</p>
<p>Yes, you are right and TX/RX pin is necessary here for Bluetooth communication.</p>
<p>Nice job. The only thing about this project that would detract me from building it is that the novelty of the different color lights would soon wear on me loose my interest. But, I assume there would be situations where it could help set the mood of the moment. If you know what I mean.</p>
<p>Im sorry if this is a bit derailing but is there an instructable to show how you designed this circuit without the arduino (whole board) as part of the project. </p><p>ive been trying to figure this out for some time, about how to do this in a way that I don't have to rebuy an arduino with every project. but to simply wire a chip in as you have done and program it.</p>
<p>Nice job! Seems like a lot of work and the cost is a little high, for those who do not want to take the time to build this themselves can buy one from here for under $10. </p><p><a href="http://www.gearbest.com/smart-light-bulb/pp_230349.html?wid=21" rel="nofollow">http://www.gearbest.com/smart-light-bulb/pp_230349...</a></p>
<p>In my residence the voltage is 220 v dc, can I use this TLP627?</p>
<p>Yes, you can use TLP627 for 220V as the typical collector-emitter voltage for TLP627 is 300 V DC but one thing should be clear that, the lamp is only for AC voltage.</p>
<p>Thanks for answering. The instructions you posted are great.</p>
<p>You can use TLP627 upto 300 V but the lamp is designed only for AC voltage. It will not work from DC input.</p>
<p>sir,</p><p>is arduino is necessary or only using microcontroller we implement the circuit</p>
<p>Only microcontroller is necessary for the project and I only used Arduino for uploading the sketch to microcontroller.</p>
Even if parts are difficult to find worldwide I find this project extremely valuable for its own level of explanation and teaching.<br>This is the main target of instructables. Get everyone the possibility of learning, not only enjoy building something.<br>Great work!<br>
<p>Great project: voted both ;)</p>
<p>Thanks</p>
<p>the way I understand this, the brightness of the lamp will be much more when glowing in pure white compared to any other colour? Also, How do you control the brightness of the other colours?</p>
<p>Brightness of other color is not adjustable. Color can be changed by PWM.</p>
<p>I believe you are right since you have many more power white leds than color ones. the way you adjust brightness of colors is one the sliders on your phone i believe. see app shown in instructable.</p>
<p>Awesome! The idea, the execution, and the instruction - all fantastic!</p>
<p>Thank you very much.</p>
<p>It will be harder to find LED bulbs in the US that have this kind of direct-rectified power supply (it will also have half as many white LEDs inside, to match the lower voltage. Almost all LED bulbs sold here now use a better power supply in their base, which is also usually dimmable without flicker. So finding a bulb with this size and space inside may be difficult in some countries, or it may not be so compatible to control with your design. But it is a nice design for the bulb you have.</p><p>It also looks like you can turn on both the white *and* the RGB LEDs at the same time using this app setup. However, I would caution against doing this for more than a minute or two, since the heat from the white LEDs and the 5V power converter will make the temperature inside the bulb hot enough to compromise the life of the RGB LEDs. This style of RGB LED is already pushed past its limits of heat tolerance at room temperature with all three LEDs inside at 100% power-the epoxy and long pins are poor heat conductors. It is not dangerous, but it is not good for reliable long life of one's handmade Smart Bulb. Best to keep using this bulb in open air, to help keep its temperature down and be kind to the electronics inside!</p>

About This Instructable

206,019views

1,044favorites

License:

Bio: I like to learn, like to make, like to share.
More by taifur:$5 IoT Pill Bottle Portable ECG Machine  Physical Pattern Lock 
Add instructable to: