All packs

Home

Door sensor

Beeps when a door or drawer opens and sends a notification to your phone.

  • Easy
  • about 35 min
  • ESP32-C3
  • 6 parts
  • 4 wires
  • 61 lines of code
  • Uses Wi-Fi

ESP32 packs are built on real parts: the simulator runs Arduino Uno circuits only.

Idea

The switch has no electronics in it: a magnet pulls two thin metal strips together inside a glass tube. The notification goes through ntfy, a free service with no account.

Before you start

Anyone who knows your ntfy topic name can read its messages. Choose a long name nobody could guess, and do not rely on this as a burglar alarm.

What you learn

Detecting a change (opened, closed) and sending a message to a phone over HTTPS.

How it works

  1. input

    Door switch

  2. decides

    ESP32-C3 · Wi-Fi

  3. output

    Buzzer

    Notification on your phone

Powered with 5 V through the board's USB-C port.

It joins your home Wi-Fi. You type the network name and password into the sketch before uploading; they stay on the board.

A reference design. The sketch is compiled with the real ESP32 toolchain, and its pins are checked against the wiring table automatically. It has not yet been built and tested on real parts by us, so wire it on the bench and run the checks before you build it into a case. Real modules vary: follow the labels printed on yours, not their position in the picture.