PowerWatch is an ESP8266 (Wemos D1 Mini) based power-restoration notifier.
When electricity returns, the device boots, connects to Wi-Fi and sends a Telegram notification.
At the same time RGB LEDs and two buzzers run a visible/audible alarm so you won't miss the power return. A hardware OFF switch lets you silence the alarm without unplugging the board.
- Sends a Telegram message when power is restored
- Dual active buzzers for loud audible alert
- RGB LED color effects for visual notification
- Automatic Wi-Fi connection with retry/backoff
- Hardware OFF switch to manually disable the alarm sequence
- Project files include Fritzing schematic and Gerber files
- Power returns → PowerWatch (Wemos D1 mini) powers on.
- The ESP8266 connects to the configured Wi-Fi network.
- Once connected, it sends a Telegram message to the configured bot/chat.
- Buzzers and RGB LEDs also start an alarm sequence to wake anyone nearby.
- Use the hardware OFF switch to stop the alarm signals after acknowledging.
This is handy if you’re away from home (get a Telegram ping) or sleeping (buzzers + LED wake you).
- Open
src/main.inoin Arduino IDE. - Board: Wemos D1 R2 & mini (select appropriate ESP8266 board).
- Install
ESP8266core and ensureESP8266WiFi.his available. - Edit configuration values (see Configuration below).
- Upload to the Wemos D1 mini.
- Plug the board into a stable USB power supply. On power return the device will act.
Open src/PowerWatch.ino and set your Wi-Fi and Telegram values:
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
String BOT_TOKEN = "YOUR_BOT_TOKEN";
String CHAT_ID = "YOUR_CHAT_ID";
String NOTIFY_MESSAGE = "⚡ Power is back!"; // set your custom messageGet a bot token (BOT_TOKEN):
- In Telegram open @BotFather.
- Send
/newbotand follow prompts to create a bot. - Copy the token BotFather returns (looks like
123456789:ABC...).
Get your chat id (CHAT_ID):
- For a private chat: start a conversation with a helper bot like @userinfobot or implement a simple
/starthandler in your bot to log thechat.id. - For a group: add your bot to the group and use a helper bot or read messages via the bot to get the group id (group IDs often start with
-100...).
| Qty | Part | Notes |
|---|---|---|
| 1 | Wemos D1 Mini (ESP8266) | main controller |
| 2 | Piezo speaker (active buzzer) | pins → D5, D8 |
| 1 | RGB LED (common cathode) | pins → D1 (R), D2 (G), D7 (B) |
| 3 | 220 Ω resistors | current limit for R/G/B |
| 1 | 330 kΩ resistor | pull-down for switch (per your Fritzing) |
| 1 | ss12d00g3 switch | OFF control |
Files included in hardware/:
scheme.fzz— original Fritzing sourcegerber/— Gerber export folder if you made a PCB
Fritzing scheme
Broadboard scheme
- Use common cathode RGB wiring if your RGB is common cathode (your Fritzing BOM says common cathode). Code uses inverted PWM (setColor uses
255 - rstyle). Verify LED type first. - Buzzers: use active buzzers (they take a DC signal and produce tone). If using passive piezos you’ll need
tone()support (your code usestone(); active buzzers may just need HIGH). Test on bench first. - D0 (GPIO16) may behave differently on ESP8266 regarding boot/pull-ups. Ensure your OFF switch wiring does not pull GPIO into a state that prevents boot. Consider
INPUT_PULLUPand wiring the switch to GND. - If Telegram messages fail, check SSL and that
client.setInsecure()is used (your sketch sets it) or add certificate checks as required.
- No Telegram message: check Wi-Fi creds, BOT_TOKEN and CHAT_ID; check board has internet access; open Serial Monitor for debug.
- ESP won’t boot after switch wiring: check switch wiring and pull resistors — make sure boot pins aren’t held in wrong state.
- RGB colors inverted / wrong: confirm RGB is common-cathode vs common-anode and adjust
setColor()accordingly.
Built during frequent power outages and blackouts in 🇺🇦
