The problem
Cars routinely blow past the 25 mph limit on a residential street where kids play. The highway district ran its own traffic study and concluded the issue was enforcement, not engineering, so it added no traffic calming. The police haven't responded to speeding complaints. With the official channels at a standstill, I wanted my own evidence, and not another anecdote: continuous, timestamped speed events, direction of travel, time-of-day patterns, and how often cars actually break the limit.
What I built
So I built the dataset. A Raspberry Pi Zero 2 W with a NoIR camera sits in a weatherproof enclosure on a solar-powered shed about 15 feet off the street, aimed square at traffic. A Python script uses OpenCV background subtraction to pick moving vehicles out of the static scene, tracks each one's centroid across frames, and calculates speed from how far it travels against the known geometry of the shot. Every vehicle over 15 mph is logged with a timestamp, its speed, and its direction. The whole thing runs around the clock as a systemd service that restarts itself on boot.
Each event posts in real time to a FastAPI server running in Docker on my Synology NAS, where it lands in SQLite and shows up on a live dashboard. One click exports the full record to a CSV formatted to hand straight to the highway district. Total hardware cost was about $80, and the build took roughly three days.
The dashboard
| Time | Speed | Direction | Status |
|---|---|---|---|
| 14:22:11 | 32.4 | W to E | OVER |
| 14:19:44 | 28.7 | E to W | OVER |
| 14:17:03 | 27.4 | W to E | OVER |
| 14:14:58 | 24.3 | E to W | ok |
Illustrative dashboard with sample figures. The live version runs on my local network and isn't public; raw event data and CSV exports are available on request.
The stack
What it shows about how I work
- Product instinct. I turned a vague, stuck complaint into a measurable dataset aimed at the exact stakeholder who could act on it. Framing a problem so the data moves a decision is the core of the job.
- Technical range. One person carrying a system from edge hardware and computer vision through a networked backend to a shipped dashboard.
- Bias to ship. A working system in three days for the price of dinner, instead of waiting on a process that had already stalled.
- Built to run. A real deployment on cheap hardware with automatic recovery and persistent logging, not a demo that works once.
- Privacy by design. It records anonymous speed events, timestamp, speed, and direction, not license plates or identities.
Why it's here
This project isn't really about traffic, or cameras, or hardware. It's about how I work. I find a problem that's stuck, scope the smallest system that actually solves it, and build and ship the whole thing myself. Here the problem happened to live on a residential street. Elsewhere it's an accounting close that drags, a report nobody can pull, or something I haven't run into yet. The domain and the tools change every time; the approach doesn't. Go where the work is, understand it well enough to build the right thing, and deliver something that runs. I'd rather be the person who solves the problem in front of me than the one with a single narrow specialty.
← Back to all work