{"id":20674766,"url":"https://github.com/jjateen/esp32-cam-security","last_synced_at":"2026-04-11T15:37:50.607Z","repository":{"id":181458855,"uuid":"666808343","full_name":"Jjateen/ESP32-CAM-Security","owner":"Jjateen","description":"The ESP32-CAM Security System (CamVisioTech MK0) is an IoT project that combines facial recognition with smart security features, such as solenoid lock control and real-time alerts via Telegram. Developed during IoT Workshop-1 (ECL 108) Task 4, it includes a custom desktop application for easy management.","archived":false,"fork":false,"pushed_at":"2024-12-30T11:22:20.000Z","size":1019,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T18:37:05.870Z","etag":null,"topics":["arduino","esp32","face-recognition","mediapipe","python","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jjateen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T16:38:10.000Z","updated_at":"2025-01-27T03:57:54.000Z","dependencies_parsed_at":"2024-11-01T07:24:04.892Z","dependency_job_id":"c8d151cb-f0ef-4016-9626-cf38ab06e2b9","html_url":"https://github.com/Jjateen/ESP32-CAM-Security","commit_stats":null,"previous_names":["jjateen/esp32-cam-security"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jjateen/ESP32-CAM-Security","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jjateen%2FESP32-CAM-Security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jjateen%2FESP32-CAM-Security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jjateen%2FESP32-CAM-Security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jjateen%2FESP32-CAM-Security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jjateen","download_url":"https://codeload.github.com/Jjateen/ESP32-CAM-Security/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jjateen%2FESP32-CAM-Security/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31686140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp32","face-recognition","mediapipe","python","tkinter"],"created_at":"2024-11-16T21:07:21.859Z","updated_at":"2026-04-11T15:37:50.584Z","avatar_url":"https://github.com/Jjateen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# ESP32-CAM Security System (CamVisioTech MK0)\n\n## Project Overview\n\nThis project implements a Face Recognition \u0026 Alerting System using the ESP32-CAM module, designed for Task 4 of the IoT Workshop-1 (ECL 108). The system utilizes facial recognition to control a solenoid lock, unlocking the door for 3 seconds when a known person is recognized. If an intruder is detected, the system sends an alert via Telegram and activates a buzzer. Additionally, the system offers a web-based interface for monitoring and control, and a custom desktop application built with Python, Tkinter, and CustomTkinter to manage both the facial recognition and alert system.\n\n---\n\n## Features\n\n- **Face Recognition:** Captures and processes images via the ESP32-CAM and compares them against pre-stored face encodings.\n- **Door Control:** Utilizes a solenoid lock controlled via a relay to lock/unlock the door based on successful face recognition.\n- **Intruder Alert System:** Sends the intruder’s image to the user’s Telegram account and sounds an alarm if an unauthorized face is detected.\n- **Web Interface:** Allows real-time streaming of video feed and control of the door lock and buzzer through a web-based interface.\n- **Python-based GUI:** Includes both a high-latency (old-school) and low-latency modern Python GUI for user-friendly system control.\n- **Hardware Enhancements:** Includes heat sinks to reduce heat generated by the ESP32-CAM module.\n\n---\n\n## Hardware Components\n\n- **ESP32-CAM Board**: Wi-Fi-enabled microcontroller with an integrated camera.\n- **Solenoid Lock (12V)**: Electronic lock controlled by a relay.\n- **Relay (5V, 10A)**: Controls the solenoid lock.\n- **IC-7805**: Voltage regulator that ensures a constant 5V power supply.\n- **Buzzer**: Provides an audible alert in case of an intruder detection.\n- **Additional Components**: \n  - Diode (1N4007)\n  - NPN Transistor (BC547)\n  - Resistors (330Ω)\n  - Capacitor (100μF)\n\n---\n\n## Software Requirements\n\n- **Arduino IDE**: For uploading code to the ESP32-CAM module.\n- **Python**: For running the GUI and integrating face recognition.\n  - Libraries: `opencv-python`, `face_recognition`, `requests`, `tkinter`, `customtkinter`, `numpy`, `Pillow`\n- **Telegram Bot**: For sending notifications in case of an intruder alert.\n\n---\n\n## Project Structure\n\n```bash\nESP32-CAM-Security/\n│\n├── ArduinoSketch/                # Folder for Arduino code\n│   ├── debug.cfg\n│   ├── debug_custom.json\n│   ├── esp32.svd\n│   └── finalCamProj.ino          # Main Arduino sketch controlling ESP32-CAM\n│\n├── tkinter_GUI.py                    # Old-school GUI with high latency\n├── ctkinter_GUI.py                     # Modern GUI with lower latency\n├── LICENSE                       # Project license\n├── README.md                     # Project documentation\n├── final_setup.jpeg              # Final project setup image\n├── ckt.png                       # Circuit diagram\n├── flowchart.png                 # Flowchart illustrating system process\n└── task4.pdf                     # Project report\n```\n\n---\n\n## Setup Instructions\n\n### 1. ESP32-CAM Setup\n\n1. **Install ESP32 Board Manager** in Arduino IDE:\n   - Go to **File \u003e Preferences** and add the URL:  \n     `https://dl.espressif.com/dl/package_esp32_index.json`\n   - Go to **Tools \u003e Board \u003e Board Manager** and install the ESP32 package.\n\n2. **Connections**:\n   - Connect the ESP32-CAM with a TTL programmer.\n   - Interface the **solenoid lock** with the relay module and connect the ESP32 GPIO to control it.\n   - Connect the **buzzer** to an ESP32 GPIO pin for intruder alerts.\n\n3. **Upload Code**:\n   - Use the provided `finalCamProj.ino` file located in the `ArduinoSketch/` directory.\n   - Set your Wi-Fi credentials in the code:  \n     ```cpp\n     const char* WIFI_SSID = \"your_ssid\";\n     const char* WIFI_PASS = \"your_password\";\n     ```\n\n4. **Access the Web Interface**:\n   - Once the ESP32-CAM is connected, visit `http://\u003cESP32_IP_ADDRESS\u003e/` to access the video feed and control panel.\n\n### 2. Python GUI Setup\n\n0. **Create a .env file refer [the .env template](./env_file_template.txt) for creating the environment variables.**\n\n1. **Install Python dependencies**:\n   ```bash\n   pip install opencv-python face_recognition requests pillow customtkinter numpy\n   ```\n\n2. **Configure the GUI**:\n   - Modify the `path` in the Python script to point to the folder containing known face images.\n   - Ensure your ESP32 IP address is correctly set in the GUI for interaction with the hardware.\n\n3. **Run the GUI**:\n   - Run `ctkinter_GUI.py ` or `tkinter_GUI.py` depending on your latency preference.\n   - The GUI will allow you to monitor the video feed and receive real-time notifications in case of intruder detection.\n\n---\n\n## Circuit Diagram\n\nHere is the circuit diagram showing the connections for the ESP32-CAM, solenoid lock, buzzer, and other components:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"ckt.png\" alt=\"Circuit Diagram\"\u003e\n\u003c/p\u003e\n\n---\n\n## Flowchart\n\nBelow is the flowchart that illustrates the system's working process:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"flowchart.png\" alt=\"Flowchart\"\u003e\n\u003c/p\u003e\n\n1. **Start**: The system begins by powering up the ESP32-CAM and initializing the network connection.\n2. **Image Capture**: The ESP32-CAM captures the user's face image.\n3. **Face Recognition**: The system compares the captured image with stored face encodings.\n4. **Match Found**:\n   - If a match is found, the solenoid lock is triggered to unlock the door for 3 seconds.\n5. **No Match**:\n   - If no match is found, the system identifies the person as an intruder and:\n     - Sends the intruder’s image via Telegram.\n     - Activates the buzzer for 1.5 seconds as an alert.\n6. **End**: The system returns to the start, ready for the next user.\n\n---\n\n## Final Setup\n\nBelow is the image of the final setup of the ESP32-CAM security system:\n\n![Final Setup](final_setup.jpeg)\n\n---\n\n## How It Works\n\n1. **Face Recognition**:\n   - The ESP32-CAM captures images at regular intervals and sends them to the server.\n   - The server compares the captured images with pre-stored face encodings to authenticate users.\n\n2. **Intruder Detection**:\n   - If a face does not match the stored faces, the system triggers an intruder alert.\n   - An image of the intruder is sent to the user’s Telegram account.\n   - The buzzer is activated for 1.5 seconds as a local alert.\n\n3. **Web Interface**:\n   - The web interface allows users to:\n     - View the real-time camera feed at different resolutions.\n     - Control the solenoid lock (unlock for 3 seconds).\n     - Trigger the buzzer manually if needed.\n\n---\n\n## Demo\n\n- [ESP32-CAM Security System (CamVisioTech MK0) Demo](https://www.instagram.com/p/CvfpnTPIu1L/)\n\n---\n\n## References\n\n1. ESP32-CAM Documentation: https://github.com/espressif/esp32-camera\n2. Solenoid Lock Guide: https://www.s4a-access.com/dc12v-magnetic-solenoid-lock-for-smart-storage-cabinet_p307.html\n3. Face Recognition: https://github.com/ageitgey/face_recognition\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nBy following the setup and usage instructions, you'll be able to deploy a fully functional security system using the ESP32-CAM with both face recognition and intruder alert capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjateen%2Fesp32-cam-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjateen%2Fesp32-cam-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjateen%2Fesp32-cam-security/lists"}