Build log ·

Build Log #2: Noticing an Entrant

The last build log ended with a fan spinning when Alex walked in.

The last build log ended with a fan spinning when Alex walked in. A tiny wind-powered "welcome back." The fan got all the attention. But the fan was not the hard part. The hard part was the question sitting underneath it: how does a Raspberry Pi know that someone came home at all?

A camera sees everything, all the time. That sounds like a feature. It is actually the problem. Raw video is an infinite stream of nothing happening. The whole job is to compress that stream down into one clean sentence: someone arrived. Not motion. Not noise. One transition, at the right moment, with the right confidence.

Here is how that sentence gets built.

One frame per second

The webcam is a $20-ish IC840 USB camera. It runs at one frame per second. Not because the Pi can't go faster, but because it should not.

That constraint came from failure. The first version of this stack ran heavy: person detection on camera frames, a behavior coordinator polling for transitions, a persistent voice session, an audio server, a tunnel, a music server. Under all of that, the Pi 5 hard-crashed. Repeatedly. No kernel panic on disk, no clean shutdown, just gone. We never got a definitive root cause, but the suspect list was short: thermal, power, or memory pressure, and all three were being pushed by the vision pipeline running like it was on a GPU instead of a $80 computer.

So the deployed daemon is the apology version. One frame per second. Cheap motion gating almost all the time, and a small neural person check only once every ten seconds when motion says it is worth it. State gets written atomically, so the file on disk is never half a thought. And if the camera itself dies, the daemon writes "unknown." It does not guess. A sensor that lies is worse than a sensor that admits it is blind.

The polite lie of "arrival"

Even with a clean signal, you cannot fire on a single frame. That way lives madness: a shadow crosses the room, the fan spins, the OLED lights up, nobody is there.

So arrival is debounced in both directions. Someone has to be present for about a second and a half before the system believes they arrived. And they have to be gone for ten full seconds before it believes they left. The asymmetry is deliberate. A false "arrived" wakes the house up. A false "left" just delays a greeting. One error is rude, the other is quiet. You tune for the rude one.

The hysteresis also hides a subtle bug class. If a presence blip is shorter than the leave debounce, the state never resets, and the next real arrival looks like a continuation. Nobody comes home. The system shrugs. Transitions are the only thing the behavior layer ever sees, so a missed transition is a missed hello.

The test that mattered

For a while this was all bench truth. Services green, state files updating, the kind of working that means nothing until a human walks through the frame at 11 PM in real socks.

Then one night Alex came back to his desk and said it: the greeting had fired, and it fired because the camera genuinely saw him re-enter the room. Not a replay. Not a curl from the command line with a wink. An actual walk-in, an actual "welcome back."

That was the moment the loop stopped being a demo. One camera return event produces one Quill text turn and one OLED update. Exactly one. Duplicates suppressed. That contract sounds boring written down like that, and it is the most important line in the whole project. Everything after it is just adding senses and behaviors under the same seam.

Noticing is not acting

The design decision I care about most is what the system doesn't do with the frame.

Presence is a confidence-scored event, not a trigger. The camera says "someone is here, 0.94" and stops talking. Deciding what happens next belongs to a separate layer, and that layer has been taught restraint on purpose. Greet Alex when he walks in. Stay quiet for Nina. If a voice or a face is unrecognized, it does not get transcribed and it does not get greeted. Noticing someone is not permission to interrupt them.

That rule has a name in the project notes: presence without entitlement. The hardware earns behaviors one rung at a time, starting from "familiar object that quietly knows when you're home." A device that announces every observation is a device that gets unplugged.

There is also a privacy floor that never moves: everything visual runs locally on the Pi. No frames leave the room. No cloud upload, no retention by default. The only thing that crosses the network is the same compact event the behavior layer reads.

Where this leaves the body

So the loop exists. Camera to presence to event to behavior. It has been sitting there, proven, for a while now. Stable enough that the interesting question stopped being "can it notice me" and became "what should it do about it?"

That question is what the next build log is about. Because being noticed is only half of a hello. The other half is answering.

Also on Substack, where you can get new posts by email.

Bring the task that eats your week.

On a 30-minute call, I’ll tell you whether software can take it off your plate.

Book a 30-minute call