

Door open alarm
When a change is detected, the system transmits the event data through the local network to cloud services. The cloud then relays the information to a mobile application, alerting the property owner via a notification.
- Size
- 57.7 × 48.1 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 59
- Nets
- 64
- Pads
- 209
- Tracks, vias
- 486, 67
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 3 May 2024
- Updated
- 1 Jan 2026
Overview
Door open alarm is an open-source printed circuit board by dani9875, from the dani9875/door_alarm_system repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 57.7 × 48.1 mm with 59 parts on 64 nets, routed with 486 tracks and 67 vias.
It is built around the ESP32-S3-MINI-1-N8, AP2114HA-3.3TRG1 and CL21A106KOQNNNE, with the STPS140Z, CC0805KRX7R9BB104 and LTST-C190KRKT among its other parts. Its parts include 17 resistors, 8 capacitors, 6 diodes, 3 transistors and 3 switches. It belongs with the ESP32 boards of this library.
Main components
12ESP32-S3-MINI-1-N8
SMD-104.5dBm -40℃~+85℃ 2.4GHz 20.5dBm 330mA 3V~3.6V 97mA Bluetooth5.0 ESP32-S3FN8 Chip On-board PCB Antenna UART、SPI、I2C、I2S、USB SMD WiFi Modules ROHSEspressif SystemsWiFi ModulesAP2114HA-3.3TRG1
SOT-223-40℃~+85℃@(Ta) 1 1A 3.3V 30uVrms 65dB@(1kHz) 65uA 6V 750mV@(1A) Fixed Over Current Protection、Thermal Shutdown、使能控制 Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSDiodes IncorporatedVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsCL21A106KOQNNNE
080510uF 16V X5R ±10% 0805 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHSSamsung Electro-MechanicsMultilayer Ceramic Capacitors MLCC - SMD/SMTSTPS140Z
SOD-1231 Independent 1A 40V 40uA@40V 5.5A 550mV@1A SOD-123 Schottky Diodes ROHSSTMicroelectronicsSchottky DiodesCC0805KRX7R9BB104
0805100nF 50V X7R ±10% 0805 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHSYAGEOMultilayer Ceramic Capacitors MLCC - SMD/SMTLTST-C190KRKT
0603-30℃~+85℃ 130° 20mA 2V 62.5mW 631nm 639nm 99mcd Discrete Diode Red Water Clear 0603 LED Indication - Discrete ROHSLite-OnLED Indication - DiscreteTS-1088-AR02016
SMD,4x3mm-30℃~+80℃ 1.6N 100,000 cycles 12V 2mm 3.9mm 3mm 50mA Black Round Button SMD(SMT) Tab SPST Surface Mount,Vertical Without Bracket SMD,4x3mm Tactile Switches ROHSXUNPUTactile Switches0466.200NRHF
1206-55℃~+90℃ 0.00053 1.6mm 125V 125V 200mA 3.2mm 50A Surface Mount Fuse 1206 Disposable fuses ROHSLittelfuseDisposable Fuses0805W8F1003T5E (SMT业务专用)
0805100kΩ ±1% 0805 Chip Resistor - Surface Mount ROHSUNI-ROYALChip Resistor - Surface MountBSS138PW,115(ES)
SOT-323MOSFETsElecSuperDLW21SN900SQ2L
SMD-4P,2x1.2mm-40℃~+85℃ 10MΩ 125V 2 330mA 50V 90Ω@100MHz SMD-4P,2x1.2mm Common Mode Filters ROHSMurataCommon Mode FiltersIP4283CZ10-TBR,115-ES
DFN2510-10L-40℃~+125℃ 0.6pF 15V 1uA 4.5A@8/20us 5V 6V 70W@8/20us ESD Four channels IEC 61000-4-2、IEC 61000-4-5、IEC 61000-4-4 Unidirectional DFN2510-10L ESD and Surge Protection (TVS/ESD) ROHSElecSuperESD And Surge Protection (TVS/ESD)
README
README.mdDoor alarm system
This project is a DIY smart door alarm system designed to enhance property security by providing real-time monitoring and notifications. The system detects whether a door has been opened or closed and instantly reacts to these events.
When a change is detected, the system transmits the event data through the local network to cloud services. The cloud then relays the information to a mobile application, alerting the property owner via a notification. This ensures the owner is promptly informed whenever someone enters or leaves the property.
In case you are interested in making your own instance, please find the HW manufacturing files under the release tab.
How to build, flash and monitor the output the firmware
-
Check out the repository
-
Navigate to the
door_alarm_fwdirectory:bash cd door_alarm_fw -
(Once) Build the Docker image by executing the following script if you have not done yet:
bash ./docker_build.sh -
After the Docker image is successfully built, start the container using:
bash ./docker_start.sh -
Configure the followings in main.c manually before build:
c #define EXAMPLE_ESP_WIFI_SSID "AP" #define EXAMPLE_ESP_WIFI_PASS "password" #define EXAMPLE_STATIC_IP_ADDR "192.168.0.100" #define EXAMPLE_STATIC_GW_ADDR "192.168.0.1" #define EXAMPLE_STATIC_NETMASK_ADDR "255.255.255.0" #define HOST "us-east-1-1.aws.cloud2.influxdata.com" #define PATH "/api/v2/write?orgID=[org_id]&bucket=[bucket_name]&precision=ns" #define TOKEN "Token [INFLUX_DB TOKEN]" -
Inside the container, build the firmware by running:
bash ./build_firmware.sh -
To program the firmware onto the device, use:
bash ./burn_firmware.sh -
If you wish to observe the firmware's output, execute the monitoring script:
bash ./monitor_firmware.sh
Release notes
Version: v3.0
Changelog:
- Voltage divider resistor change
- Component library update
Version: v2.0
Changelog:
- Component library organised
- Fuse introduced
- IP4283CZ10-TBR,115 ESD diodes
Version: v1.0
Changelog:
- USB capability (does not work)
- USB active LED (erroneously glows even when operating from battery)
- Debug programming header
- Reed switch gate
- Debug LED
- Voltage sense
Technical solutions
The heart of the device is the reed sensor, which operates in normally open mode (the circuit remains open when the magnet and the reed sensor are aligned). This design choice minimizes power consumption, as no current is drawn when the door is closed. The system remains in deep sleep mode most of the time and can only be interrupted by an interaction, such as opening or closing the door. When the system wakes up, it checks the battery charge level and the door status, then initializes the WiFi connection to transmit this data to the cloud.
A time-series data platform, Influx, is used to collect the data, and the data is forwarded to Grafana for visualization. You can find the grafana_door_alarm_system.json file in the docs, which you can import to create a dashboard for monitoring the door status and battery level. Make sure to set the source ID (UID) to ensure proper functionality.
If you would like to receive notifications about state changes, I recommend visiting IFTTT. You can trigger events and subscribe to them. The ideal solution is to create a webhook that can be triggered from the ESP32 when it wakes up. However, this is a PRO feature. If you want to stay within the free tier, you can create a Google Sheet, set it as a trigger, and add a row (GDrive API is enabled). When a row is added, the subscriber can receive a WhatsApp message (note that with the free plan, the message may be delayed up to 1 hour).
V2
After the component placement, I realized that the voltage measurement enable pin pad came off, so I rewired it to the LED enable pin. As a result, every time I measure the battery level, the LED briefly lights up. I also didn't have a fuse in my inventory, so I bypassed it with a direct connection. Since USB communication was functioning properly, I decided not to add the H1 straight header pins.
How to check if the USB interface is working properly:
Run lsusb and look for a device called Espressif USB JTAG/serial debug unit
root@c7cc3ff0b21c:/project# lsusb
Bus 004 Device 001: ID 1d6b:0003
Bus 003 Device 003: ID 046d:c52b Logitech USB Receiver
Bus 003 Device 002: ID 13d3:54b1 Azurewave Integrated Camera
Bus 003 Device 021: ID 303a:1001 Espressif USB JTAG/serial debug unit
Bus 003 Device 004: ID 0bda:c123 Realtek Bluetooth Radio
Bus 003 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 001: ID 1d6b:0002 A short code snippet (main.c, app_main()) that allows you to check if the general LED blinks:
const uint8_t led_en = GPIO_NUM_14;
void app_main(void)
{
gpio_reset_pin(led_en);
gpio_set_direction(led_en, GPIO_MODE_OUTPUT);
while(1)
{
gpio_set_level(led_en, 1);
vTaskDelay(pdMS_TO_TICKS(1000));
gpio_set_level(led_en, 0);
vTaskDelay(pdMS_TO_TICKS(1000));
}
return;
}In a short test, I approached the reed sensor with the magnet, which triggered a wake-up event (the LED lights up). While I held the magnet in place, nothing further happened, and the device went back to sleep. As soon as I removed the magnet, the LED flashed again, indicating that the system had woken up, similar to how it would behave if the door were opened.

