Remote control fireplace

2020-11-25

Last year Sarah and I bought a Regal Flame Spectrum Modern Linear Electric 3 Sided Wall Mounted Built-in Recessed Fireplace (50") and installed it under our TV. One problem is that it comes with an annoying little remote that we keep losing track of, so I decided to hook up a Raspberry Pi to allow us to control it with our phones.

Product photo from online

Product photo from online

Installed under TV

Installed under TV

First I set up a Raspberry Pi Zero W with Void Linux, and connected a 38kHz Vishay TSOP38238 receiver to one of its GPIO pins. These IR receivers are well supported on Raspberry Pi, and all I needed to do was add these line to /boot/config.txt:

dtoverlay=gpio-ir,gpio_pin=17
dtoverlay=gpio-ir-tx,gpio_pin=4

I needed to know what type of codes were being sent by the remote (Sony, Philips, NEC). I looked at the waveform with an oscilloscope and figured out that it was sending NEC codes. Then I used the program ir-ctl from v4l-utils to figure out which codes were sent for which buttons.

Then I breadboarded a small circuit to drive an LED with a transistor, and I went to my parts bin and found a bunch of IR LEDs tried each of them until I found an LED that transmitted at the correct IR wavelength to be picked up by the fireplace. I soldered the LED and the transistor to a piece of protoboard and mounted it tucked under the mantel aiming at the IR receiver.

The heater temperature needs to be set every time the unit is turned on. I wrote a shell script that simulates the sequence of button presses that turns on the heater to full strength and sets the temperature cutoff to 82°F.

#!/bin/sh

TIMER=0x8006
BG_BRIGHTNESS=0x800a
ON=0x8012
LOG_BRIGHTNESS=0x8019
STRENGTH=0x801e
TEMP=0x801f

press () {
    ir-ctl -S nec:$1
}

press $ON

press $STRENGTH
press $STRENGTH
press $STRENGTH

press $TEMP
press $TEMP
press $TEMP
press $TEMP
press $TEMP
press $TEMP
press $TEMP