Skip to content

Repository files navigation

Smart Guard Robot

الراصد الذكي

Intelligent Quadruped Scout & Guard Robot

     


Smart Guard is an AI-assisted quadruped surveillance robot that combines intelligent sensor monitoring, real-time camera streaming, and autonomous patrol capabilities. Controlled through a Flutter application over WebSocket, it operates in Manual, Scout, and Guard modes for exploration, monitoring, and security tasks.


Key Features

  • 🤖 Quadruped walking robot
  • 🧠 Sensor-assisted intelligence
  • 📷 Live camera streaming
  • 📡 Motion & presence detection
  • 🛡️ Autonomous guard mode
  • 🔍 Environment scouting mode
  • 🎮 Real-time manual control
  • 📱 Flutter mobile application

Operating Modes

Mode Description
🕹️ Manual Full movement control (forward / backward / left / right) via the app
🔍 Scout Robot scans the environment using distance sensor and camera, streaming data to the app
🛡️ Guard Automatically detects people via LD2420 and sends an instant alert with direction

Intelligent Behavior

The robot combines data from:

  • HC-SR04 distance sensor
  • LD2420 presence sensor
  • Camera stream

to improve environment awareness, obstacle detection, target monitoring, and autonomous guard operations.



Hardware

Component Model
Single-board computer Raspberry Pi
Servo controller PCA9685 (16-channel)
Servos 8× 180° servos + 1 scan servo
Distance sensor HC-SR04
Presence sensor LD2420 (OT1 / OT2)
Camera Raspberry Pi Camera
App Flutter (Android / iOS)


Servo Channel Map — PCA9685

Channel Leg Joint Function
0 Front Left Upper Swing (left / right)
1 Front Left Lower Lift (up / down)
2 Front Right Upper Swing (left / right)
3 Front Right Lower Lift (up / down)
4 Back Left Upper Swing (left / right)
5 Back Left Lower Lift (up / down)
6 Back Right Upper Swing (left / right)
7 Back Right Lower Lift (up / down)
15 Scan servo Rotate HC-SR04

All servos start at 90°. Right-side legs are automatically mirrored in firmware: angle = 180 - angle



Wiring

PCA9685 → Raspberry Pi

PCA9685 Raspberry Pi
VCC 5V
GND GND
SDA GPIO 2
SCL GPIO 3

HC-SR04

HC-SR04 Raspberry Pi
VCC 5V
GND GND
TRIG GPIO 23
ECHO GPIO 24 ← voltage divider (1K / 2K)

⚠️ Voltage divider on ECHO: 1K resistor between ECHO and GPIO24, 2K between GPIO24 and GND

LD2420

LD2420 Raspberry Pi
3.3V 3.3V
GND GND
OT1 GPIO 17 (presence detected)
OT2 GPIO 27 (motion detected)

⚠️ Do NOT connect LD2420 to 5V — it runs on 3.3V only

All GND pins (Pi, PCA9685, servos, HC-SR04, LD2420) must share a common ground




WebSocket API

Server runs on port 8765 — camera stream on 8080.

Command Fields Description
set_mode mode: manual|scout|guard Switch operating mode
move direction, speed Move the robot (manual mode only)
scan angle Rotate scan servo
ping Connection health check

Running on the Pi

cd raspberry_pi
pip install websockets adafruit-circuitpython-pca9685 adafruit-circuitpython-motor RPi.GPIO pyserial
python server.py



Running the App

flutter pub get
flutter run

Set the Pi's IP address in the app settings, then select your desired mode.


وضع الاستطلاع
الصفحة الرئسيه
وضع الحراسه



3D Printed Parts

     

The 3D/ folder contains all STL files:



Project Structure

Smart-Guard/
├── lib/                        # Flutter app
│   └── main.dart
├── raspberry_pi/               # Robot firmware (obfuscated)
│   ├── server.py               # Main WebSocket server
│   ├── gait.py                 # Walking algorithm 🔒
│   ├── servo_controller.py     # Servo control 🔒
│   ├── sensors.py              # HC-SR04 + LD2420
│   └── camera_stream.py        # Camera streaming
├── 3D/                         # 3D print files
│   ├── Base.stl
│   ├── Leg.stl
│   ├── arm.stl
│   └── ...
└── assets/

@vuvvvv


Future Improvements

Planned enhancements for future versions:

  • 🤖 Full autonomous navigation
  • 🗺️ Real-time mapping (SLAM)
  • 🎯 AI object recognition and tracking
  • 🔋 Battery monitoring system
  • 📍 GPS-based patrol routes
  • 🌐 Remote internet control
  • 📢 Voice alerts and notifications
  • ☁️ Cloud event logging

About

Smart Guard is an AI-assisted quadruped surveillance robot that combines intelligent sensor monitoring

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages