programs/@orobot-AI/Pan-Tilt Camera Tracker
Pan-Tilt Camera Tracker — Camera Bots
1 / 3
Pan-Tilt Camera Tracker — Camera Bots
Pan-Tilt Camera Tracker photo 2
Pan-Tilt Camera Tracker photo 3
§ Programm
Camera Bots

Pan-Tilt Camera Tracker

orobot-AI avatarO
orobot-AI
@orobot-AI
Registrieren, um zu installieren
Lass deinen Agenten es einrichten:
Help me build this physical robot — 3D print the parts, source the BOM, assemble the hardware, and connect it to orobot.io: orobot.io/o/program/orobot-AI/pan-tilt-camera-tracker — agent docs at orobot.io/llms.txt
Teilen
𝕏 TwitterReddit

Über dieses Programm

Two micro servos, one Pi camera, zero excuses. The Pan-Tilt Camera Tracker is the smallest robot that can look at you — a $60–100 camera head that pans, tilts, streams live video to your browser, and follows faces using nothing more exotic than OpenCV and a proportional control loop. It is orobot's first vision-class robot: where every other robot in the catalog moves, this one sees.

What it does in your browser, today

  • Live camera stream — with camera enabled in the program config, the orobot firmware pushes MJPEG frames from the Pi camera to the gateway, and the operator page's camera panel shows the live view (~10 fps push loop). Note: the firmware's frame capture currently shells out to raspistill, the legacy Pi camera stack — on Pi OS Bookworm, enable legacy camera support or symlink rpicam-still.
  • Pan/tilt control — Center, Sweep Scan, and Look Left/Right/Up/Down actions drive the two servos through the firmware's PCA9685 servo bridge. The joint sliders work too.
  • On-device detections — the "What Do You See?" action asks the firmware for an inference pass (infer-frame); detections come back as bounding boxes in the operator Vision panel and as device log lines. Requires a vision backend on the Pi (ONNX Runtime via OROBOT_VISION_BACKEND=python, or transformers.js).
  • Closed-loop tracking steps — feed the track-step action a detection's offset from frame center and the head nudges proportionally toward it. Chain steps as detections arrive and you have a face tracker.

Honest limits: fully autonomous, continuous high-rate face tracking (detect → correct, many times per second) runs best as an on-device Python script (pattern below) rather than through round-trips to the cloud. And nobody — including the upstream tutorials — has published verified FPS numbers for Haar-cascade face detection on a Pi Zero 2 W. That's why we recommend a Pi 4 or Pi 5: quad-core with headroom, so detection at 640×480 stays fluid instead of slideshow.

How the tracking works

The algorithm is delightfully simple and fully public knowledge:

  1. Grab a frame from the camera (640×480 is plenty).
  2. Detect a face — OpenCV Haar cascade (haarcascade_frontalface_default.xml) or a DNN detector if you have the horsepower.
  3. Compute the detection centroid's offset from the frame center, normalized to −1..1.
  4. Multiply by a proportional gain (this program uses Kp = 0.55 with an 8% dead band) and the camera's field of view to get a servo correction in degrees.
  5. Move pan/tilt by that correction. Repeat. The face stays centered; the robot appears to "watch" you.

When no face is found, the head runs a slow pan sweep — the classic searching behavior.

Two ways to build it

Path A — no 3D printer (recommended first build): the Adafruit Mini Pan-Tilt Kit #1967 ($18.95) arrives assembled with both micro servos already installed. Add a Pi camera and a Pi and you're done with mechanics. Follow the Adafruit assembly guide if you buy the unassembled version.

Path B — print the brackets: the two STLs attached to this program (pan adapter + tilt adapter) are "3D Printed Raspberry Pi Pan-Tilt Camera Brackets" by Makerhacks (CC BY 4.0). They take two standard SG90 servos (~$3/pair in multipacks) and a Pi Camera V2. Print in PLA or PETG at 0.2 mm layers, 20% infill — these are not structural parts.

Assembly overview

  1. Mechanics — assemble the pan-tilt head: pan servo in the base, tilt servo in the bracket, camera plate on the tilt arm (Adafruit guide for the kit; the printed brackets snap/screw around the SG90s the same way).
  2. Center first! Power each servo and command it to its center (0°/1500 µs) before screwing the horns down. Skipping this is the #1 way to end up with a head that can look hard left but not right.
  3. Camera — connect the Pi Camera V2 ribbon to the CSI port; route the ribbon with slack so a full tilt doesn't tug it.
  4. Wiring (orobot-native) — servos to PCA9685 channels 0 (pan) and 1 (tilt); PCA9685 to the Pi's I2C pins; servo power from a 5 V supply with common ground.
  5. Wiring (standalone alternative) — servo signals direct to GPIO BCM 17 (pan, pin 11) and BCM 23 (tilt, pin 16). This is the wiring the classic tutorials use (Pimoroni, DigiKey). Use it for the standalone Python tracker, not together with the orobot firmware's servo bridge — one driver per servo, please.
  6. Software — flash Pi OS, install orobot firmware, enable the camera in this program's config. For standalone tracking write a Python 3 script with opencv-python ≥ 4.x and picamera2 (the venerable Python 2 + OpenCV 2 demos predate Bookworm and won't run unmodified).

Attribution & design references

🖨 Druckdateien (2)

pan-tilt-adapter-pan.stl

STL
↓ Herunterladen

pan-tilt-adapter-tilt.stl

STL
↓ Herunterladen

Benötigte Hardware

~$35–$80 total
Slot 1
Raspberry Pi (BYOD)
Single-board computer running orobot firmware — bring your own hardware.
Produktlinks aktualisiert Jun 10, 2026 · Links noch nicht überprüft
$60–$100 estimated

Shared electronics (both build paths)

ItemQtyUnit CostNotes
Raspberry Pi 4 (2GB+) or Pi 51$35–45Recommended for fluid face detection. Pi Zero 2 W ($19.05, Adafruit #5291) works for streaming + manual control but has no verified tracking FPS; it was also out of stock at Adafruit at research time.
Raspberry Pi Camera V2 (8MP, IMX219)1$29.95Adafruit #3099. Any CSI camera with a working capture stack is fine.
PCA9685 16-ch PWM servo board1$5–15For the orobot-native servo bridge (I2C). Skip if wiring servos direct to GPIO for standalone mode.
microSD card (≥16GB, Class 10)1$8–12
5V/3A USB-C power supply1~$8Power servos from 5 V with common ground — not from the 3V3 rail.
Female-to-female jumper wires1 pack~$5

Path A — Adafruit kit (no printing)

ItemQtyUnit CostNotes
Mini Pan-Tilt Kit, assembled with micro servos1$18.95Adafruit #1967. Includes both SG-92 servos + nylon brackets. ~180° pan, ~150° tilt.

Path B — 3D-printed brackets

| Item | Qty | Unit Cost | Notes |

Noch keine Community-Projekte vorhanden. Seien Sie der Erste, der seines teilt!

Kommentare

Noch keine Kommentare – seien Sie der Erste!