Home > Espressif, FreeRTOS, Hardware > $12 AI Light ESP8266 based WiFi RGB Light Bulb Supports MQTT via ESPurna Open Source Firmware

$12 AI Light ESP8266 based WiFi RGB Light Bulb Supports MQTT via ESPurna Open Source Firmware

AI-Thinker is famous in the maker world for their ESP8266 modules, but they’ve also recently launched a WiFi RGB light bulb that sells for about $12.5 and up on Ebay and Aliexpress (here and there). Some people noticed, and bought samples online, including Xose Pérez (aka Tinkerman), ESPurna open source firmware developer, who could confirm ESP8266 was used in the light bulb, did some investigations, and eventually added the light bulb into ESPurna, which means it can be managed using MQTT or a web interface.

AI Light looks very similar to Philips Hue, but comes with WiFi instead of Zigbee. AI Light “M1636” key features:

  • RGBW LED E27 bulb with 16.7M colors
  • Connectivity – 802.11 b/g/n WiFi
  • Encryption – AES
  • Voltage Range – 110-240V
  • LED Power – 5 watts
  • WiFi Power Consumption – ≤0.3W
  • Temperature Range – -5~45degree
  • Humidity – ≤80%
  • Certifications – FCC, CE, ROHS

If you’re going to use the stock firmware, you can control the LED with Tuyasmart Android app. You’ll find the user’s manual and more photos on the FCC page for the light bulb. But there are already plenty of Wifi light bulbs on the market,  and what makes this light bulb interesting is that it’s based on ESP8266, and you can have full control over it using open source firmware.

The bulb cap is allegedly very easy to pop out, as it’s not glued to the board.A close up on the board itself reveals it’s indeed powered by Espressif ESP8266EX WiSoC connected to a 1MB Winbond 25Q80BVSIG flash, and MY-Semi MY9291QD LED driver.

Click to Enlarge

If you look from the bottom left to middle left of the inner circle, you’ll see 3V3, GND, RX, TX and IOO pads, which we can use after soldering some wires, and connect a USB to TTL board in order to flash the firmware. Note that IOO must be connected the GND to enter flash mode, you can remove the wire after flashing, in order to check the serial output during a normal boot.

After further investigation, Xose found out that there’s already some software implementation for MY9291 driver in Noduino OpenLight project, made by the developers who designed Noduino ESP8266/ ESP32 boards, and are likely the developers of AI Light. All needed source code can be found in Noduino-SDK released under a GPLv3 license, and includes a driver written in C language for MY9291 LED driver chip. Xose wrote a wrapper to make the driver work with Arduino ESP8266, and released the code on Github.

The code sample below shows how to set the LEDs to RED color at 100% duty cycle:

Ai-Thinker Ai Light / Noduino OpenLight have now been added to ESPurna 1.6.8 firmware, and you can turn the light on and off, select the color from the web interface, and/or control it via MQTT.

ESPurna installed on AI Thinker Light Bulb – Click to Enlarge

  1. Someone from the other side
    March 3rd, 2017 at 18:35 | #1

    Might give these a try, have a dozen of the lifx ones but they are huge

  2. March 3rd, 2017 at 19:09 | #2

    Interesting antenna concept for aluminium PCBs… I wonder how well it works.

  3. tkaiser
    March 3rd, 2017 at 19:24 | #3

    Let’s hope they/someone will ship these bulbs with ESPurna by default so no need to reflash a firmware prior to use.

  4. March 3rd, 2017 at 19:34 | #4

    I got mine from a different seller


    The flash on this one is 25Q32ASSIC a 32M-bit (4mb) chip. I dare say you will find various variations of spec when you look around.

    Speaking to the vendor, the Tuya app has an associated echo skill. I am waiting patiently for it to become available to Amazon UK customers so that I can try/review it. After that its flash time so that I can control it from OpenHab2

    JM No problem with the Antenna in my home, (Though I don’t live in a mansion) which is a traditionally built (brick) 3 bed house.

  5. Theguyuk
    March 3rd, 2017 at 20:27 | #5

    Since today has so many posts on hidden back door found in China IOT devices, seems a article on good IOT security, might get interest?


  6. Jon Smirl
    March 3rd, 2017 at 20:46 | #6

    Can anyone identify the power supply chip?

  7. March 3rd, 2017 at 20:56 | #7

    @Jon Smirl
    Xose mentions MP1470 and MP2359 step-down converters.

  8. noone
    March 3rd, 2017 at 23:22 | #8


    Speaking of power, any idea about the topology and driver ic’s for ac conversion?

    If anyone knows any good, ultra compact, low power (say 2w) ac/dc conversion modules I’d love to know. Hopefully something cheap and not a safety nightmare.

  9. March 3rd, 2017 at 23:30 | #9

    Excellent news! I will try to find them on the market. Maybe I can transform one in a MQTT PIR sensor (fake bulb), hard to spot in a house.

  10. Jon Smirl
    March 4th, 2017 at 01:15 | #10

    Xose mentions MP1470 and MP2359 step-down converters.

    Those are not the right type of chips to build this. It has to be some type of hot ground AC supply, then the MY9291 does the current control thing for the LEDs. It is that 6-pin chip at top of photo, I just don’t know what chip that is.

    The 3V3, GND, RX, TX and IOO pads are required to initially flash it. You power the PCB from an external isolated 3.3 supply during programming. Don’t use those pads while AC is flowing, you’ll likely destroy anything attached to them since this is a hot ground scheme.

  11. Jon Smirl
    March 4th, 2017 at 01:21 | #11

    Is there a flyback power supply under the PCB inside the base?

    Then that six pin chip at top is probably some kind of regulator needed to make different voltages.

  12. Theguyuk
    March 4th, 2017 at 06:03 | #12

    So what is a IAD JG

  13. Deets
  14. Deets
    March 4th, 2017 at 09:42 | #14

    @Jon Smirl
    6 pin chip is MP1470 for 3.3v. Probably 12v led supply from ac/DC module.

  15. March 4th, 2017 at 13:59 | #15

    @Jon Smirl
    I have not removed the PCB but there is a 12V power supply inside the base as you can see in the FCC pictures. The 6 pin chip on the pic is an MP1470 (http://www.monolithicpower.com/desktopmodules/documentmanage/api/document/getdocument?id=418) step down to 3V3 to power the controller, flash memory and LED driver.

    And you are right: never use the programming pads with the bulb connected to mains!

  16. GanjaBear
    March 4th, 2017 at 19:41 | #16

    Butlerian jihad can’t come soon enough if you ask me.

  17. Theguyuk
    March 4th, 2017 at 21:12 | #17

    There are several sonoff light bulb and socket adaptors on Aliexpress also a sonoff TH temperature sensor.

  18. Stefan M
    March 6th, 2017 at 19:01 | #18

    Well, these aren’t exactly “thinking machines”…

    But still, we aren’t that far from it being relevant

  19. March 7th, 2017 at 04:29 | #19

    By “sonoff light bulb” I guess you mean the Slampher, right? It’s not exactly a light bulb but an adaptor for an E27 socket. It basically converts a normal light bulb into a slightly-smarter light bulb. I reviewed it some months ago: http://tinkerman.cat/new-firmware-for-the-slampher/

  20. March 10th, 2017 at 18:47 | #20

    Got this today, very quick delivery from Aliexpress and nicely packaged in a sturdy box.

    The bulb looks far better than I expect, it’s just like the Philips Hues I have. Board is very good quality no shoddy manufacturing.

    Will give the programming pins a go. Thanks for the tip!

  1. No trackbacks yet.