Although I did not have a proper casing the setup was mounted above the entrance to collect data and analyze power consumption. Data was being monitored in Grafana.
V1
The first version was revised because the USB interface did not work at all, and it wasn’t even impedance-controlled. As a result, it had to be programmed via the UART interface using a USB-to-TTL adapter.

Consumption calculations
Power usage estimates assume the application wakes up 6 times a day (3 times for door opening and 3 times for door closing), and the system is powered by 4 AA batteries with average capacity.
| Component | Current (µA) | Time (s) | Energy Contribution (µA·s) | Comment |
|---|---|---|---|---|
| AP2114HA-3.3TRG1 | 60 | 86400 | 60*86400 = 5184000 | LDO operates at all times. |
| ESP32 awake doing its job | 300000 | 60 | 300000*60 = 18000000 | Wake-up duration is approximately 10 seconds. |
| Battery measurement | 240 | 60 | 240*60 = 14400 | V_SENSE divider: ~ (6 V / 25000 Ω) = 240 µA, active only during wake-up periods. |
| Reed switch closed (door open) | 330 | 45 | 330*45 = 14850 | The door is left open for a maximum of 15 seconds, and this state occurs during half of all activities. |
| ESP32 deep sleep mode | 8 | 86340 | 8*86340 = 690720 | ESP32 consumes minimal power during deep sleep. |
Total Energy Contribution (µA·s):
$$ 5184000 + 18000000 + 14400 + 14850 + 690720 = 23903970 \ \text{µAs} $$
Average Current per day (µA):
$$ \text{Average Current} = \frac{23903970}{86400} \approx 276 \ \text{µA} $$
Assumptions:
4 AA batteries in series: Each AA battery provides 1.5V, and the combined voltage will be 6V. Capacity of AA batteries: We'll assume 2000 mAh for typical alkaline AA batteries. Average current consumption: 276 µA (0.276 mA).
Battery life in hours can be calculated by dividing the total battery capacity by the current draw:
$$ \text{Battery Life (hours)} = \frac{\text{Battery Capacity (mAh)}}{\text{Current Consumption (mA)}} $$
For 2000 mAh batteries and 0.276 mA current:
$$ \text{Battery Life (hours)} = \frac{2000}{0.276} \approx 7246 , \text{hours} $$
Convert this to days:
$$ \text{Battery Life (days)} = \frac{7246}{24} \approx 302 , \text{days} $$
Calculation here is not final since batteries are not drained to 0 V. Will be added after some testing. LDO shall be fed at least from 4V.
Limitations/what could be improved
- HW routing is not ideal
- Local wifi credentials and static IP as well as INFLUX_DB credentials must be compiled into the project and must be set from source code
- Consumptions increase when the door is open (around 400-500 uA)
- HW and FW project is tightly-coupled making versioning obscure
- Voltage divider resistors are mixed up
- Creation of a elegant enclosure is lacked
- Some FW clean-up
Parts
59| Qty | Value | Footprint | References |
|---|---|---|---|
| 8 | 0805W8F1002T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R1, R2, R5, R7, R9, R10, R12, R15 |
| 3 | 0805W8F5101T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R3, R4, R14 |
| 3 | C0805C105M4VACTU | pepy_sym_lib:[CAP_SMD_0805_2012Metric] | C4, C5, C6 |
| 3 | CL21A106KOQNNNE | pepy_sym_lib:[CAP_SMD_0805_2012Metric] | C1, C3, C7 |
| 3 | Fiducial | Fiducial:Fiducial_0.5mm_Mask1mm | FID1, FID2, FID3 |
| 3 | STPS140Z | pepy_sym_lib:[SCHOTTKY_DIODE_40V]STMicroelectronics STPS140Z | D1, D2, D4 |
| 2 | 0805W8F4700T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R16, R17 |
| 2 | CC0805KRX7R9BB104 | pepy_sym_lib:[CAP_SMD_0805_2012Metric] | C2, C8 |
| 2 | CJ2301 S1 | pepy_sym_lib:[PMOS]Jiangsu Changjing Electronics Technology Co., Ltd. CJ2301 S1 | Q2, Q3 |
| 2 | GND | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP4, TP6 |
| 2 | LTST-C190KRKT | pepy_sym_lib:[LED]Lite-On LTST-C190KRKT | D5, D6 |
| 2 | TS-1088-AR02016 | pepy_sym_lib:[TACTILE_SWITCH]XUNPU TS-1088-AR02016 | S2, S3 |
| 2 | ~ | pepy_sym_lib:[MOUNTING_HOLE]MountingHole_2.2mm_M2_DIN965_Pad | MH1, MH2 |
| 1 | 0466.200NRHF | pepy_sym_lib:[FUSE_SMD_1206] | F1 |
| 1 | 0805W8F1001T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R8 |
| 1 | 0805W8F1003T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R11 |
| 1 | 0805W8F1004T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R6 |
| 1 | 0805W8J0203T5E | pepy_sym_lib:[RES_SMD_0805_2012Metric] | R13 |
| 1 | 3.3V | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP5 |
| 1 | AP2114HA-3.3TRG1 | pepy_sym_lib:[LDO]Diodes Incorporated AP2114HA-3.3TRG1 | U1 |
| 1 | BOOT0 | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP11 |
| 1 | BSS138PW,115 | pepy_sym_lib:[NMOS]Nexperia BSS138PW,115 | Q1 |
| 1 | DLW21SN900SQ2L | pepy_sym_lib:[COMMON_MODE_FILTER]Murata Electronics DLW21SN900SQ2L | L1 |
| 1 | EN | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP8 |
| 1 | ESP32-S3-MINI-1 | pepy_sym_lib:[MCU]Espressif Systems ESP32-S3-MINI-1-N8 | U2 |
| 1 | ESP_RESET | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP7 |
| 1 | GND | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_2.0x2.0mm | TP3 |
| 1 | IP4283CZ10-TBR,115 | pepy_sym_lib:[ESD_PROT]Nexperia IP4283CZ10-TBR,115 | D3 |
| 1 | PZ254V-11-06P | pepy_sym_lib:[6P_HEADER_STR]XFCN PZ254V-11-06P | H1 |
| 1 | REED | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP9 |
| 1 | SS-12D10L5 | pepy_sym_lib:[SLIDE_SWITCH]XKB Connection SS-12D10L5 | S1 |
| 1 | TYPE-C 16PIN 2MD(073) | pepy_sym_lib:[USB_C_16P_RA_FEMALE]SHOU HAN TYPE-C 16PIN 2MD(073) | J1 |
| 1 | VBUS | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP1 |
| 1 | VCC | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_2.0x2.0mm | TP2 |
| 1 | V_SENSE | pepy_sym_lib:[TEST_POINT]TestPoint_Pad_D1.0mm | TP10 |
Similar boards
- 2 layers168.5 × 29.6 mm

