Project Overview
This project involves a distributed system using ESP32 modules to stream video, detect and count human faces, and trigger a buzzer when a set face count limit is reached. The system consists of three main components:
- ESP32-CAM Module: Streams live video.
- Face Detection Server: Processes the video stream to count faces.
- Pocket ESP32 Module: Receives face count updates, shows it on an LED, and triggers a buzzer in real-time.
How It Works
- Video Streaming: The ESP32-CAM captures and streams live video to the Face Detection Server.
- Face Detection: The Face Detection Server processes the stream using face detection algorithms and counts the number of faces.
- Real-Time Updates: The Pocket ESP32 Module receives face count data and triggers the buzzer based on predefined conditions.
Technologies Used
- ESP32-CAM Module: For video capture and streaming.
- OpenCV: For face detection and image processing.
- Python/Node.js: For the Face Detection Server implementation.
- MQTT/HTTP: For communication between the Face Detection Server and Pocket ESP32 Module.
- Raspberry Pi/Computer: To run the Face Detection Server.
Project Components
ESP32-CAM (Video Stream)
Function: Streams live video feed.
- Endpoints:
/ (provides video stream)
- Controls: Start Stream (starts video streaming)
Pocket ESP32 Module (Buzzer + LED Control)
Function: Controls buzzer and LED based on face count.
- Endpoints:
/on, /off, /update_count
- Controls: Turn On/Off (toggles buzzer and LED)
Flask Face Count Server
Function: Processes video stream, performs face detection, and tracks faces.
- Endpoints:
/video_feed (provides video feed with face detection), /counts (returns count of detected faces)
- Web Interface: Real-time video feed and face count updates
Setup Instructions
ESP32-CAM Configuration
- Update Wi-Fi credentials and upload the code via Arduino IDE.
- Ensure the camera stream is accessible via HTTP.
ESP32 Server Configuration
- Update Wi-Fi credentials and upload code via Arduino IDE.
- Controls the buzzer and LED based on face count updates.
Flask Server Setup
- Install required Python packages (Flask, OpenCV, MediaPipe, Requests, etc.).
- Run
python server.py to start the Flask server.
- Access the web interface
Controls
- ESP32-CAM: Power on the camera module and connect via IP address to view the live feed.
- ESP32 Server: Send HTTP requests (
/on, /off) to toggle the buzzer and LED. Check the serial monitor for the assigned IP.
- Flask Server: Monitor the live video feed and face count updates via the web interface or IP address.