Open Door Alert

mock Connecting…

Open on your phone

Front door

Door
closed
Open for
-
Phone alert
Idle

Buttons override the real sensor until it changes again. Tip: press D to toggle the door. Alert after open.

Your phone

  • ntfy
    Front door closed

    Front door was closed after being open for 46s.

    dry run (no NTFY_TOPIC)
  • ntfy
    Front door is open!

    Front door has been open for 30s.

    dry run (no NTFY_TOPIC)

Circuit

Wiring diagram GPIO17 goes through a reed switch to ground. GPIO27 goes through a 330 ohm resistor and a red LED to ground. Raspberry Pi 3 40-pin header (BCM) Pin 9 · GND Pin 11 · GPIO17 internal pull-up ↑3.3V Pin 13 · GPIO27 Pin 14 · GND Reed switch N S magnet (on door) 330 Ω + − Red LED GPIO17 (input) LOW · closed GPIO27 (output) LOW · LED off
Parts & wiring
PartFromTo
Magnetic reed switch (door frame) + magnet (door)Pin 11 · GPIO17Pin 9 · GND
330 Ω resistor → red 5 mm LED (long leg +)Pin 13 · GPIO27LED short leg → Pin 14 · GND

The internal pull-up holds GPIO17 HIGH. A closed door (magnet near) pulls it LOW. A broken wire reads as open, so the failure mode is safe. LED current ≈ (3.3 V − 2 V) / 330 Ω ≈ 4 mA.

Event log

  1. Front door closed after 1s, LED off
  2. Front door opened, LED on
  3. Phone alert dry-run: Front door closed
  4. Front door closed after 46s, LED off
  5. Phone alert dry-run: Front door is open!
  6. Front door opened, LED on
  7. NTFY_TOPIC not set, phone alerts run in dry-run mode
  8. Monitoring started, front door is closed