Built to order

Edge-AI Perimeter Intrusion Detector

This project builds a Raspberry Pi-based perimeter guard that watches a fenced boundary and detects human intruders entirely on-device. A quantized person-detection model runs on the Pi; when a person crosses the virtual tripwire, the unit sounds a buzzer, flashes a strobe, captures an annotated snapshot and logs the event with a timestamp. A PIR sensor wakes the camera pipeline only when motion is likely, with a local web page showing the live feed, tripwire setup and event history. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Electronics and IoT & Embedded Systems.

AI & Machine Learning Raspberry Pi 4HC-SR501 PIR sensorPython 3 · OpenCVTensorFlow LiteYOLOv8n person detectionMS COCO datasetFlask event pageNoIR camera + IR LEDsHardware
Edge-AI Perimeter Intrusion Detector — project thumbnail preview
More project photos (3)

The problem

Farms, warehouses and construction sites lose equipment to boundary intrusions, but commercial AI camera systems are expensive and stream video to the cloud — a privacy and connectivity problem in rural areas. Simple PIR alarms are cheap but cry wolf at every stray animal and gust of wind. This project sits between the two: a Raspberry Pi with a camera runs a quantized person-detection model locally, so only actual humans crossing a defined tripwire raise the alarm. A PIR sensor keeps the power-hungry vision pipeline asleep until motion is detected, which makes battery-backed deployment practical. Every alarm stores an annotated snapshot locally, so the owner can verify what triggered it instead of trusting a blind siren.

SYSTEM FLOW

5 components 4 connections

Live flow
Drag to explore
100%
sensorPIR Sensor

HC-SR501 PIR monitoring the area at microwatt draw and waking the camera pipeline on motion.

Follow the working sequence

How it works

  1. The PIR sensor monitors the area continuously at microwatt-class draw; on motion it wakes the Pi's camera pipeline.
  2. The camera captures 640×480 frames and the quantized person-detection model runs inference locally on each frame.
  3. Detections above the confidence threshold are tracked by centroid across frames to form person tracks.
  4. When a track crosses the user-drawn tripwire polygon, the event is confirmed (debounced over several frames to reject flicker).
  5. On confirmation, the buzzer and strobe fire, an annotated snapshot is saved, and the event is appended to the local log.
  6. The pipeline sleeps again after a configurable quiet period with no PIR triggers, and all events remain browsable on the local web page.

Tech stack:

  • Raspberry Pi 4 + Pi NoIR Camera Module (IR LEDs optional)
  • HC-SR501 PIR sensor, buzzer, relay/strobe output
  • Python 3, OpenCV, TensorFlow Lite runtime
  • YOLOv8n person detection, INT8-quantized
  • MS COCO (person class) — evaluation reference
  • Flask (local configuration & event page)

Dataset & model details

  • Dataset: MS COCO 2017 — 330k images with 80 object categories, of which the "person" class (~260k annotated instances) is the evaluation reference for the detector. Custom tripwire-crossing clips recorded during the build are used for the end-to-end alarm test procedure.
  • Task: Person detection + tracking + tripwire crossing classification; input = 640×480 RGB frame, output = alarm/no-alarm per frame with intruder bounding box.
  • Model: YOLOv8n (~3.2M parameters), person-class head, post-training INT8 quantization to TensorFlow Lite; centroid tracker with crossing debouncer on top.
  • Metrics: Person-detection precision/recall on the COCO person validation split, false-alarm rate per hour on the recorded test clips, and end-to-end latency from crossing to buzzer — reported as design targets in the build notes, with the actual measured figures recorded during the buyer-run field test. No accuracy is claimed as measured until that run.
Parameter Value
Controller Raspberry Pi 4 Model B, 4 GB RAM (design target)
Camera Pi NoIR Camera Module v2 + 850 nm IR LED array (optional)
Wake sensor HC-SR501 PIR, ~7 m range, 120° cone (datasheet)
Detection model YOLOv8n person class, INT8 TFLite, ~3.2M parameters (design target)
Tripwire User-drawn polygon on the live feed, stored in config
Alarm outputs 5 V buzzer + relay contact for strobe/siren
Event storage Annotated JPEG snapshots + SQLite log, local
Detection latency Target < 1 s from crossing to buzzer (design target)
Power 5 V / 3 A; PIR-gated sleep for battery operation (expected)

