An intelligent security system combining ESP32-CAM and STM32 Blue Pill microcontrollers for real-time motion detection and alerting. Sentinel uses PIR sensors and camera-based AI detection to provide multi-layered security monitoring.
- Real-time Motion Detection: PIR sensor integration for immediate motion sensing
- AI-Powered Vision: ESP32-CAM module for intelligent image capture and processing
- Audio Alerts: Buzzer system with customizable alert patterns (3 beeps per minute on detection)
- Dual Microcontroller Architecture: Independent ESP32-CAM and STM32 operation for enhanced reliability
- Low Power Design: Optimized for continuous monitoring applications
- AI Thinker ESP32-CAM - Camera module for image capture and AI processing
- STM32 Blue Pill (STM32F103C8T6) - Main controller for sensor processing
- PIR Motion Sensor (HC-SR501 or similar) - Passive infrared motion detection
- Active Buzzer - Audio alert system
- USB-Serial 'mb' Programmer - For flashing ESP32-CAM
- ST-Link V2 - For programming STM32
- Jumper wires
- Breadboard (for prototyping)
- 5V power supply
- Resistors (as needed for circuit)
PIR Sensor:
VCC β 5V
GND β GND
OUT β PA0 (or configured GPIO pin)
Buzzer:
Positive β PB12 (or configured GPIO pin)
Negative β GND
Power:
5V β VCC
GND β GND
Programming (via USB-Serial 'mb'):
U0R β RX
U0T β TX
IO0 β GND (during flash)
- Arduino IDE installed
- ESP32 Board Support added to Arduino IDE
- STM32CubeIDE or Arduino IDE with STM32 support
- OpenCV libraries (optional, for advanced AI features)
git clone https://github.com/sidxhdev/sentinel.git cd sentinel
Open esp32-cam/sentinel-cam.ino in Arduino IDE Connect ESP32-CAM via USB-Serial 'mb' programmer Select Tools > Board > AI Thinker ESP32-CAM Select correct COM port (e.g., COM3) Press and hold BOOT button, then upload
Connect ST-Link V2 to STM32 Open stm32/sentinel-controller/ in STM32CubeIDE Build and flash to STM32
text
- Captures images on trigger
- Runs lightweight AI detection models
- Independent operation from STM32
- Monitors PIR sensor continuously
- Triggers buzzer alerts (3 beeps/minute pattern)
- Manages power and timing logic
Edit config.h to customize:
- PIR sensor sensitivity
- Buzzer alert pattern
- Detection cooldown period
- Image capture frequency
Configure in esp32-cam/config.h:
- Detection confidence threshold
- Image resolution
- Processing interval
- Power On: Connect both microcontrollers to power supply
- Initialization: System performs self-check (buzzer beeps once)
- Active Monitoring: PIR sensor continuously monitors for motion
- Alert Mode: On detection, buzzer sounds (3 beeps every minute) and ESP32-CAM captures images
- Reset: Press reset button on STM32 to clear alerts
sentinel/ βββ esp32-cam/ β βββ sentinel-cam.ino β βββ config.h β βββ README.md βββ stm32/ β βββ sentinel-controller/ β β βββ Core/ β β βββ Drivers/ β β βββ sentinel-controller.ioc β βββ README.md βββ docs/ β βββ wiring-diagram.png β βββ setup-guide.md βββ README.md
- Ensure IO0 is connected to GND during upload
- Check USB-Serial 'mb' programmer connections
- Verify correct COM port selection (check Device Manager)
- Verify ST-Link V2 connections
- Check power supply (3.3V/5V requirements)
- Try different USB port or cable
- Adjust PIR sensor potentiometer (sensitivity)
- Increase detection cooldown period
- Shield sensor from air currents and heat sources
- Add WiFi connectivity for remote monitoring
- Implement cloud storage for captured images
- Mobile app integration
- Multiple camera support
- Advanced AI person detection with OpenCV
- Power optimization for battery operation
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.
Siddesh (@sidxhdev)
- ESP32-CAM community for camera integration examples
- STM32 community for embedded development resources
- OpenCV contributors for AI detection capabilities