r/ArduinoProjects • • 20d ago

Showcased Project ESP32: one button, two jobs — tap rings, hold 1s resets (millis)

Same Wi-Fi doorbell hardware as before: one tactile button, one piezo, a page on any browser (phone, PC, or tablet) 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

  1. Debounce as usual (50 ms quiet window)

  2. On clean press, start a stopwatch

  3. Release before 1 s → tap / ding / ring++

  4. 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

3 Upvotes

0 comments sorted by