You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modular security system for a miniature house with multi-sensor detection, configurable alerts, and remote access.
3
+
A modular smart security system for a miniature house with multi-sensor detection, a web dashboard, Wi-Fi alerts, and physical siren control.
4
4
5
5
:::info
6
6
@@ -11,48 +11,31 @@ A modular security system for a miniature house with multi-sensor detection, con
11
11
12
12
## Description
13
13
14
-
This project is a modular security system for a miniature house, built on an STM32 development board and controlled through a companion app for remote access. The system can detect multiple types of security events: door opening, movement near the entrance, indoor motion, water leaks, and smoke detection. For each module, the user can independently choose the type of alert: a local sound alarm, a remote notification, or both. The system can be armed or disarmed remotely, and each security module can be turned on or off individually.
14
+
This project is a modular smart security system built for a miniature house. It uses an STM32 development board together with several sensors placed around the model: magnetic sensors for the front and back doors, PIR sensors for indoor motion detection, ultrasonic sensors for perimeter monitoring, water sensors for flood detection, and an MQ-2 sensor for gas/smoke detection.
15
+
16
+
The system is controlled through a web dashboard, where each sensor can be configured individually. The user can arm or disarm each module, choose between notification, loud alarm, or both, and mark a sensor as faulty if it does not behave correctly. Alerts from the STM32 are sent to the Node.js server through the ESP-01 Wi-Fi module. For reliable physical siren control, the server sends commands back to the STM32 through the board’s USB USER port.
15
17
16
18
## Motivation
17
19
18
-
The inspiration for this project came from my own house, which already has security systems in place for things like doors and flood detection. I wanted to recreate something similar in a miniature form, combining the sensors I find most useful in real life into one system that I could actually build and control myself. It was a good opportunity to understand how these kinds of systems work from the inside.
20
+
The inspiration for this project came from my own house, which already has security systems in place for things like doors and flood detection. I wanted to recreate something similar in a miniature form, combining the sensors I find most useful in real life into one system that I could actually build and control myself. It was a good opportunity to understand how these kinds of systems work from the inside.
19
21
20
22
## Architecture
21
23
22
-
The system is organized into four main components that work together to provide detection, decision-making, alerting, and remote control.
23
-
24
-
-**Sensor Layer:** This layer includes all the sensors used by the system: the magnetic door sensor, PIR motion sensor, ultrasonic sensor, water sensor, and smoke sensor. Each sensor is responsible for detecting a specific type of event and sending the corresponding signal to the microcontroller.
25
-
-**STM32 Controller:** The STM32 acts as the core of the system. It reads the sensor inputs, checks the current configuration of the system, and decides how to respond depending on whether the system is armed, which modules are active, and which alert type is selected.
26
-
-**Communication Module:** This module provides the connection between the STM32 and the companion application. It is used to send notifications and system status information, while also receiving commands related to arming, disarming, and module configuration.
27
-
-**Companion Application:** The application offers the user an interface for interacting with the system remotely. It allows arming or disarming the system, enabling or disabling individual modules, selecting the alert type for each module, and monitoring the current status of the system.
The system is organized into several components that work together for detection, communication, remote configuration, and physical alert control.
25
+
26
+
-**Sensor Layer:** This layer includes all the sensors installed on the miniature house: magnetic sensors for the front and back doors, PIR sensors for indoor motion detection, ultrasonic sensors for perimeter monitoring, water sensors for flood detection, and the MQ-2 gas/smoke sensor. Each sensor detects a specific type of event and sends its signal to the STM32 board through GPIO or ADC pins.
27
+
28
+
-**STM32 Controller:** The STM32 is the embedded core of the system. It reads all sensor inputs, detects state changes, handles local sensor logic, and sends alert messages when an event occurs. It also controls the physical LEDs and the siren output, but the final decision for when the siren should sound is received from the web application through the USB USER port.
29
+
30
+
-**ESP-01 Wi-Fi Module:** The ESP-01 module is used for communication from the STM32 to the Node.js server. When a sensor is triggered, the STM32 sends an alert message through UART to the ESP-01, which forwards it to the server. This path is used for sensor alerts and status updates.
31
+
32
+
-**Node.js Server:** The Node.js server receives alerts from the STM32, stores the current system state, applies the configuration selected by the user, and updates the web dashboard. It decides whether an event should be treated as a notification, a loud alarm, or both.
33
+
34
+
-**USB USER Command Channel:** The board's USB USER port is used as a direct command channel from the Node.js server back to the STM32. This is used for reliable physical siren control. When the web application decides that a loud alarm is needed, the server sends `SIREN_ON` through USB. When the alarm is cleared, it sends `SIREN_OFF`.
35
+
36
+
-**Web Dashboard:** The web dashboard is the user interface of the system. It allows the user to arm or disarm each sensor, choose the alert mode, mark faulty sensors, view notifications, clear alarms, and monitor the current state of the miniature house.
37
+
38
+

56
39
57
40
## Log
58
41
@@ -70,11 +53,33 @@ I started working on the physical structure of the project by building the minia
70
53
71
54

72
55
56
+
### Week 10-11
57
+
58
+
I tested all sensors together with the siren and status LEDs. At this stage, the siren was triggered by any active sensor, which helped me verify the basic detection logic. I organized the wiring, updated the schematic, and started integrating everything into the miniature house.
59
+
60
+
I also built the doors from hard plexiglass and attached them with small hinges so the magnetic door sensors could be tested more realistically.
61
+
62
+
### Week 12-13
63
+
64
+
I started working on the Wi-Fi communication using the ESP-01 module and its adapter. I also added a capacitor for better power stability. During this stage, I tested how alerts are sent from the STM32 to the Node.js server and worked on the first version of the web dashboard.
65
+
66
+
The dashboard was updated to display sensor alerts, event logs, notifications, and individual sensor settings.
67
+
68
+
### Week 14
69
+
70
+
I finalized the communication and alert system. Since sending the siren decision back through the ESP-01 was not reliable, I used the board’s USB USER port as a direct command channel from the Node.js server to the STM32. This allows the dashboard to turn the physical siren on or off depending on the selected alert mode.
71
+
72
+
I also finished the final dashboard design, added per-sensor options such as armed/disarmed, notification/loud/both, and faulty sensor marking, then tested the full system on the miniature house.
73
+
74
+

75
+
73
76
## Hardware
74
77
75
-
The system uses an STM32 development board as the main controller. It receives input from the sensors, processes the security logic, and controls both the local alert outputs and the wireless communication with the companion application.
78
+
The system uses an STM32 development board as the main controller. It receives input from all sensors, processes the local detection logic, controls the status LEDs and the physical siren output, and communicates with the web application through the ESP-01 Wi-Fi module and the board’s USB USER port.
79
+
80
+
The hardware setup includes multiple sensors, each covering a different security or safety scenario. Two magnetic sensors are used for the front and back doors, three PIR sensors are used for indoor motion detection, two ultrasonic sensors are used for perimeter monitoring, three water sensors are used for flood detection, and an MQ-2 sensor is used for gas/smoke detection. The system also includes visual feedback LEDs, a physical siren for loud alarms, and an ESP-01 module with an adapter for Wi-Fi communication.
76
81
77
-
The hardware setup includes multiple sensors, each covering a different security scenario: a magnetic sensor for door monitoring, a PIR sensor for indoor motion detection, an ultrasonic sensor for perimeter monitoring, a water sensor for flood detection, and a gas sensor for fire-related situations. For local feedback, the system will use an acoustic alert output and visual status indicators, while remote communication is handled through a Wi-Fi module.
82
+
The ESP-01 module sends alerts from the STM32 to the Node.js server, while the USB USER connection is used as a direct command channel from the server back to the STM32 for reliable siren control.
78
83
79
84
## Schematics
80
85
@@ -87,39 +92,44 @@ The hardware setup includes multiple sensors, each covering a different security
87
92
| STM32 Development Board | Main microcontroller | 120 RON |
0 commit comments