How to resurrect a broken smart bulb with an ESP32 and custom code

How to resurrect a broken smart bulb with an ESP32 and custom code

Published Nov 28, 2026, 8:30 AM EST Patrick Campanale has been in the tech space for well over a decade, specializing in PC/gaming news and reviews, as well as maker-focused products to build small businesses. With a start in technology back in 2010 surrounding the Palm/webOS ecosystem, Patrick spent his formative years developing mobile applications as well as blogging for various publications, eventually leading to starting his own website in 2014. After running a technology blog for a few years, he stepped out of that role and into the world of high-end custom PC manufacturing and building, with a focus on YouTube video production and overclocking. Then, in 2017, Patrick joined the 9to5Toys team as an editor/writer/reviewer with over 14,000 articles being published during his time there, ranging from deals and roundups to in-depth reviews on the latest technology, video games, 3D printers, and more. In his free time, Patrick loves to create projects from wood using various robots and methods, including leveraging the technologies of CNCs and lasers. If Patrick isn't working on a computer or playing video games, he's likely in his 2-car garage workshop creating something unique. In addition to all this, Patrick is also the media director at his local church where he feels God has called him to serve, and he loves every minute of it. Do you have a dead smart bulb that you’re wanting to bring back to life? Well, it’s actually easier than you think. All it takes is a little DIY know-how, maybe a $6 board, some soldering, and a bit of custom code. Smart bulbs often die because they were either orphaned by the manufacturer who shut down the app for the bulb, or because the Wi-Fi in the bulb itself died. Both of these problems are actually quite easy to remedy if you know what you’re doing. So, today, I’ll show you how to diagnose a dead bulb and how to either flash it with new firmware or replace the board entirely depending on what’s needed to fix it. Start by simply opening the bulb to find out which chip it has in it The chip decides whether you reflash or replace The first step in diagnosing a bad smart light is to figure out what chip is running it. I had a smart bulb that I thought was an ESP32, but it turned out to be an ESP8266EX. Both chips are from Espressif, and they function similarly, but repair procedures are quite different. So, open your bulb and see what the main chip is on the inside before going any further. From there, it’s time to do some basic diagnostics of the bulb. If the lights never come on when you screw it in and give power to it, or try to reset it (turning it on/off 5 to 10 times), then it could be a dead LED driver or power supply. These aren’t worth saving. Though, it's also possible that it's a dead board at this stage as the board drives the 3.3V rail and the PWM that controls the LED. However, if it’s the Wi-fi module that has gone bad, or if the company’s cloud app has shut down, then those are definitely worth saving. The dead Wi-Fi module will require swapping the mainboard (and only with an ESP32-powered bulb), but fixing the app can be done relatively easily if you have the right tools. Make sure the bulb is never installed in a light socket when working on it. Having the light socket off is not enough. You want the bulb physically removed from the light socket. Also, let the capacitors discharge before opening it to replace anything. Lastly, do not ever connect it to mains power (120V or 240V depending on where you live) when a USB adapter or board is connected. So, how do you actually get into the bulb? You’ll want to start by taking the diffuser dome off the bulb as that’s typically where the chip and board live. This is different for every bulb, but it’s normally either press-fit or glued on. My ESP8266EX bulb just had it press-fit, but I have other bulbs where it’s glued on and needs some heat and pry tools to remove. Once you’re in, take a look at the chip like I have pictured above. You can see that mine is the ESP8266EX on the Espressif chip, but there’s also ESP-WROOM-02, ESP-12, Beken BK7231, ESP32, and others that could be inside of the bulb. From there, identify the pads and specifically look for the following: TX, RX, GND, 3.3V, and GPIO0. These pads will be crucial if you’re going to reflash the chip instead of just replace it. Reflash the original chip if it still works Back up the stock firmware before you write anything Credit: Seeed Studio If you have an ESP8266EX like me, or if you’re just wanting to get around the bulb’s native app and use it with something like Home Assistant, then you can often just reflash it. This will need the TX, RX, GND, 3.3V, and GPIO0 pads that I talked about above. You’ll want to power the chip with a 3.3V USB to serial adapter only with the bulb unplugged from mains power. This process will likely require you to solder to the board so make sure you have a soldering iron handy and know how to use it. Then, short GPIO0 to GND at power-up to enter flash mode. This works on most chips, but, if it doesn’t on yours, then you might need to do a bit more research there. Shorting GPIO0 to GND is a pretty safe bet for getting into flash mode though. Once in flash mode, back up the stock firmware with esptool so you can restore it if you ever need to. After you’re in flash mode, you need to actually flash the chip with whatever firmware you want to use. I’d recommend ESPHome with Home Assistant, because it’s universal, self-hosted, and nobody can stop you from using it. If your chip has enough storage (my ESP8266EX is paired with 4MB of storage), you can even enable OTA updates on the bulb to update it from ESPHome. Otherwise, you’ll need to reconnect to the bulb physically to reflash firmware in the future. Some bulbs actually do support a no-solder route to reflash, but it’s not supported on newer Tuya bulbs. If you have older Tuya bulbs, then you can try tuya-convert to reflash the bulb with ESPHome without having to solder. Just don’t rely on this as a method for newer bulbs. Swap in an ESP32 when the old chip is dead The ESP32-C3 fits where most boards can't Credit: Seeed Studio If you have a dead board or just a board that doesn’t support ESPHome, then there’s a good chance you can swap the board for something else entirely. I’d recommend the ESP32-C3, which is just $6. It’s ultra small (it’s in the name) and has a USB-C port on it for flashing which makes it extremely convenient to use. The ESP32-C3 supports both Wi-Fi and BLE (Bluetooth Low Energy) meaning it can easily integrate with Home Assistant through ESPHome. All you have to do is desolder or cut out the old module to make room for the new module. Just make sure to know where the 3.3V and GND are on the bulb so you can re-solder those, as well as the PWM pads for each color that the bulb supports. This is definitely a more involved project and should only be done if you know your way around a soldering iron, as it’s pretty precise and getting the solder joints crossed or bridged could break either the board or the bulb itself. Set it up in ESPHome as a local bulb A few lines of YAML and Home Assistant finds it on its own Once you’ve decided on either flashing the board or swapping the board, you’ll need to set up ESPHome. It’s pretty straightforward. Most bulbs have a PWM output per channel that feeds the light and will need to match the bulb itself. You’ll also need to change the platform in ESPHome to whatever your board is, like esp8266_pwm for a reflashed ESP8266EX, or ledc for an ESP32 swap. You’ll flash over USB/serial with ESPHome’s Builder or at web.esphome.io, and then you should be able to OTA update from then on if your chip has enough storage for it. You might need to custom write the code (or work with something like Claude or Codex to write it) if you have more of an edge-case bulb, but that will have to be handled on a case-by-case basis. Once you have the bulb flashed with ESPHome, it can be integrated with Home Assistant and you’ll be able to control it as part of your smart home again, with or without the manufacturer’s application in the mix. What you end up with is a better bulb than the one you bought Once you either flash or replace the ESP board in your Wi-Fi bulb, it’ll actually be better than when you originally bought it. This comes from the fact that a flashed bulb can connect to Home Assistant, which is free from external dependencies and data collection. Many bulbs actually collect and report data through their stock apps, but Home Assistant does no such thing—and it even works offline. Seeed Studio XIAO ESP32C3 The Seeed Studio XIAO ESP32-C3 is the perfect budget-friendly microcontroller for smart home projects. With Wi-Fi and Bluetooth built-in, it also features a super deep sleep mode for low power usage when it isn't doing anything. The compact size makes this ideal for building smart home projects, and ESPHome allows it to easily integrate into Home Assistant. HiLetgo FT232RL Mini USB to TTL Serial Converter The HiLetgo FT232RL Mini USB to TTL Serial Converter is designed to convert a USB cable to Serial so that way you can program devices like ESP32 boards that don't have a built-in USB port.

Original Source

Read the full article at Howtogeek →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.