Fork me on GitHub

Project Notes

#625 Remote Control Candles

Examining some intrared-controlled LED candles, reverse-engineering the control protocol, and making them dance to the tune of an Arduino.

Build

Here’s a quick demo..

clip

Notes

Flickering LED candles are popping up all over the place.

I found a relatively cheap pack of 6 candles with infrared control on aliexpress to play with.

After taking one apart to find how they tick, I was able to very easily capture the IR protocol and so make a simple demonstration of how to control these candles with an Arduino.

The Candles

The kit comes with multiple candles and an infrared control. They are all powered by CR2032 batteries (included!). So far it seems that the battery life isn’t great if you leave the candle on.

kit_candles

The smarts of the candle are all in an 8-pin package - presumably a standard MCU of some description, although in the volumes that these candles seem to be produced in, perhaps an ASIC could have been justified?

It is quite simple:

  • an infrared receiver
  • LED for candle effect
  • a coil to repel the magnet in the “flame”

kit_functional

Reverse Engineering the IR Protocol

I used the ReceiveDump example from the Arduino-IRremote library, with a CHO 1838 intra-red receiver to capture the payload sent for each buttin on the remote control.

The raw captures are in protocol_decode.txt.

This confirmed that the NEC protocol was being used with a series of 10 commands. An empty (0x0) address is used, which makes sense as this is intended to “broadcast to all tea candles”!

The commands are as follows:

Function Address Command Raw Data 32 bits LSB first
ON 0x0 0x0 0xFF00FF00
OFF 0x0 0x2 0xFD02FF00
Mode: Candle 0x0 0xC 0xF30CFF00
Mode: Light 0x0 0xE 0xF10EFF00
Dim (-) 0x0 0x10 0xEF10FF00
Dim (+) 0x0 0x12 0xED12FF00
Timer (2h) 0x0 0x4 0xFB04FF00
Timer (4h) 0x0 0x6 0xF906FF00
Timer (6h) 0x0 0x8 0xF708FF00
Timer (8h) 0x0 0xA 0xF50AFF00

Controlling with an Arduino

The protocol is very trivial - just 10 commands transmitted with the NEC protocol. The Arduino-IRremote library can be used to send these commands from any MCO the library supports. In this case I’ve just grabbed the nearest to hand - an Arduino Uno.

Demo Scketch

The RemoteControlCandles.ino sketch is just a very simple sequence that demonstrates some of the basic commands - on, off, mode, dim.

It uses the Arduino-IRremote library to send comands in the correct NEC protocol format.

Construction

We just need an infrared transmitter connected to a GPIO pin of the Arduino:

bb

schematic

Credits and References

About LEAP#625 IRArduinoLED

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader