Computer-vision Object Observation & Prediction. COOP keeps an eye on the coop.
A Raspberry Pi 5 camera that spots people and cars, predicts where they’re heading, and turns on a stepper motor to keep them in frame.
Scroll to pan
See
It starts with a frame: brightness values, and nothing that knows what they are.
A 5 MP OV5647 camera on the Raspberry Pi 5 watches the street through a 3.6 mm lens. COOP reads it 640 × 480 pixels at a time, and every frame goes through the same loop.
- Sensor
- OV5647, 5 MP
- Field of view
- 63° × 49°
- Frame
- 640 × 480
Detect
Boxes snap onto what matters, and each one keeps its name.
YOLO11n runs on the Pi 5’s CPU at a 320 px input, with no accelerator. It finds people and vehicles, and ByteTrack gives each one an ID that survives from frame to frame. COOP stays on its target while it’s visible, and otherwise picks people first, then the biggest in view.
- Model
- YOLO11n, 320 px
- Tracker
- ByteTrack
- Classes
- people, cars, buses, trucks, motorcycles
Predict
Aim where it’s going, not where it was.
Every detection becomes a world angle: where the camera points, plus where the target sits in the frame. A constant-velocity Kalman filter estimates how fast that angle is changing, and COOP aims 150 ms ahead to cancel its own latency.
Move
Then it turns to follow.
The Pi sends a target angle over USB serial to an Arduino Uno, and AccelStepper ramps a NEMA 17 through a TMC2209 driver, so the camera eases onto the target instead of jerking. If the Pi goes quiet for two seconds, a watchdog stops the motor.
Build
One 12 V supply, two brains.
The Pi 5 does the seeing. An Arduino Uno makes the step pulses, because Linux can’t time them reliably. The motor runs straight off 12 V, and a buck converter feeds the Pi 5.1 V.
- OV5647 camera5 MP, 3.6 mm, 75° diagonal
- Raspberry Pi 58 GB, vision and control
- Arduino UnoAccelStepper over USB serial
- TMC2209STEP/DIR, 8 microsteps
- NEMA 17pan axis
- 12 V supply → buckmotor direct, Pi at 5.1 V
Gallery
From the bench.
Drag or scroll to turn
- Finished unit
- Inside the build
- Tracking a person
- The dashboard
- Pan mount
- Wiring
- Following a car
- The team at work
Team
Two people, built in parallel.
Everything runs on a laptop with a webcam and simulated motors, so the software and the hardware never had to wait for each other.
- David Hernandez Software Vision, tracking, prediction, the control API and the dashboard.
- Teammate name Design & hardware ✏️ One line about what they built.