We bought 20 of these RGB LED Light bulbs for a party at work, but I was a little disappointed with the color fading functions they provided. So I decided to take one apart, reverse engineer the IR protocol, and see if it had more functions than those available from the IR remote.

Other instructables related to reverse engineering:
If you find this instructable interesting, you should have a look at this. It also goes more in depth on the tools used in this instructable. 


Step 1: The product and proect goals

This is a really cheap RGB LED bulb that fits into a regular E27 bulb socket. It has an IR remote that lets you choose between different modes and colors.

I want to use them in the color fade mode, but the color fade in these bulbs suck. For some reason they fade the LEDs to almost white color, which doesn't look that great.

I am hoping to find some hidden modes, or alternative ways of controlling this thing without too much work. 
<p>Nice intructible. I want to control my RGB strip whit my arduino as well but I do not have an electrical background. So I tried to make it but failed for unknown reasons. </p><p>Can you please tell me what kind of resistor you use for your IR LED? (I can not see it on your picture) I now use a 1K resistor (see image) and an IR LED from an old contoler.</p>
<p>I now tried 100ohm. still no progress</p>
<p>how to control through remote and where is code .pl upload as soon as possible </p>
<p>Great instructable. While I wait for my bulb to arrive in the mail... Do you have any photos of the power supply in the bulb? Any idea of how much current is provided to the LED, and if it is capable of providing more (not just to the LED, perhaps to another circuit attached to Vcc and GND)?</p>
<p>Inspired by this information, I wrote a Windows console application and Arduino code to control a Magic Lighting RGB LED bulb from a PC. I use it to display the status of a build server. Code and instructions (check the Wiki) can be found at: https://github.com/robertmoro/MagicLightingRemote</p>
<p>hello,this is Nena from China,we are a direct manufacturer of LED lights,now we develop a new kind of LED lights----Wifi and RF remote control RGBW bulbs,please contact us at email: lm18@langmacn.com mobile/Whatsapp/Viber:86-15889460874</p>
<p>hello,this is Nena from China,we are a direct manufacturer of LED lights,now we develop a new kind of LED lights----Wifi and RF remote control RGBW bulbs,please contact us at email: lm18@langmacn.com mobile/Whatsapp/Viber:86-15889460874</p>
<p>Thanks for this tutorial, it helped a lot although I ended up using a different code.</p><p>Hoping that this comment will be useful for someone, be aware that in the extended NEC protocol, the address is not always 0x00FF, for example, my lightbulb uses 0x00F7 (0x00F720DF for red).</p><p>It took me a while until i found it out :)</p>
<p>Hello, can u share your code please? :D</p><p>Thank you</p>
<p>Would this be possible to control from a USB connection from a Windows machine? If it could, you could do all sorts of awesome stuff :D (thinking of disco, ambilight, auto turning on lights in morning, auto dimming slowly at night). Congrats, great post!</p>
<p>Hi</p><p>Where is the arduino sketch? thanks</p>
<p>Great post. Good instructions for duplicating what I needed to do for my garden LED lights. Thanks a lot!</p>
<p>Excellent article and photo's. Thanks for sharing it.</p><p>With this article, some code I downloaded for Arduino and modified, and article from Vishay ( http://www.vishay.com/docs/80071/dataform.pdf ) I was able to figure out the codes used by my IR control.</p>
You are going to run into what is in my opinion a dead end (depending upon what you are after). The analog circuitry driving the LEDs is a fixed current only (it is a single transistor &quot;starved&quot; by a second transistor). Dimming is done by pulse width modulation of the current. This causes flicker. This is especially evident for yellow shades. With the cheap stock Chinese computer in the bulb, or an Arduino, you can't go fast enough. This is one of those products where you need to trash out all the circuitry, LED drivers included, and put in better designed circuitry (you can still use &quot;slow&quot; PWM, but you low-pass filter it with an RC circuit, and feed that to an ANALOG current source). I went down this path (I wanted to make subtle shades with the lamp, fixed but settable). The other thing I wanted was to eliminate the &quot;feature&quot; of way too many digital products made today: they &quot;forget&quot; everything when they are turned off! If you put this in a fixture controlled by a wall switch, you have to remote control it every time you turn it on. <br>You do have a nice documentation of the IR control protocol. You are lucky, that it wasn't more complicated (I'll bet you could randomly strobe IR LEDs at it and get random results, as there is really no error protection in the code). I hacked a toy dragon set, and the protocol was much more complicated. <br> <br>To KROKKENOSTER: the currents are fixed, and pulse width modulated. Your retina is the &quot;low pass filter&quot; that creates the illusion of dimmer light. <br> <br>
<p>With an Arduino you can run the hardware PWM output at up to 234375hz (16mhz/256), but PWM in devices like these are intentionally run slowly. LEDs output different shades of light at different voltages, so for accurate colour reproduction almost all well designed dimmable LED lights use PWM which is as slow as is acceptable for the application. The reason for the slowness is that the wires from the switches to the LEDs act as both inductors and capacitors, and at higher frequencies the waveform becomes more like a sine wave due to the unintentional low-pass filtering of the wires, causing the LED to output incorrect colours during the transition whenever the digital output changes high or low. Slower PWM means there is less time spent transitioning and more time spent at the most ideal voltage and current, so the colour reproduction is much more consistent. Without this you would need a lookup table to determine which colour your LED outputs at each constant current, and some code to transform an input colour in to an output that can represent that shade with analog LED driving.. which would be very complicated and impractical for a small microprocessor like the Arduino. Of course, if your colours don't have to remain accurate at different brightnesses, it doesn't matter.</p>
Would be awesome if someone know how to port the codes to use an android device to control this kind of lights
I like your scope - how much was it, and where did you get it?
Wow, you guys and gals and your brains could resolve the electronics age problem of controlling multiple devices with ONE remote. A GUI remote with the help of the Arduino. <br> <br>For example, I would like to have a pc program for laptop that would depict each of a persons remotes with a GUI. It would be a simple matter to select a devices remote from a menu pull up that device GUI. Then click on the button function desired. <br> <br>Where do I start? I've not done any GUI development. Or, has this already been accomplished??? <br> <br>I need to learn how to handle all of the &quot;input&quot; (knowledge) that &quot;Instructables&quot; brings to the table. It is almost limitless. For me, it is information overload. It is so depressing to discover just how stupid this retired mechanical engineer is.
We can read the TV remote control data! and use it for other devices! for instance using it as a remote control of the lights of the room! or maybe a device to control the curtain of the room! even the air conditioner of the house! all in once!
Good! I am doing something like this! My PCB is being printed! I will control a relay which switch my room's lamp, using a remote control! <br> <br>For all the protocols, there is a good website! <br>http://www.hifi-remote.com/johnsfine/DecodeIR.html <br>Mostly these controllers are following the NEC Protocol! I have bought a remote control like yours!
How did you remove the glass bulb from the rest of the unit?
Its plastic, and its also threaded
This is a clever way to do it I just wonder if the different colours draw different currents to generate the same light? Love your oscilloscope in any case
Nice work. Could you please lift the quartz and take another picture of the PCB? <br>It seems like the chip under the quartz might be an Atmel Attiny85, a thing that would open plenty of possibilities
There is no part number on the chip. It's not scraped off or anything, it's just unmarked :/
Many people in north america have a tendency to add unnecessary comment on products made in China as &quot;cheap&quot;. The fact is, you will not find cheap low quality products in China, but only in north america, Europe and most other developed countries around the world. This is because the merchants around the world are not willing to pay for good quality products, they just want the lowest possible prices so they can make the most profit for themselves. I travel to China at least twice a year and if you do too, you will notice that everything they used there are build to last and last they do, much longer than products made in other countries. Chinese manufacturers simply made products to fit what foreign merchants are willing to pay for, so as the saying goes - you get what you paid for... Westerners have no one else but themselves to blame for cheap products. Example: The wings of Boeing 767 are made entirely in China. Would you call that cheap too?
These LED bulbs are really cheap, and have a low build quality. I have yet to see any RGB LED bulbs in stores here in Norway in the same price/quality range. But hey, I wanted cheap and in bulk, and that's exactly what I got. So I'm happy. You can probably find &quot;better&quot; ones on ebay, but we're going to use these things once a year for a company party, so I couldn't care less about the quality..
Maxhuey, I like your picture! I think you should get a different hobby though, instead of jumping on a band wagon and beating a drum about on little comment make in the articular about China &quot; witch is the king of inexpensive stuff&quot;! Only saying this because it will make you a biter person, life is to short, there are bigger and more important things you can do with your time and energy!
Very good article
interesting read!
Yes Thanks, a very readable post. I had some a-ha moments, thanks to this
What a coincidence! I recently did the same reverse engineering although I didn't have an oscilloscope. I used a 38KHz IR receiver to read the signals and then decode the remote buttons. My remote was for controlling for RGB LED strip. But unluckily the controller box got destroyed during installation so I'm right now working on making a controller circuit(which will be inside your bulb) with more functions. Instructable coming soon. ;P
This procedure is very clean, didactic, and I learned some good points. How is it possible, no comments? Reverse engineering is such an interesting field. <br> <br>Thanks a lot for this one!
Good read, Wish you could have enhanced the bulb! Have you tried this hacking approach to other IR devices, or even a TV remote? <br> <br>I have (kinda), and it unlocked debugging features, One button would cycle the TV from Red, Green, Blue, Normal. But for that 'hack' all i had to do was cut a hole in the plastic case to expose a button in the silicon keypad.
Very nice! Thanks for sharing. <br> <br>A friend of mine recently had a similar problem with the Philips Living Colours Light. The white is not really mixed well and has a bit of a yellow touch. <br>It uses some RF in the remote, but still, the approach should be pretty much the same.
Very Well done!!!
Nice tutorial. I learned a lot!
I hope that during your research, you came accross this Arduino IR library: <br>http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html <br>It saved me a lot of work when I reverse-engineered the IR protocol my airconditioner uses.
I've stripped a couple of these IR receivers to add DMX decoders. I was thinking about doing a reverse engineer on these as well to see if they would take a DMX signal in place of IR, but from what I gather, you just saved me tons of time!<br/><br/>Great Instructable. Keep 'em coming.
Nice piece of work. Easy to follow and well written <br>Thank you for sharing. I just bought a couple of LED strings with controllers similar to yours and am interested in understanding the design. Your Instructable will go a long way in helping.

About This Instructable


190 favorites


Bio: I like microcontrollers and LEDs :D
More by chr: Reverse Engineering: RGB LED Bulb with IR remote Reverse engineering: USB controlled home automation hack LED Cube 8x8x8
Add instructable to: