Project Log
AuthorViktor Hansson
SubjectElectronics · 3D printing · misc. hacks
Rev
Commit
303e3c7 · 2026-07-26 21:11 UTC
Author
Claude
Message
LOG-01: stop treating Malmö as a destination (I live here)
View on GitHub →

An optocoupler across my sister's intercom button

My sister has epilepsy and lives alone in a flat in Malmö. If she has a seizure, we need to be able to get in. Until now, we couldn't.

Why this exists

The building has a locked street gate and a locked stairwell door. Both open from a Ritto TwinBus intercom handset on her wall: the resident buzzes visitors through by pressing a door-open button on the handset. There's a key box outside her flat door for the last leg, but there's no way to fit one to the shared gates, the building association wasn't willing to help, and there's no existing app-based entry system for the intercom either.

So if she has a seizure, family arriving to help are stuck on the pavement with no way in and no way for her to buzz them through. The key box gets us past her flat door, but only if we can get to it.

The only place left to solve it is inside the flat: a small device that presses the intercom's door-open button on request from a phone.

Pressing the button with light

The door button on the handset is just a contact on a PCB. A pin held high, that gets pulled to ground when someone presses it. So the trick is to press it without pressing it. An ESP32-C3 sits next to the handset with a PC817 optocoupler wired across those two pads. When the ESP32 drives its GPIO high, the LED inside the optocoupler lights, the phototransistor on the other side conducts, and the intercom sees an ordinary button press.

Nothing on the intercom is cut, nothing is modified, and the two circuits share no electrical connection. The signal crosses as light. That last part is the whole reason for the optocoupler rather than a transistor or a relay: the building's shared bus and my little 3.3 V board never touch, so there is nothing I can get wrong that reaches past this one handset.

The Ritto TwinBus intercom handset opened on the wall. The top half of a green PCB is visible, with a couple of small tactile buttons near the top edge and a yellow LED lit. Below the PCB is a white bezel with two round buttons: a light-bulb icon and a key icon for door-open.
The handset opened, before I've done anything to it. The two round buttons on the bezel are light (bulb) and door-open (key). Pressing the key shorts a contact on the PCB above, and that contact is what the optocoupler will bridge.

The ESP32 hosts a single-page web app on the flat's LAN. Family open it once, paste a shared token that gets stored in the browser, add the page to their home screen, and from then on it's one tap. No account to remember, no app to install from a store, and no round trip to the internet in the moments that matter.

Three things on a colourful hexagon-patterned surface: the two halves of a light-blue 3D-printed enclosure (a lid with a small asterisk-shaped vent pattern, and a tub with mounting pillars inside), and a small ESP32-C3 development board with a USB-C connector and a spare 2-pin connector next to it.
The parts, laid out. An ESP32-C3, a connector, and the two halves of the printed case. The optocoupler and its two fly leads are the last thing to go on, once I'm at the intercom and can solder them across the button pads.

What it deliberately doesn't do

  • No cloud service. Works with the internet down, as long as the LAN is up.
  • No protocol reverse engineering. Paralleling the button is protocol-agnostic and can't disturb the shared building bus, which is the one thing that must not break.
  • No always-on unlock, no "hold open" mode. One endpoint, one fixed 500 ms pulse, hard-capped in firmware. A stuck-open building entrance is the worst failure mode, so every design choice defaults to closed: unpowered, crashed, or mid-boot, the door stays shut.

This is a convenience layer, not a safety system. Both it and the intercom depend on building power, so neither survives an outage. It's one tool alongside the key box and telling the neighbours, not a substitute for either.

What's next

Firmware is flashed and the case is printed. What's left happens at her flat: pop the handset off the wall, solder two thin wires across the button pads, cable-tie the ESP32 next to it, and hand family the token.

The finished 3D-printed enclosure closed with its lid on, plugged into a white USB-C cable, sitting on the same hexagon-patterned surface. Blue LED light from inside is escaping through the small asterisk-shaped vent pattern in the lid and around the USB-C plug.
Case closed, firmware running, LEDs doing their thing through the vent constellation in the lid. Everything on this side of the intercom is ready. What's left is on a wall across town.

Then the page moves onto their home screens, and if the first press does what it should, this stops being a project and starts being a thing that sits on a wall and quietly works.