Project features

  • [On-device person detection] A quantized YOLOv8n person detector runs fully offline on the Raspberry Pi 4 — no cloud, no subscriptions, footage stays local.
  • [Virtual tripwire] Draw the guarded boundary on the live feed; only crossings of that line trigger alarms, ignoring movement elsewhere in frame.
  • [PIR wake trigger] An HC-SR501 PIR sensor wakes the vision pipeline on motion, cutting average power draw for battery/solar deployments.
  • [Local alarm outputs] Buzzer plus relay-driven strobe output fire on confirmed intrusion, with a configurable cooldown to avoid repeat blasts.
  • [Snapshot evidence log] Every alarm saves an annotated frame with bounding box, timestamp and tripwire overlay to local storage.
  • [Event web page] A local Flask page shows the live feed, lets you draw the tripwire, and lists the alarm history with thumbnails.
  • [Day/night support] Optional NoIR camera with IR LEDs keeps detection working after dark.

What is included

  • Assembled Pi + camera + PIR + alarm unit in enclosure
  • Complete firmware (detection, tracking, tripwire, alarms, web page)
  • Quantized TFLite person-detection model with evaluation notes
  • Wiring diagram and mounting/positioning guide
  • Project report PDF (edge-AI background, tripwire method, methodology, field-test procedure, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (quantization, precision/recall, debouncing, false alarms)

Limitations & prerequisites

  • Detection performance is a design target until the buyer's field test — heavy rain, fog and dense foliage will degrade it, and this is stated in the report.
  • The system detects people, not intent — a trespasser and a curious neighbor look identical to the model.
  • PIR range is ~7 m (datasheet); the camera's useful detection distance depends on lens and lighting, documented in the positioning guide.
  • Night operation needs the NoIR + IR illumination option; the standard camera cannot see in darkness.
  • A determined intruder who avoids the camera's field of view will not be detected — camera placement is part of the documented setup.
  • Not a certified security system — a prototype for study and demonstration, not a replacement for professional perimeter security.

Frequently Asked Questions

How is this better than a PIR alarm?

A PIR alarm fires on any motion — animals, swaying branches, passing headlights. This unit only alarms when the vision model confirms a person crossing your drawn tripwire, so false alarms drop sharply.

Does video leave the device?

No. Detection, snapshot storage and the web page all run on the Pi itself. Nothing is uploaded anywhere.

Which dataset is used?

MS COCO 2017, using its large annotated "person" class as the evaluation reference for the detector, plus custom tripwire-crossing clips for the end-to-end alarm test.

How accurate is it?

Person-detection precision/recall and false-alarm rate are reported as design targets, not measured claims. The report includes a field-test procedure you run at your own site, and the achieved figures are recorded there.

Can it work at night?

Yes with the NoIR camera + IR LED option. The standard camera module is not usable in darkness.

Is this project suitable for a final-year project?

Yes — for AI & Machine Learning, Electronics and IoT programs. It demonstrates edge inference, sensor fusion (PIR + vision), tracking and honest evaluation of a security prototype. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Electronics and IoT & Embedded Systems.

Components & software requirements
  • Raspberry Pi 4 + Pi NoIR Camera Module (IR LEDs optional)
  • HC-SR501 PIR sensor, buzzer, relay/strobe output
  • Python 3, OpenCV, TensorFlow Lite runtime
  • YOLOv8n person detection, INT8-quantized
  • MS COCO (person class) — evaluation reference
  • Flask (local configuration & event page)

Dataset & model details

  • Dataset: MS COCO 2017 — 330k images with 80 object categories, of which the "person" class (~260k annotated instances) is the evaluation reference for the detector. Custom tripwire-crossing clips recorded during the build are used for the end-to-end alarm test procedure.
  • Task: Person detection + tracking + tripwire crossing classification; input = 640×480 RGB frame, output = alarm/no-alarm per frame with intruder bounding box.
  • Model: YOLOv8n (~3.2M parameters), person-class head, post-training INT8 quantization to TensorFlow Lite; centroid tracker with crossing debouncer on top.
  • Metrics: Person-detection precision/recall on the COCO person validation split, false-alarm rate per hour on the recorded test clips, and end-to-end latency from crossing to buzzer — reported as design targets in the build notes, with the actual measured figures recorded during the buyer-run field test. No accuracy is claimed as measured until that run.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation