Skip to the content
PCBKitNew board
4 layers20 × 61.5 mmBle door sensor, the printed circuit board in 3D

A simple project to observe a window or door is open/closed. It works like most other sensors as well. A magnet has to get attached to the door and if it comes near the board, it is detected and the state of the window…

Size
20 × 61.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
41
Nets
49
Pads
161
Tracks, vias
321, 71
Pours
3
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
1 Dec 2023
Updated
29 Aug 2026

Overview

Ble door sensor is an open-source printed circuit board by gumulka, from the gumulka/ble_door_sensor repository on GitHub, published under the Apache-2.0 licence. It is a 4-layer board of 20 × 61.5 mm with 41 parts on 49 nets, routed with 321 tracks and 71 vias.

It is built around the NRF52832-QFAA-R, SHTC3-TR-10KS and TMP100NA/3K, with the ALS-PT19-315C/L177/TR8, MLZ1608E100MT000 and LQW15AN15NH00D among its other parts. Its parts include 13 capacitors, 7 resistors, 3 ICs, 3 inductors and 2 connectors. It belongs with the sensors and measurement and radio and wireless boards and the nRF52 and nRF5x boards of this library.

Main components

11

README

README.md

Bluetooth Window/Door Sensor

A simple project to observe a window or door is open/closed. It works like most other sensors as well. A magnet has to get attached to the door and if it comes near the board, it is detected and the state of the window or door is updated.

How to build

If you are new to Zephyr, read the Getting Started Guide. Afterwards you can clone and build this project with:

bash
west init -m https://github.com/gumulka/ble_door_sensor --mr main door_sensor
cd door_sensor
west update
cd ble_door_sensor

Bootloader

The bootloader will load and verify the image that is executed. To make it easier to upgrade the device, two images are saved on the device and only one is being executed, while the other is a standby for updating. The bootloader cannot be upgraded via ble, but the image can be. Therefore making it possible to upgrade devices in the field.

If you have a unprogrammed device, use this to build and flash the bootloader:

bash
west build -p -b ble_door_sensor -d build_mcuboot ../bootloader/mcuboot/boot/zephyr/ -- -DCONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
west flash -d build_mcuboot

Application

The application is different from the bootloader and is what is in need of updates/upgrades.

bash
west build -p -b ble_door_sensor app
west flash

It is also possible to build the application with debug output for the UART on the backside of the board. This is disabled by default as it has a significant influence on battery.

bash
west build -p -b ble_door_sensor app -- -DEXTRA_CONF_FILE=="debug.conf"

Energy sensor

When I wanted to integrate energy consumption into home assistant without having to order new hardware, I soldered two resistors to the board and converted it into an energy monitor. A 1M Ohm between VCC and AIN0 and 22k Ohm between AIN0 and GND. This can be configured with:

bash
west build -p -b ble_door_sensor app -- -DEXTRA_DTC_OVERLAY_FILE=="energy-tracker.dtsi"

Update via BLE

If you have an already running device and just want to upgrade to the latest firmware.

Either with the nRF Connect App, which can be quite handy, or in the commandline use these steps:

bash
sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Sensor' image upload build/zephyr/zephyr.signed.bin
sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Sensor' image list

Use the second hash provided from the second command to alter the following:

bash
sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Sensor' image test "HASH_FROM_OUTPUT"
sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Sensor' reset
# wait for the system to restart and if you are sure, that the update was successful then
sudo mcumgr  --conntype ble --connstring ctlr_name=hci0,peer_name='Sensor' image confirm "HASH_FROM_OUTPUT"

More information about the general procedure can be found here and here

[!TIP] I have seen a few errors when trying to upload the image and found that it works best, if I cancel the upload command after a few seconds and restart it a few seconds later, basically splitting the upload into 4-5 chunks instead of uploading it as a whole.

Parts

