Femboy.nu

Note AI was not used to write the content of this article, not even rephrasing! Only to check the spelling.

Automating an IR heater

Electric, resistive, heating is dumb. But it’s cheap and easy to install. So we got a set of these wall mountable heaters. That way we can heat the space while we work out the plan for an airconditioner/heatpump. These small heaters have a cheap remote, and you can even program a weekly schedule into them. However you cannot control them remotely in any meaningful way (via MQTT or something similar). So once you have programmed the schedule, that is it. That is obviously not acceptable in a hackerspace.

Automating devices with an IR remote is often quite easy, if they use standard protocols (such as NEC) for their IR blasters. I built a small decoding setup using an arduino and a HX1838 IR receiver. And of course, it being the big ‘26, I just tell the slop-machine how it’s connected and the remote was decoded within a handful of minutes.

#ButtonCommandRaw (NEC 32-bit)Function
1Power0x1A0xE51ACDABOn/off toggle (while off, the other buttons are ignored)
2Timer0x2A0xD52ACDABTimer
3SET0x2B0xD42BCDABTarget temperature, then −/+ and OK
4Level0x2C0xD32CCDABHeater level: fan → 1 kW → 2 kW → fan
5−0x2D0xD22DCDABDecrease
6OK0x2E0xD12ECDABConfirm
7+0x2F0xD02FCDABIncrease
8Window0x3A0xC53ACDABOpen-window detection on/off
9DAY0x3B0xC43BCDABDay (week schedule)
10Schedule0x3C0xC33CCDABSchedule mode on/off
11Schedule 10x4A0xB54ACDABSchedule setting
12Schedule 20x4B0xB44BCDABSchedule setting
13Schedule 30x4C0xB34CCDABSchedule setting

The remote has many buttons I do not need. The only buttons I need to send are Power, and Level. All other buttons are used to use the automatic features built into the heater, which I am going to replace with a separate module. However the IR control gives no feedback at all. This means that the in-memory state of my controller and the real-life state of the heater will desync if a single command is missed. And it being IR, many commands will be missed. That means that it is essential that there is a way to bring the heater to a known state. And it just so happens to be impossible using the remote alone. Luckily zigbee powerplugs exist, that sit between the wall and the device, and cutting the power resets the heater. Ideally you also have a way to confirm the heater is on, and in the state that is desired. But they use 2kw, so it’s fairly easy to detect their mode if you monitor the power usage. Ideally the zigbee plug can also do this, but in our case each heater is attached to a different phase, and that shows it pretty clearly.

As you can see, there is some noise; but the heaters are pretty easy to spot. Measuring the power before setting the heater, and after can tell you if it was enabled. Occasionally a different device (such as a water boiler) will mask this, but in that case you can simply retry it a few times. Poor man’s closed-loop control works fine.

The electricity usage per phase

So with all this known, you just grab a handful of components from your storage, ask the slop-machine to generate some schematic and code for you and test it out. And turns out, in the big ‘26 that just works. It generated a schematic and PCB in KiCad, Platformio code, a case in OpenSCAD, and generated milling G-Code for the PCB. Of course I told it to tweak many things it generated, gave it IRL measurements and many things like that. But I didn’t spent much time at all implementing anything.

The generated PCB A single PCB The closed case The assembly The real circuit board on mill The real circuit board on mill

To make the circuit board, I used the same techniques as in a previous article. But this time I did not spend an ungodly amount of hours in the half-finished unrunnable FlatCAM, I just asked the slop-machine to generate the G-Code, and it did it.

The controller should be able to control multiple heaters, and the IR control is kind of picky; even with the real remote you need to aim it at the heater. That is why the controller has little turrets. The IR led is in there, it’s aimable and has a little dish to aim the IR signal.

The finished controller

And in the end it works. The 3D print fit, including aimable turrets, on the first attempt. It’s somewhat fiddly to get the aim right (that cost me like an hour to get right). But once it’s right it works.

The fun in this project was the casual nature that it occupied for me. Normally I spend many hours focused on the project, in a kind of flow state. But that did not happen at all for this one, as I was enjoying myself while ‘working’ on this. I spend time chatting with friends, listening to music and just generally having a good time, all while ‘making’ this.

The full source code for everything is here. But I never read any of it, lmao.

Thank you for reading this article.
If you spot any mistakes or if you would like to contact me, visit the contact page for more details.