A simple ESP32 project that sends an emergency alert message to a Telegram bot when a physical button is pressed three times in quick succession.
- Controller: ESP32
- Button: Standard tactile button
- Wiring: Connect one side of the button to GPIO 21 and the other side to GND. The code utilizes the built-in pull-up resistor.
-
Dependencies: Ensure the UniversalTelegramBot library is installed in your development environment.
-
Configuration: Open the main.ino file and update the following placeholders:
- YOUR_WIFI_SSID: Your Wi-Fi network name.
- YOUR_WIFI_PASSWORD: Your Wi-Fi network password.
- YOUR_TELEGRAM_BOT_TOKEN: The token provided by BotFather.
- YOUR_TELEGRAM_CHAT_ID: Your Telegram Chat ID.
-
Upload: Compile and upload the code to your ESP32 board.
- Debouncing: Includes a software debounce delay to ensure accurate detection.
- Rapid Input: Supports rapid clicking with 300ms intervals.
- Trigger: Sends an emergency message after 3 consecutive clicks and resets the counter.
- Safety: The system waits for the button release to prevent accidental repeat messages.
This project is open-source and released under the MIT License.