Smart Guardian RobotCam is a complete and professional video surveillance system based on ESP32-CAM, designed to security monitor with remote pan/tilt control via positional servo motors.
Development Note: This project was developed with the assistance of Claude Sonnet 4.5 by Anthropic, an AI assistant that helped with code optimization, documentation, and troubleshooting throughout the development process.
- 📹 Live video streaming with configurable resolution (QVGA - UXGA)
- 🎮 Pan/tilt servo control with sliders (0-180°)
- 💾 3 preset positions saveable with RESET button
- 🎨 HUE color picker customizable with EEPROM memory
- 📱 Installable PWA as native app on smartphones
- 🔄 OTA Updates for wireless firmware updates
- 🖼️ Fullscreen mode with double click
- 💡 Flash LED with PWM brightness control
- 📊 OLED display for status information
- 🌐 Built-in WiFi Access Point
Secure, low-cost indoor surveillance camera for monitoring children from another room, streaming locally through an ESP32 private Wi-Fi network with no external data transmission:
- ✅ Complete control of framing without physically moving the device
- ✅ Save favorite positions (crib, door, play area)
- ✅ Responsive web interface accessible from any device
- ✅ OTA firmware updates without disassembling the device
- ✅ Complete aesthetic customization
| Component | Specifications | Quantity | Notes |
|---|---|---|---|
| ESP32-CAM | AI-Thinker with OV2640/OV3660 | 1 | Main module |
| Positional Servos | MG90S or Miuzei Metal Gear 180° | 2 | |
| OLED Display | SSD1306 128x64 I2C | 1 | Optional but recommended |
| Power Supply | 5V 2A+ | 1 | |
| Jumper Wires | Male-Female | - | For connections |
| Pan/Tilt Mount | Servo mechanical support | 1 | 3D printable (see 3D_Print folder) |
3D printable STL files for the pan/tilt mount are available in the 3D_Print/ folder.
Note: Original source files (CAD models) for 3D parts are available upon request but are not included in the repository as they are hobby-grade designs, not professionally engineered. If you need them for modificaSmart_Guardian_RobotCamtions or custom adaptations, feel free to open an issue or contact the maintainer.
This project requires POSITIONAL servos (0-180°), NOT continuous rotation servos!
How to verify:
- ✅ Positional: Move to a specific angle and stop
- ❌ Continuous: Rotate continuously like motors
Recommended servos:
- Miuzei 9g Servo Metal Gear (180°, 6V)
- TowerPro MG90S
- Any servo with 0-180° range
(see Wiring folder)
| ESP32-CAM Pin | Component | Note |
|---|---|---|
| GPIO 12 | Pan Servo (Horizontal) | PWM Signal |
| GPIO 13 | Tilt Servo (Vertical) | PWM Signal |
| GPIO 14 | OLED SDA | I2C Data |
| GPIO 15 | OLED SCL | I2C Clock |
| GPIO 4 | Flash LED | PWM |
| 5V | DO NOT power servos from ESP32! | |
| GND | Common ground | All GNDs connected together |
5V 2A Power Supply
│
├─── ESP32-CAM (5V)
├─── Pan Servo (5V + GND)
├─── Tilt Servo (5V + GND)
└─── OLED (3.3V/5V + GND)
NOTE: MG90S servos also work at 5V with slightly reduced torque (designed for 6V).
- Arduino IDE 1.8.19 or higher (or Arduino IDE 2.x)
- ESP32 Board Support 2.0.x or higher
- CH340 Driver (for USB programming)
Install via Arduino Library Manager:
| Library | Version | Purpose |
|---|---|---|
| ESP32Servo | 0.13.0+ | Servo motor control |
| Adafruit GFX Library | 1.11.x | OLED graphics |
| Adafruit SSD1306 | 2.5.x | OLED driver |
| ArduinoOTA | Included in ESP32 Core | Wireless updates |
ESP32 Board Installation:
- Arduino IDE → File → Preferences
- Additional Board Manager URLs:
https://espressif.github.io/arduino-esp32/package_esp32_index.json - Tools → Board → Board Manager → Search "ESP32" → Install
Board Settings:
- Board: "AI Thinker ESP32-CAM"
- Upload Speed: 115200
- Flash Frequency: 80MHz
- Partition Scheme: "Minimal SPIFFS (1.9MB APP with OTA)"
- Core Debug Level: "None"
First time (via USB):
- Connect FTDI/USB programmer to ESP32-CAM
- Connect GPIO 0 to GND (boot mode)
- Open
Source_Code/ESP32_robot_cam/ESP32_robot_cam.ino - Modify WiFi credentials (if needed):
const char* ssid = "ESP32-CAM-Monitor"; // WiFi SSID const char* password = "12345678"; // WiFi Password const char* ota_password = "12345678"; // OTA Password
- Click Upload
- Disconnect GPIO 0 from GND after upload
- Press RESET
In the .ino file, modify:
// Servo angle limits (ADJUST to prevent cable tangling!)
#define PAN_MIN_ANGLE 0 // Left limit (default 0°)
#define PAN_MAX_ANGLE 180 // Right limit (default 180°)
#define TILT_MIN_ANGLE 0 // Down limit (default 0°)
#define TILT_MAX_ANGLE 180 // Up limit (default 180°)Example restricted limits:
#define PAN_MIN_ANGLE 30 // Avoid cables on left
#define PAN_MAX_ANGLE 150 // Avoid cables on right
#define TILT_MIN_ANGLE 45 // Avoid cables downward
#define TILT_MAX_ANGLE 135 // Avoid cables upward- Power on ESP32-CAM
- OLED displays:
WiFi: ESP32-CAM-Monitor Pass: 12345678 IP: 192.168.4.1 OTA: Monitor-CAM - Connect smartphone/PC to WiFi ESP32-CAM-Monitor
- Password: 12345678
- Open browser:
http://192.168.4.1
- Double click on video → Fullscreen mode
- Pan Slider → Horizontal movement (0-180°)
- Tilt Slider → Vertical movement (0-180°)
[POS 1] [POS 2] [POS 3] ← Recall saved position
[HOME] ← Return to 90°/90°
[RESET] ← Clear all presets
[SAVE 1] [SAVE 2] [SAVE 3] ← Save current position
How to use:
- Move camera with sliders to desired position
- Click SAVE 1 → Saves to memory
- Click POS 1 → Returns to saved position
- RESET → Clears all presets (returns to 90°/90°)
Presets are saved in EEPROM and persist after reboot!
- ON/OFF → Turns LED on/off
- Brightness slider → Adjusts intensity (0-255)
- PHOTO → Downloads instant photo
- HUE Slider → Changes theme color (0-360°)
- Quick presets: Blue, Pink, Green, Orange, Purple
- Automatically saved to EEPROM
- FPS Slider → Image refresh rate (1-10 fps)
- NORMAL / FLIP 180 → Rotates image
- Resolution: VGA, SVGA, XGA
- Connect to WiFi ESP32-CAM-Monitor
- Arduino IDE → Tools → Port
- You'll see:
Monitor-CAM at 192.168.4.1← Select this! - Modify code and click Upload
- OTA Password:
12345678 - Serial Monitor shows progress
Watch Serial Monitor (115200 baud):
OTA Update Start - Type: sketch
OTA Progress: 15%
OTA Progress: 45%
OTA Progress: 98%
OTA Update Complete!
OLED shows real-time progress!
Problem: OTA doesn't appear in port list
Solutions:
- Verify WiFi connection
- Ping
192.168.4.1must respond - Restart ESP32 (disconnect power)
- Restart Arduino IDE
- Firewall: add exception for Arduino
For complete OTA guide: See AGGIORNAMENTO_OTA.txt
The interface is installable as a native app on smartphones!
Android:
- Open
192.168.4.1in Chrome - Menu → "Add to Home Screen"
- "CAM Monitor" icon on home
iOS:
- Open
192.168.4.1in Safari - Tap "Share" → "Add to Home Screen"
- "CAM Monitor" icon on home
Desktop:
- Chrome shows banner "Install CAM Monitor"
- Click "Install"
- App in standalone mode
In the .ino file:
const char* ssid = "MyCamMonitor"; // Change SSID
const char* password = "SecurePassword"; // Change Passwordconst char* ota_password = "Strong_OTA_Password";#define PAN_STEP 2 // Degrees per click (default 2.5°)
#define TILT_STEP 2 // Smaller = finer movementint savedHue = 340; // 210=Blue, 340=Pink, 120=Green, 30=Orange, 280=PurpleCauses:
- Insufficient power (needs 5V 2A)
- Damaged micro-USB cable
- FTDI programmer connected (disconnect it!)
Solution:
- Use external 5V 2A power supply
- Disconnect programmer after upload
- Verify red LED on ESP32-CAM is lit
Causes:
- Servos powered from ESP32 (NO! needs external power)
- Continuous rotation servos instead of positional
- GND not common
Solution:
- Power servos from external 5V supply
- Verify servos are positional (0-180°)
- Connect all GNDs together
Causes:
- Camera focus not adjusted
- Flash LED off
- Resolution too high
Solution:
- Rotate camera lens for focus
- Turn on flash LED and adjust brightness
- Reduce resolution to VGA/SVGA
Causes:
- Insufficient flash memory
- Unstable WiFi connection
- Firewall blocking port
Solution:
- Verify sketch < 50% memory (see compiler)
- Move device closer to PC/router
- Temporarily disable firewall
Complete guide: AGGIORNAMENTO_OTA.txt
Smart_Guardian_RobotCam/
│
├── Source_Code/
│ ├── Browser_Interface_HTML
│ └── ESP32_robot_cam
│ │ └── ESP32_robot_cam.ino # Main firmware
│ └── Update_By_OTA.txt # OTA update deep dive (Italian)
│
├── 3D_Print/
│ └── *.3mf # 3D printable servo mount
│
├── Wiring/
│ ├── Wiring.png # Wiring diagram
│
├── Images/
│ ├── Components # Hardware components images
│ ├── Robot_Cam # Hardware assembly photo
│ └── ...
│
├── Browser_Interface_Images/
│ ├── *.png # UI overview
│ └── ...
│
├── Video/
│ ├── *.mp4 # Demonstration video
│ └── ...
│
├── README.md # This file
└── LICENSE # MIT License
Contributions are welcome! Everyone can contribute to improve this project.
Whether you're fixing bugs, adding features, improving documentation, or sharing your customizations, your help is appreciated!
For major changes, please:
- Fork the repository
- Create feature branch (
git checkout -b feature/NewFeature) - Commit changes (
git commit -m 'Add NewFeature') - Push to branch (
git push origin feature/NewFeature) - Open Pull Request
- 🐛 Bug fixes and issue resolutions
- ✨ New features and enhancements
- 📚 Documentation improvements
- 🌍 Translations to other languages
- 🎨 UI/UX improvements
- 🔧 Hardware variations and alternatives
- 📊 Testing and quality assurance
All skill levels are welcome! Don't hesitate to open issues for questions or suggestions.
This project was developed using:
- Arduino IDE for ESP32 programming
- Claude Sonnet 4.5 by Anthropic for code assistance and optimization
- Git for version control
This project is released under MIT License.
MIT License
Copyright (c) 2025 [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Espressif Systems for ESP32 platform
- Adafruit for GFX and SSD1306 libraries
- Kevin Harrington for ESP32Servo library
- Anthropic for Claude Sonnet 4.5 AI assistant
- Arduino and ESP32 community for support
- Flash Memory Used: ~910KB (29%)
- RAM Used: ~52KB (16%)
- HTTP Endpoints: 16
- Lines of Code: ~850
- OTA Support: ✅ Yes
- PWA Ready: ✅ Yes
⭐ If you like this project, please give it a star on GitHub! ⭐
Made with ❤️ for parents and makers
Developed with assistance from Claude Sonnet 4.5 by Anthropic
Last updated: 2025-02-29
Version: 1.0.0
Compatibility: ESP32-CAM AI-Thinker with OV2640/OV3660



