ASHIM DAS
- Published on
02/07/2025, 12:09 pm Loading...
π‘οΈ Sense-25: A Realtime IoT Security System Built with ESP32, React, Express and MQTT
π Overview
Sense-25 is a real-time security and intrusion detection system designed to provide reliable zone-based monitoring using digital output sensors, a secure password-protected arming system, and real-time event logs β all built from scratch with open technologies.
This project combines the power of ESP32, React, MQTT, WebSockets, and Node.js to create a fast, secure, and fully customizable home or lab security setup.
π¬ Demo Video
Watch video Check it's live π iot-security-system-1.onrender.com
π System Workflow
-
Configure Sensors & Zones
- Enable required Zones and configure name and description.
- There are 17 digital sensor input available (can be scaled up).
-
Arming the System
- You enter a password on device or click Arm on dashboard.
- The system becomes "armed", meaning all active zones are now monitored.
-
Sensor Gets Triggered
- A digital output sensor (e.g., PIR or door switch) detects activity.
- It sends a signal to the ESP32, which publishes a secure MQTT message.
-
Message Received
- A Node.js server subscribed to the MQTT topic receives the alert.
- It forwards the data to the frontend via WebSocket.
-
Live Dashboard Update
- The React dashboard instantly highlights the triggered zone.
- The event is logged with a timestamp and marked as "Unresolved".
-
Manual Resolution
- An admin can mark the event as "Resolved" with a note.
- The log updates with the resolution details and time.
-
Disarming the System
- Entering the password again switches the system to "Disarmed" mode.
- Sensor triggers are ignored until re-armed.
-
Monitoring All Events Logs
- Dashboard shows realtime logs.
- Logs are saved in server, can be exported to excel sheet.
π§ Core Concepts
- Digital Output Sensors β Send simple ON/OFF signals (motion, door open, etc.)
- ESP32 Microcontroller β Reads sensors and sends data securely over MQTT
- MQTT (TLS Secured) β Lightweight protocol for sending messages
- WebSocket (HTTPS Secured) β Enables real-time updates to clients
- Password-Based Arming β Prevents unauthorized use
- Persistent Logs β Stored locally using
node-persist
for offline recovery
π§© System Architecture
The system consists of the following components:
- ESP32 Microcontroller: Interfaces with digital output sensors
- MQTT over TLS: Used for secure, lightweight messaging
- Node.js + Express Server: Receives MQTT messages and communicates via WebSocket
- React Frontend: Live dashboard for zone control and log resolution
- Local Persistent Storage: All logs are stored using
node-persist
Note: For now anyone with the URL can access the dashboard! I know it's a security issue and I can fix it, this is a small prototype system so don't take it seriously.
π§ͺ Technology Stack
- Microcontroller: ESP32 using the Arduino SDK
- Sensor Input: Digital Output Sensors like PIR and reed switches
- Messaging Protocol: MQTT over TLS for secure, lightweight pub/sub communication
- Backend Server: Node.js with Express.js for handling API and WebSocket communication
- Frontend UI: React with WebSocket for live updates
- Data Persistence: node-persist for local key-value storage
π Final Thoughts
Sense-25 is a online IoT security solution built with open technologies and no dependency on expensive cloud services or proprietary platforms. It has real world use cases but for now it is to showcase my works and skills.
π¬ Share Your Thoughts..
Want to replicate or expand this project?
- Comment or DM me for the source code or architecture guide
- Any ideaπ‘?? Let's connect and discuss.