WorkSilicon

Oshkidar

Real-time AI on a $2 microcontroller: radar classification that flushes only for the cat.

Deployed2026

62
engineered radar features, each documented with the physics of why it separates a cat from a ghost
1,500
gradient-boosted trees classify every window as cat, person, refill water, ghost or empty
1 Hz
real-time inference on the chip, over a sliding 8-second window of 10 Hz radar frames
343 KB
of flash holds the whole model; a Bayesian tracker and a state machine decide when to flush
The on-device pipeline, top to bottom: 24 GHz radar frames at 10 per second; once a second on the ESP32-C6, an 8-second window less the empty-room baseline, 62 features, 1,500 gradient-boosted trees in 343 KB scoring five classes, a Bayesian occupancy tracker, and a state machine that decides when to flush. Below: the model is trained offline in Python, validated one held-out day at a time and exported to C.

Oshkidar started as a household problem: a toilet that should flush after the cat has used it, and only for the cat. We took it on as a technical challenge: how much real-time machine-learning classification can run on a $2 microcontroller?

A 24 GHz mmWave radar on the cistern reports reflected energy in nine range gates, ten times a second. Once a second, the ESP32-C6 takes the last eight seconds of frames, subtracts the empty room’s own baseline and computes 62 features. Each feature carries a physical reason it should separate a cat from a person, the tank refilling, an empty room or a “ghost”: someone moving beyond the wall whose reflections flicker at the seat’s range. Gradient-boosted trees, 1,500 of them in 343 KB of flash, score every window across those five classes.

A window is evidence, not a decision. A Bayesian tracker holds a belief about who is in the room, with minutes of memory, and knows that its own flush is followed by a refill. A state machine decides when to flush, after the cat has left, and enforces a cooldown and a flush-rate limit.

The model is trained offline in Python on recorded radar days, validated one held-out day at a time and exported to C, and tests confirm the chip and the trainer compute the same answer. The device replaced a Raspberry Pi prototype and is in daily use; since July, the learned model has had the final say on every flush.