UPS Beep Monitor
An open-source Rust daemon that listens for a UPS beep with a microphone and shuts the PC down safely during a long power outage.
- Role
- Solo developer
- Period
- 2026
- Status
- live
- Stack
- RustGitHub Actions
- crates, MIT/Apache-2.0
- 4
Problem
Many UPSs have no USB or serial cable, so the computer cannot know the power is out. They all beep while running on battery, though.
Approach
A Rust workspace in four crates. A Goertzel filter measures the energy at the beep frequency in 50 ms microphone blocks, a gate turns strong blocks into one event per beep, and an outage state machine powers the PC off after a configured time on battery, or cancels when the beeps stop. The decision logic lives in a crate with no audio or OS calls, so it is tested with synthetic audio and a virtual clock. It ships as a systemd user service with a CLI, an egui calibration window and a .deb built by GitHub Actions. It starts in dry-run mode so a false alarm cannot power the machine off.