Skip to content

makerspacebonn/msb-door-lock-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSB Door Lock Sensor

ESP32-C3 Super Mini based door lock sensor using a reed switch. Reports lock state to Home Assistant via MQTT auto-discovery.

Hardware

  • ESP32-C3 Super Mini
  • Reed switch (N/O, normally open)
  • Magnet (mounted on lock bolt)

Wiring

ESP32-C3 Super Mini        Reed Switch
───────────────────       ──────────
GPIO3 ──────────────────── Pin 1
GND   ──────────────────── Pin 2

Internal pullup enabled — no external resistor needed.

Magnet Switch GPIO State
Present Closed LOW LOCKED
Absent Open HIGH UNLOCKED

Setup

  1. Install PlatformIO

  2. Copy the sample config and fill in your credentials:

    cp include/config.sample.h include/config.h
  3. Edit include/config.h with your WiFi and MQTT broker details

  4. Build and flash:

    pio run -t upload
  5. Monitor serial output:

    pio device monitor

The sensor registers itself in Home Assistant automatically via MQTT discovery.

Project Structure

├── platformio.ini          # PlatformIO config
├── src/
│   └── main.cpp            # Firmware: WiFi + MQTT + reed switch
├── include/
│   ├── config.sample.h     # Template config (tracked)
│   └── config.h            # Your config with credentials (gitignored)
├── RESEARCH.md             # Hardware research notes
└── BOM-ALIEXPRESS.md       # Bill of materials

Roadmap

  • Deep sleep with GPIO wakeup for battery operation
  • Battery voltage monitoring via ADC
  • OTA firmware updates
  • Multiple sensor support

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors