Upgrading battery powered candles with ESPHome


Posted

in

by

Introduction

I once went to a candlelight concert by Fever, where the Adelaide Concert Orchestra played through various Studio Ghibli soundtracks. Yes the musical performance was amazing, but I was also captivated by the hundreds of battery powered candles with moving flames that were lighting the stage in lovely warm tones. From where I sat, they looked almost indistinguishable to real candles; I had to get some immediately. So on eBay I went and ordered some.

I was delighted to find that their construction is simple. Three AAA batteries are connected via a switch to what I assume is an LED driver and some sort of coil to make the fake wick wobble around. Fortunately, I was still holding on to a bunch of transistors that I had rescued from the PCB of the DIY Gamepad and Headset Using an Old Landline Phone. With the addition of some ESP8266 boards, resistors, and a Dremel, I had everything I needed.

Design

The bottom of the candles is just friction fit in, and fairly straightforward to remove in order to access the wiring inside. Before the battery terminals were disconnected, I made a quick measurement to double check the transistor would be ok. The candle only draws 30 mA, well within the 1 A limit of the PN2222A.

The circuit shown in Fig. 1 is how each candle was connected, with the ESP board being powered via its micro USB port. Nothing too fancy.

Figure 1. Very complicated circuit diagram for powering the candle with a transistor I found in my parts bin.

Finished Product

Once the ‘Design’ was finalised, I cut some slots in the battery compartment to wedge the ESP board into and a cut-out for the USB cable to fit through. I direct your gaze to Fig. 2 to view this incredibly precise machining process. Protoboard was an unnecessary luxury (I couldn’t be bothered walking to the shed), so the components were just soldered directly to the pins.

Figure 2. Professional integration of ESP8266 board into the candle. (a) Photograph of the top of the board, which is perfectly sized to fit in the battery compartment. (b) Photograph of the crude cut-out for the USB cable. (c) Photograph of the assembly and wiring, with relevant annotations.

Notes

The YAML is nothing fancy. Aside from the usual boilerplate, the candle is just set up as a switch, shown below.

switch:
  - platform: gpio
    id: candle_power
    name: candle
    pin:
      number: GPIO13
    restore_mode: ALWAYS_OFF

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.