Real-time lock-on
YOLOv8 scores every frame and SkyGuard locks onto the largest bounding box, so the system stays focused on the dominant target instead of flickering between noise.
Real-time vision · Serial control · Edge hardware
SkyGuard AI turns a webcam, YOLOv8, and an Arduino UNO into a live object-tracking system — green when locked, red when scanning, servo always following the largest target in frame.
Why SkyGuard
A full perception-to-actuator path in one repo — no cloud inference required at runtime, no opaque black boxes. You see the frame, the box, the angle, and the hardware response.
YOLOv8 scores every frame and SkyGuard locks onto the largest bounding box, so the system stays focused on the dominant target instead of flickering between noise.
Horizontal error is mapped to pan angle with a dead zone and smoothing factor — less chatter, cleaner motion, safer hobby-servo travel.
Serial commands flip LEDs and LCD state: DETECTED lights green,
LOST lights red. Operators know system state without reading logs.
Works with standard COCO classes — person, bottle, phone, cup, and dozens more — so demos work with objects you already have on the desk.
Inference and control run on your machine over USB serial. No API keys, no round-trips to a remote vision service for the core loop.
Clear Python control loop, simple Arduino firmware, and a documented serial protocol — ideal for CV + embedded systems courses and hackathon builds.
Pipeline
The same loop implemented in detect.py — capture, detect, select, map, smooth, actuate.
OpenCV reads a webcam frame and computes the horizontal center reference line.
Ultralytics YOLOv8 runs multi-class detection with confidence thresholding (default 0.4).
The largest box by area becomes the active track target for that frame.
Normalized offset from frame center becomes a servo angle in a safe 20°–160° window.
Angle updates ease toward the target; tiny errors inside the dead zone are ignored.
Python writes angles and DETECTED / LOST over serial; Arduino drives servo, LEDs, and LCD.
Technology
DETECTED / LOST status lines0–180Bill of materials
All common maker parts — no proprietary modules required for the base build.
| Part | Role |
|---|---|
| Arduino UNO | Microcontroller & serial endpoint |
| Webcam | Live video source |
| SG90 / MG90S servo | Pan axis tracking |
| 16×2 I2C LCD | On-device status & angle |
| Green + red LEDs | Lock / lost indicators |
| 220Ω resistors, breadboard, jumpers | Safe LED drive & prototyping |
D7 Green LEDD6 Red LEDD9 Servo signalA4 / A5 LCD SDA / SCLDETECTED → green lockLOST → red scan90 (any 0–180) → servo angleWhere it shines
Show end-to-end AI → hardware interaction in minutes. Students see bounding boxes become motion.
Explore attention systems that point sensors or lights toward activity without a full robot stack.
A clean base for pan/tilt upgrades, class filters, buzzers, or a future remote dashboard.
Bridge computer vision, control theory basics, and serial firmware in one cohesive project.
Open source
Full source, wiring guide, Arduino sketch, and Python tracker live on GitHub.
Swap yolov8s.pt for yolov8n.pt when you need more FPS on lighter machines.