- 4 layers83 × 67.5 mm

MarineBoard
Cadburies/SisuAssistant
Sailing yacht Sisu: Home Assistant + ESPHome Marine Board (alternator regulation, tanks) + MQTT kernel, Signal K/Grafana/InfluxDB on a NAS, and Sisu Nav chart & weather-routing cockpit.
162 parts1Apache-2.0 - 2 layers69.7 × 40 mm

5v to bipolar15v PSU
tommassey/5v_to_bipolar15v_PSU
Small SMPS to provide ~200mA of +15v/-15v from a single 5v-12v DC supply
59 parts2 - 4 layers58.9 × 41.1 mm

- 2 layers62.8 × 30.3 mm

- 4 layers243.8 × 171.5 mm

- 4 layers243.8 × 245.5 mm

Neotron Common Hardware
Neotron-Compute/Neotron-Common-Hardware
Contains KiCad footprints and symbols shared across multiple Neotron projects.
287 parts4CC-BY-SA-4.0 - 2 layers100 × 100 mm

Questions
How big is the Door open alarm PCB?
It measures 57.7 × 48.1 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Door open alarm use?
59 parts, built around the ESP32-S3-MINI-1-N8, AP2114HA-3.3TRG1, CL21A106KOQNNNE and STPS140Z. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Door open alarm KiCad files?
From the dani9875/door_alarm_system repository on GitHub, at the commit this page was made from: the board is door_alarm_hw/door_open_alarm.kicad_pcb and its schematic door_alarm_hw/door_open_alarm.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Door open alarm design in my own project?
Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).