This is an old revision of the document!


ESP 32 Security system to detect movement and capture picture

  • Author: Felicia Saghin
  • Email: felicia.saghin@stud.acs.pub.ro
  • Master: SRIC

Introduction

In today’s connected world, real-time security monitoring at home or in small offices has become both practical and affordable. This project delivers a lightweight IoT door-security solution by combining an ESP32-CAM module with a Hall-effect sensor. Whenever the door opens, the sensor immediately signals the ESP32-CAM to capture a high-resolution image. That image is then uploaded to Firebase Storage, and its publicly accessible URL is written to Firebase Realtime Database. Simultaneously, Twilio’s API is invoked to send an SMS to your smartphone. Finally, a web gallery hosted on Firebase displays the latest snapshot instantly, giving you secure and remote visibility of every entry event.

Context

Diagram diagrama_feli In many homes and small offices, it’s hard to know in real time if someone has opened a door while you’re away. Traditional locks only log locally or require you to check in person. This project closes that gap by combining a Hall-effect sensor, an ESP32-CAM, cloud storage and instant SMS alerts.

Key features: - Instant detection of door opening via a Hall-effect sensor mounted on the door frame - Automated photo capture by ESP32-CAM when the sensor toggles - Cloud storage of each snapshot in Firebase Storage - Real-time SMS notifications via Twilio with a link to the gallery - Live web monitoring through a Firebase-hosted photo gallery

When the door swings open, the Hall sensor’s output changes state. The ESP32-CAM immediately takes a JPEG, uploads it to Firebase Storage, and writes it into Realtime Database. A Twilio API call then sends you an SMS alert containing the gallery URL. Meanwhile, your web app—hosted on Firebase Hosting and listening to the database—updates instantly to show the new image.

Hardware

Hardware Components

  • ESP32-CAM (OV2640 camera module)
  • Hall-effect sensor (A3144)
  • Permanent magnet
  • 5 V USB power supply (or power bank)
  • ESP32-CAM-MB shield
  • Jumper wires & mounting tape/screws

Hardware Circuit

Connecting Components

Hall-effect Sensor (A3144) Mounted on the door frame. Detects the magnet fixed to the door as it swings past: output goes LOW when the magnet is within 5–10 mm (door closed), and HIGH when it moves away (door open).

  • VCC → ESP32-CAM 3V3
  • GND → ESP32-CAM GND
  • OUT → ESP32-CAM GPIO13 (`INPUT_PULLUP`)

ESP32-CAM Module Handles image capture, Firebase upload, and Twilio notifications.

  • Power → VIN pin → +5 V from your battery pack (e.g. USB power-bank or Li-Po + boost converter)
  • Ground → GND → battery pack GND
  • (If you’re using the ESP32-CAM-MB shield instead of wiring VIN/GND, just plug your battery’s USB cable into its micro-USB port.)*

USB-Serial Adapter *(only if not using the on-board USB shield)* Required to flash code to the ESP32-CAM.

  • Adapter TX → ESP32-CAM U0R0 (GPIO3)
  • Adapter RX → ESP32-CAM U0T0 (GPIO1)
  • Adapter +5 V → ESP32-CAM VIN
  • Adapter GND → ESP32-CAM GND

Permanent Magnet Mounted on the door so its north pole passes within 5–10 mm of the Hall sensor when the door is closed. No wiring required.

Software

Code Snippets

Challenges

References

iothings/proiecte/2025sric/security-system-to_detect-movement-and-capture-image.1748499032.txt.gz · Last modified: 2025/05/29 09:10 by felicia.saghin
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0