{"slug": "building-netra-an-edge-ai-camera-that-tracks-you-on-its-own", "title": "Building Netra: an edge-AI camera that tracks you on its own", "summary": "A developer built Netra, an edge-AI camera system that autonomously tracks a person using an ESP32-CAM, YOLOv8 object detection, and servo motors coordinated over MQTT. The project features proportional control and a dead zone to eliminate jitter, plus a Behavioral Anomaly Signature Engine (BASE) for multi-factor threat scoring and ESP-NOW mesh handoff for multi-camera tracking. The full architecture is open-sourced under Apache 2.0.", "body_md": "Most hobby surveillance projects stop at \"stream a webcam to a browser.\" Netra doesn't. It's a closed-loop system: an ESP32-CAM streams frames, a YOLOv8 model finds the person in them, and the result drives two servos that physically turn the camera to keep that person centered — all coordinated over MQTT. The name comes from the Sanskrit word for *eye*, and that's the honest description of what it is: an eye that moves on its own.\n\nIt started as a Microprocessors & Microcontrollers course project and I kept building until it was a full edge-to-cloud stack. This post walks through how the pieces actually fit together.\n\nThere are four moving parts, and each one only does its own job:\n\nEverything talks over **MQTT**, a lightweight pub/sub protocol, with WebSocket used to push real-time updates into the dashboard. The value of pub/sub here is decoupling: the detector doesn't need to know how many things are listening to its output, and the dashboard doesn't need a direct socket to the camera.\n\nThe tracking loop is the heart of the project, and the interesting part is that naïve tracking looks terrible. If you simply move the servo whenever the target isn't perfectly centered, the camera jitters constantly — it chases sub-pixel noise forever and never settles.\n\nTwo design choices fix that:\n\n**Proportional control.** The servo speed scales with how far the target is from the center of the frame. A person at the edge of the frame gets a fast correction; a person almost centered gets a gentle nudge. This is the difference between a camera that snaps and overshoots and one that glides.\n\n**A dead zone.** There's a 12% tolerance band around the center where the camera simply does nothing. Inside that band, \"close enough\" is treated as \"centered,\" which kills the jitter entirely. The servos are MG90S metal-gear units, with roughly 0°–180° of pan and 30°–150° of tilt.\n\nThose two rules — scale the response, and ignore tiny errors — are what turn a twitchy demo into something that tracks a walking person smoothly.\n\nThe dashboard exposes three modes, and they map cleanly onto real use:\n\nDetecting a person is table stakes. The layer I'm most happy with is **BASE — the Behavioral Anomaly Signature Engine**. Instead of just firing an alert every time it sees a human (which would make the alerts useless), BASE does multi-factor threat scoring against configurable thresholds and builds time-weighted patrol heat-maps of where activity concentrates. The goal is signal, not noise: a system that can tell \"someone walked through the hallway at noon\" apart from \"someone is lingering somewhere they shouldn't be at 3 a.m.\"\n\nA single node is a demo; a security system is many cameras. Netra is designed for that with **ESP-NOW mesh handoff**, supporting up to eight camera nodes so a target can be tracked as it moves between their fields of view. The dashboard was built with this in mind too — the live feed uses stream-isolated rendering so that React re-rendering the surrounding UI never tears down the video element and drops the feed. Small detail, but if you've ever had a stream die every time a sibling component updates, you know why it matters. There's also a 4-second auto-reconnect so a dropped stream recovers on its own.\n\nThree things carried most of the weight:\n\nNetra spans firmware, computer vision, a real-time backend, and a frontend — which is exactly why it was worth building. The full architecture, wiring diagrams, API reference, and setup guide are in the repository, released under Apache 2.0.", "url": "https://wpnews.pro/news/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own", "canonical_source": "https://dev.to/dev-into-space/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own-2khb", "published_at": "2026-08-13 10:21:01+00:00", "updated_at": "2026-08-13 10:47:44.927335+00:00", "lang": "en", "topics": ["computer-vision", "artificial-intelligence", "developer-tools"], "entities": ["Netra", "ESP32-CAM", "YOLOv8", "MQTT", "ESP-NOW", "MG90S", "BASE", "Apache 2.0"], "alternates": {"html": "https://wpnews.pro/news/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own", "markdown": "https://wpnews.pro/news/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own.md", "text": "https://wpnews.pro/news/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own.txt", "jsonld": "https://wpnews.pro/news/building-netra-an-edge-ai-camera-that-tracks-you-on-its-own.jsonld"}}