41
QtyValueFootprintReferences
5100nFCapacitor_SMD:C_0402_1005MetricC1, C3, C11, C101, C107
4100kResistor_SMD:R_0402_1005MetricR1, R101, R104, R105
3ToolingHoleg-Misc:JLCPCB_Mounting_holeT1, T2, T3
2100pFCapacitor_SMD:C_0402_1005MetricC7, C9
212pFCapacitor_SMD:C_0402_1005MetricC6, C8
21KResistor_SMD:R_0402_1005MetricR3, R102
2MountingHoleMountingHole:MountingHole_2.2mm_M2H101, H102
110nFCapacitor_SMD:C_0402_1005MetricC13
110uHInductor_SMD:L_0603_1608MetricL102
115nHInductor_SMD:L_0402_1005MetricL101
11MResistor_SMD:R_0402_1005MetricR2
11pFCapacitor_SMD:C_0402_1005MetricC4
11uFCapacitor_SMD:C_0603_1608MetricC5
13.3nHInductor_SMD:L_0402_1005MetricL1
13034Battery:BatteryHolder_Keystone_3034_1x20mmBT1
14.7uFCapacitor_SMD:C_0603_1608MetricC2
1ALS-PT19LED_SMD:LED_0603_1608MetricQ1
1Antenna_ShieldRF_Antenna:Texas_SWRA117D_2.4GHz_RightAE1
1Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical_SMD_Pin1LeftJ101
1Crystal_GND24Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1LEDLED_SMD:LED_0603_1608MetricD101
1Prog HeaderConnector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_VerticalJ1
1SHTC3Sensor_Humidity:Sensirion_DFN-4-1EP_2x2mm_P1mm_EP0.7x1.6mmU2
1SW_PushButton_Switch_SMD:SW_SPST_TL3342SW102
1SW_Reedg-Sensors:reed_contactSW101
1TMP100Package_TO_SOT_SMD:SOT-23-6U101
1nRF52832-QFxxPackage_DFN_QFN:QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mmU1

The 40 most common of 41 parts.

Questions

How big is the Ble door sensor PCB?

It measures 20 × 61.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Ble door sensor use?

41 parts, built around the NRF52832-QFAA-R, SHTC3-TR-10KS, TMP100NA/3K and ALS-PT19-315C/L177/TR8. 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 Ble door sensor KiCad files?

From the gumulka/ble_door_sensor repository on GitHub, at the commit this page was made from: the board is kicad/ble_door_sensor.kicad_pcb and its schematic kicad/ble_door_sensor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Ble door sensor 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).

Similar boards

  • 4 layers78 × 36 mmNametag, the printed circuit board in 3D

    Nametag

    gumulka/nametag

    A simle project to show my name on an e-Paper

    71 parts
  • 4 layers23.2 × 43 mmSentinel, the printed circuit board in 3D

    Sentinel

    nrwiersma/sentinel

    Presence detection

    69 partsMIT
  • 6 layers57 × 25.9 mmR7FS7MOD, the printed circuit board in 3D

    R7FS7MOD

    Brazil-L/Lumeward-OpenSource

    Open-source Lumeward firmware and development tools

    228 parts2Apache-2.0
  • 4 layers100 × 52 mmSom exp carrier, the printed circuit board in 3D

    Som exp carrier

    andrempmattos/procsys-testsuite

    Processing Systems Test Suite

    106 parts1
  • 10 layers177.8 × 141 mmProc101d, the printed circuit board in 3D

    Proc101d

    gingerologist/am64x

    This project starts from proc101d (TMDS64EVM).

    798 parts
  • 4 layers115.6 × 95.9 mmSilverSat Comms, the printed circuit board in 3D

    SilverSat Comms

    silver-sat/Radio_Board

    This is the repository for the SilverSat Radio hardware design using KiCad 6.0.

    180 parts
  • 4 layers65 × 56 mmFiga pi, the printed circuit board in 3D

    Figa pi

    genrnd/figa-pi.hw

    1G Ethernet FPGA HAT for Raspberry PI

    159 parts2