An intelligent IoT bot system with real-time hazard detection, live video streaming, person detection, and remote control capabilities
VigilSense combines Raspberry Pi, Arduino UNO R4 WiFi, and AI-powered computer vision to create a comprehensive monitoring and patrolling solution. Features include live camera streaming with YOLOv8 person detection, real-time sensor monitoring, hazard detection, and Bluetooth/WiFi-controlled motor system.
- Real-time MJPEG streaming from Pi Camera v3
- YOLOv8 person detection with bounding boxes
- Live person count displayed on video feed
- Responsive web interface with dark theme
- Temperature & Humidity (DHT11)
- Gas Detection (MQ sensor)
- Flame Detection (Digital flame sensor)
- Sound Detection (Microphone)
- Vibration Detection (Analog sensor)
- Color-coded alerts for hazard thresholds
- Interactive sensor trend graphs (Chart.js)
- Bluetooth Low Energy (BLE) control via Bluefruit Connect app
- WiFi web interface for browser control
- 4-motor control with L293D driver
- Speed control and directional commands
- Real-time status feedback
- Premium dark theme with glassmorphism effects
- Responsive design (mobile-friendly)
- Fullscreen mode support
- Detection log table with filtering
- System status banner with alerts
- No-scroll single-viewport layout
- Raspberry Pi for video processing and web server
- Arduino UNO R4 WiFi for sensor data and motor control
- Pi Camera v3 for live video streaming
- Multiple sensors for comprehensive monitoring
Main dashboard with live camera feed, sensor cards, and trend graphs
Detailed detection log table with timestamp and sensor readings
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Raspberry Pi โโโโโโโโโโบโ Arduino UNO R4 โโโโโโโโโโบโ Sensors โ
โ โ Serial โ WiFi โ โ & Motors โ
โ - Flask Server โ โ - Sensor Reader โ โ โ
โ - YOLOv8 AI โ โ - Motor Control โ โ โ
โ - Pi Camera v3 โ โ - BLE/WiFi โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โ HTTP/MJPEG Stream
โผ
โโโโโโโโโโโโโโโโโโโ
โ Web Browser โ
โ / Mobile App โ
โโโโโโโโโโโโโโโโโโโ
- Raspberry Pi (4B recommended) with Pi Camera v3
- Arduino UNO R4 WiFi
- L293D Motor Driver (1 or 2 chips)
- 4 DC Motors
- Sensors: DHT11, MQ Gas, Flame, Microphone, Vibration
- Python 3.8+ on Raspberry Pi
- Arduino IDE or Arduino CLI
git clone https://github.com/StarkAg/vigil-sense-dashboard.git
cd vigil-sense-dashboardpip3 install --break-system-packages -r requirements.txt- DHT11 โ Digital D4
- Gas Sensor โ Analog A0
- Vibration โ Analog A3
- Flame Sensor โ Digital D7
- Microphone โ Digital D9
See HARDWARE_SETUP.md for detailed wiring.
- Motor 1: IN1=D2, IN2=D3, ENA=D5
- Motor 2: IN3=D4, IN4=D7, ENB=D6
- Motor 3: IN1=D8, IN2=D9, ENA=D10
- Motor 4: IN3=D11, IN4=D12, ENB=D13
See MOTOR_CONTROL_SETUP.md for details.
# Using Arduino IDE: Open arduino_code.ino and upload
# Or using Arduino CLI:
arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi arduino_code/
arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:renesas_uno:unor4wifi arduino_code/# Bluetooth version (recommended):
./upload_motor_control_ble.sh
# Or WiFi version:
./upload_motor_control.sh# Automated deployment:
./deploy_to_pi.sh
# Or manually:
scp -r . pi@raspberrypi.local:~/vigil_sense_dashboard/
ssh pi@raspberrypi.local
cd ~/vigil_sense_dashboard
pip3 install --break-system-packages -r requirements.txt
python3 app.pyOpen your browser and navigate to:
http://raspberrypi-ip:8080
Or if running locally:
http://localhost:8080
- HARDWARE_SETUP.md - Complete hardware wiring guide
- ARDUINO_SETUP.md - Arduino IDE setup and upload instructions
- MOTOR_CONTROL_SETUP.md - Motor driver and control setup
- L293D_PIN_REFERENCE.md - Detailed L293D pin reference
- BLUETOOTH_SETUP.md - Bluetooth control with Bluefruit app
- BLUEFRUIT_SETUP.md - Bluefruit Connect app guide
- PIN_CONFIRMATION.md - Pin configuration verification
GET /stream.mjpg
Returns MJPEG video stream with YOLOv8 person detection overlay.
GET /api/sensors
Returns JSON:
{
"temperature": 25.5,
"humidity": 60.0,
"gas": 450,
"flame": 0,
"sound": 1,
"vibration": 512
}GET /api/logs
Returns array of last 10 detection entries.
GET /api/status
Returns:
{
"status": "normal",
"message": "โ
All Systems Normal"
}GET /api/people
Returns:
{
"count": 2,
"yolo_enabled": true
}forward/f/w- Move forwardbackward/b/s- Move backwardleft/l/a- Turn leftright/r/d- Turn rightstop/x- Stop all motorsspeedup/+- Increase speedspeeddown/-- Decrease speedspeed:200- Set speed (100-255)
- Navigate to
http://[arduino-ip]/forward - Or use the web interface controls
- Flask - Web framework
- OpenCV - Image processing
- Ultralytics YOLOv8 - Person detection
- PySerial - Arduino communication
- Gevent - Async server
- TailwindCSS - Styling (CDN)
- Chart.js - Data visualization
- Vanilla JavaScript - Real-time updates
- Raspberry Pi OS - Linux-based OS
- Arduino UNO R4 WiFi - Microcontroller
- rpicam-vid - Pi Camera v3 streaming
- L293D - Motor driver
vigil_sense_dashboard/
โโโ app.py # Flask backend with YOLO
โโโ requirements.txt # Python dependencies
โโโ templates/
โ โโโ index.html # Main dashboard
โ โโโ logs.html # Detection logs page
โโโ static/
โ โโโ css/
โ โ โโโ style.css # Custom styles
โ โโโ js/
โ โโโ dashboard.js # Frontend logic
โโโ arduino_code.ino # Sensor data collection
โโโ arduino_motor_control_ble.ino # Bluetooth motor control
โโโ arduino_motor_control.ino # WiFi motor control
โโโ deploy_to_pi.sh # Deployment script
โโโ upload_motor_control*.sh # Motor control upload scripts
โโโ docs/
โโโ HARDWARE_SETUP.md
โโโ ARDUINO_SETUP.md
โโโ MOTOR_CONTROL_SETUP.md
โโโ ...
Edit arduino_motor_control.ino:
const char* ssid = "YourWiFiName";
const char* password = "YourPassword";Edit app.py to adjust alert thresholds:
# Hazard detection thresholds
TEMP_THRESHOLD = 35.0
GAS_THRESHOLD = 500Modify init_camera() in app.py:
'--width', '1280',
'--height', '720',
'--framerate', '30',# Kill any existing camera processes
pkill -9 rpicam-vid
# Restart the dashboard
python3 app.py# Check serial port
ls /dev/ttyACM* /dev/ttyUSB*
# Test connection
python3 test_arduino.py# Install ultralytics
pip3 install --break-system-packages ultralytics
# First run will download model (~6MB)- Ensure Arduino code is uploaded
- Check Serial Monitor for "BLE initialized"
- Restart Bluefruit Connect app
- Verify phone Bluetooth is enabled
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
StarkAg
- GitHub: @StarkAg
- Project Link: https://github.com/StarkAg/vigil-sense-dashboard
- Ultralytics for YOLOv8 model
- Adafruit for Bluefruit Connect app
- Arduino community for hardware support
- Raspberry Pi Foundation for Pi Camera support
Current Version: 2.0
- โ Live video streaming with YOLOv8
- โ Real-time sensor monitoring
- โ Bluetooth motor control
- โ WiFi motor control
- โ Comprehensive documentation
- ๐ Active development
If you find this project useful, please consider giving it a star โญ!
Made with โค๏ธ for IoT and Robotics enthusiasts