Same Wi-Fi doorbell hardware as before: one tactile button, one piezo, a page on any browser on the LAN.
New idea: time how long a clean (debounced) press lasts with millis(). Let go before 1 second = tap (ring). Still holding at 1 second = hold (reset count to 0).
Hardware
- ESP32 DevKit (30-pin)
- 6 mm tactile push button
- Passive piezo buzzer
- 4 jumpers + breadboard
Wiring
- GPIO33 → button → GND (INPUT_PULLUP)
- GPIO25 → piezo → GND
How it works
Debounce as usual (50 ms quiet window)
On clean press, start a stopwatch
Release before 1 s → tap / ding / ring++
Still down at 1 s → hold fires immediately, count resets
Happy to share the sketch if useful. Short walkthrough: https://www.youtube.com/shorts/bzs_N4e8Wxw