Recently I have come across some smart LED light bulbs that came in different sizes, shapes, functionalities and manufacturers. One thing they share is that they all do their “smarts” over a WiFi connection for which you need to use a smartphone and one of the many apps that help you set up the bulb. Unfortunately, this poses the same serious privacy issue (as I have already shown in a previous article) as for the apps (and the light bulb) to work properly you not only have to be connected to the internet at all times, but you also have to provide sensitive personal data (like your home WiFi network’s name, password, your location, etc.) to a 3rd party you know nothing about.
This particular bulb is marketed as “LED Light Bulb” requiring the “Magic Home-Smart home” app for your smart phone.
Many of the current bulbs on the market are based on the same chip, the ESP8266. These bulbs are very easy to “hack” and replace the firmware in them with the likes of my ActoSenso or the more widely known and used Tasmota. However, not all bulbs use the same chip. One of my bulbs turned out to have a Broadlink BL3336T-P WiFi module in it. This chip is not open source and not well documented (like the ESP8266 family), so anyone trying to write new firmware for it must first figure out what exactly the chip does and how exactly it does it. This is not an impossible task – some have managed to make great progress on figuring out the inner workings of it, but it is a slow, hit and miss process.
In this article I will show a different approach: I replaced the WiFi chip along with its PCB and other parts that drive the LEDs and designed a new, drop-in replacement based on the ESP8266 chip.
After removing the white diffuser (the plastic “bulb” part) we can see the following building blocks of the smart bulb:
- LED panel: this contains all the LEDs and their current limiting resistors.
- Driver panel: this has the Broadlink WiFi controller and some other bits and pieces to drive the LEDs.
- Power supply (we can’t actually see this, but we know it is there, behind the LED panel 🙂 ): this provides the necessary power to operate the bulb.
I was lucky with this bulb on two accounts: First, the driver panel is a completely separate plugin to the rest of the bulb. This makes it easy to replace it with something else. Second, all the connections between the driver panel and the rest are labelled, so I didn’t have to figure out everything from scratch (doable, but it is easier/faster if I don’t have to). I still verified all the power and data lines, just in case.
The circuit is very simple: the Broadlink chip drives the LED lines through a transistor each channel. This should be easy enough to reproduce with an ESP8266 based design!
I had an ESP-12F module at hand, which I had used successfully on several projects in the past, so I quickly whipped up the following circuit:
Building one of the channels separately on a breadboard helped to confirm that the design should work fully:
Once I confirmed that the design is good to go, I designed a PCB for it. The obvious constraint was the size: if I make it too big, then the PCB will block the light from the LEDs. If I make it too small, I won’t be able to solder it. I borrowed the original design: the WiFi chip on the top, and everything else on the other side. All parts are surface mount to fit the size.
I ended up with a PCB design that is similar size of the original. I even had room for test points for reset and serial programming!
The new board is smaller (shorter) than the actual ESP-12F module. I chose white silk screen this time to help keep as much light from the LEDs as possible. (These bulbs are not very bright to start with…)
After assembly, but before soldering it to the original header, for the first time programming I soldered a few short wires to the Vcc, Gnd, Rx, Tx, GPIO15 pins, and programmed the device with my own ActoSenso variant tailored for this particular purpose and powered it up for the first time.
Using a mobile phone, I connected to its access point, then set it up to connect to my home WiFi network. Once I verified that the WiFi part worked OK, I removed all the tiny wires and mounted the board to the header, its final location.
After powering it up, I entered the configuration pages, set up the way I wanted it to work and was happy to see that everything worked as expected.
Now I have a smart bulb that does exactly what I want, doesn’t need internet and I don’t have to trust any third parties with my personal information to switch on the light at home.
To change settings or use any features, I can visit its built-in web pages (like a router’s admin pages), or I can hook it up with any home automation system, like Home Assistant, OpenHAB or my own ActoSenso.
Sample configuration pages from ActoSenso: