Romain ChampourlierLab

A universal remote on a Cardputer, built with Claude in a few hours of my weekend

Our living room ran on a Logitech Harmony 555, and the website it needs to be reprogrammed is gone. So I replaced it with a pocket computer, its infrared LED and about 2,300 lines of code I mostly didn't type. Both interfaces are in this page: try them.

Our Cardputer ADV seen from above, plugged in by USB: a white, card-sized computer with a small colour screen above a 56-key keyboard. The screen shows the remote's device list, sideways.
Our Cardputer ADV during an early test. The device list is sideways: the screen rotation was one of the things to learn.

What it does

The M5Stack Cardputer ADV is an ESP32-S3 with a tiny keyboard, a 240 × 135 screen, Wi-Fi and an infrared LED. Ours drives five devices that only understand infrared: a Philips TV, a Harman Kardon amplifier, an LG Blu-ray player, an Apple TV and a no-name HDMI switch.

Like the Harmony, it works with activities. “Film · DVD” switches the TV, the amp and the player on, picks the right input on the amp and on the HDMI switch, switches off what isn't needed, then sends the arrow keys to the player. There are seven of them, plus “all off”. We reach them three ways:

Infrared goes one way: the remote never knows whether the TV really switched on. So it remembers what it believes each device is doing, and has a “Fix” flow for when belief and reality drift apart: say what's wrong (“the TV is off”), it re-sends what's needed and asks if that worked.

Try the Cardputer

This is the on-device interface, running the same activity logic against a simulated living room. Click the screen and use your keyboard, or the keys under it. Start with Film, then press Space for the menu. The panels show what the remote thinks against what the devices really do; use “Other remote” to make them disagree, then press f to fix it.

The interface is in French and English mixed, as on the real one: activity names are ours, the rest follows the device's small ASCII fonts.

Try the phone remote

This is the exact page the Cardputer serves, talking to a simulated Cardputer instead of the real one. The page is in French, as at home.

Put it in a state

  • With everything off, the first tab offers the activities. Start one: the status icons light up as each code goes out, at the pace of the real devices (the amplifier needs three seconds before it listens).
  • Once an activity runs, the tab becomes the remote. Volume always goes to the amplifier; hold a volume key to repeat.
  • Appareils has every single command of every device. Dépannage is the Fix flow.

The whole page is one file, 10 KB once compressed, with no framework and no external request. It has to be: the web server is a microcontroller with about 120 KB of free memory that is also busy being a HomeKit accessory.

A few hours, spread over a weekend

I had talked the idea through with Claude over ten days, on and off: which hardware, how HomeKit models a TV, where infrared codes come from. The first firmware compiled on Saturday 21 November. By Sunday night the Cardputer was paired with Apple Home, every code was verified on the real devices, the Fix flow worked and the phone page was on my home screen. A last sitting on Monday evening went into its design.

I did not spend the weekend on it. It took a few hours of my time in all, in short sittings, with the rest of the weekend going on around them. Claude worked; I came back when there was something to look at.

Most of those hours went into testing, because infrared is the one place where Claude could not check its own work. It can compile, flash the Cardputer and question it over Wi-Fi, but it cannot see whether the TV came on: the signal goes one way and the board has no receiver. So at every stage, each code and each activity needed me in front of the devices, pressing a key and reporting what happened.

≈1,700lines of C++ firmware
600lines for the phone page
250lines of USB driver
5 → 7devices, activities

I'm a software engineer, but microcontrollers, USB protocols and infrared timings are not my daily work. Alone, in spare evenings, I would have counted this project in weeks. None of the walls below is hard for someone who already knows the terrain. The point is that there are six different terrains.

Where the weeks would have gone

What I enjoyed most

Two things, and neither is the code.

Getting something to work, quickly. The first firmware compiled on Saturday; on Sunday the living room answered. A side project usually dies in the gap between the idea and the first thing that works, because that gap is filled with setup, documentation and dead ends. Here it was short enough that I never lost interest, and from then on every sitting went into something I could see.

Iterating on the experience and polishing the interface. Once it worked, I could spend my time on what it is like to use: which screen comes first, how many taps to switch activity, what the remote should say when the TV didn't obey. And then on how it looks. I never had to imagine anything. Claude first built the two mocks you tried above: the real code, wired to a fake living room. Every idea was judged on a screen that behaves, not on a description.

For the phone page I asked for options. I got a board with five versions of the real page side by side, all driven by the same simulated Cardputer, each with its cost in bytes for the microcontroller. I picked a palette from one, the gradient from another, the edge-to-edge rows from a third, and the next minute I was looking at the mix. The rest was sentences like “double the space between the wheel and the row under it”, then a new icon the same way.

That loop is the real change. It isn't that the code gets typed faster. It's that the distance between having an opinion and seeing it running dropped from a day to a minute, so I gave many more opinions. Polish stopped being the thing you skip on a side project and became the fun part.

Who did what

Claude read the documentation, wrote the firmware, the driver, the page and the mocks, compiled, flashed the Cardputer over USB, queried it over Wi-Fi to check its own work, and kept the specs up to date. I chose what to build, decided every time there was a choice, and was its eyes in the living room: whatever a camera or a receiver would have told it, I had to tell it. That is where a human was still the slow part, and the necessary one.

It isn't finished. A few HomeKit paths are still untested, the phone page is open to anyone on our Wi-Fi, and the clip-on pod with four stronger LEDs, for more range, only exists as a schematic and a parts list. But it switches the living room on.