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.
| # | Button | Command | Raw (NEC 32-bit) | Function |
|---|---|---|---|---|
| 1 | Power | 0x1A | 0xE51ACDAB | On/off toggle (while off, the other buttons are ignored) |
| 2 | Timer | 0x2A | 0xD52ACDAB | Timer |
| 3 | SET | 0x2B | 0xD42BCDAB | Target temperature, then −/+ and OK |
| 4 | Level | 0x2C | 0xD32CCDAB | Heater level: fan → 1 kW → 2 kW → fan |
| 5 | − | 0x2D | 0xD22DCDAB | Decrease |
| 6 | OK | 0x2E | 0xD12ECDAB | Confirm |
| 7 | + | 0x2F | 0xD02FCDAB | Increase |
| 8 | Window | 0x3A | 0xC53ACDAB | Open-window detection on/off |
| 9 | DAY | 0x3B | 0xC43BCDAB | Day (week schedule) |
| 10 | Schedule | 0x3C | 0xC33CCDAB | Schedule mode on/off |
| 11 | Schedule 1 | 0x4A | 0xB54ACDAB | Schedule setting |
| 12 | Schedule 2 | 0x4B | 0xB44BCDAB | Schedule setting |
| 13 | Schedule 3 | 0x4C | 0xB34CCDAB | Schedule 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.
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.
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.
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.