A Model 500 rotary phone that controls the lights. Dial a number, set the mood.

The phone on the counter

In that stretch from early 2020 to late 2023 where I did not go outside much, for some reason, I went a long way into home automation. LIFX bulbs in every socket, a Nest thermostat, the rest of it.

Then in late 2022 my cousin Matt moved in as my roommate. Matt has never been the first person to adopt new technology, and while he thought the setup was cool, he did not love that turning on a light now meant getting his phone out. He was perfectly happy to leave the wall switches alone. He just wanted something physical to press.

So I bought a beautiful Model 500 off eBay, worked out its pulse dialing, wired it to an ESP32, and wrote a HomeSpan accessory with ten buttons on it. Matt was impressed and gave it the thumbs up. We both use it daily.

I still got him to use a phone to control the lights.

Dialing the phone in a room lit cold purple

The digits

Zero is everything on, plain white. One is the half dimmed version for the evening. Two, three and four are colored scenes, which is what the LIFX bulbs are for.

The same room a few seconds later, lit warm amber

Reading the dial

A rotary dial does not send a number. It sends interruptions. Dial a seven and the mechanism opens the circuit seven times on the way back to rest, at about ten pulses a second, and the far end counts them.

There is a second circuit in there too, and it is the one that makes this tractable. The latch closes the moment the dial leaves its resting position, stays closed for the entire journey back, and opens again only once the dial has arrived home.

Both contacts run to pins held high by pull-up resistors, so closing a contact pulls its pin low. The firmware triggers on the rising edge in both cases, which is the moment a contact opens. Pulses increment a counter with fifteen milliseconds of debounce, because a mechanical contact bouncing at speed will happily hand you eleven pulses for a seven. And when the latch finally lets go, that edge is the end of the digit. Not a timeout, not a guess. The dial reporting that it has stopped moving.

Ten buttons, no opinions

Nothing about the lights lives in the firmware. Each digit is registered with HomeSpan as its own stateless programmable button, so HomeKit sees ten buttons and the scene assignments live where every other automation in the house already lives. Rebinding a digit does not involve a compiler.

The handset earns its keep too. The hook switch is read at the moment a digit lands, and a dial with the handset lifted fires as a double press rather than a single. Ten holes, twenty actions, and the modifier is the part of the phone you were already going to pick up.

Details

Seeed XIAO ESP32-C3, HomeSpan, built in October 2022.

The name comes from the HomeKit accessory, which I called Ahoy-hoy: what Alexander Graham Bell wanted people to say when they answered the telephone, and what Mr. Burns actually does say.