Ryan Susman's NodeMCU-Powered Battery Monitor Tracks UPS Status and Fires Off Twilio SMS Alerts
If the onboard monitoring of a UPS doesn't do what you need, throwing a NodeMCU into the mix could help — if you're careful.
Software developer Ryan Susman has designed a quality-of-life upgrade for APC uninterruptible power supplies — adding Twilio-powered battery monitoring with immediate alerts to your mobile device over SMS messages and longer-term tracking via MongoDB.
"The Arduino Battery Backup Monitor is a sophisticated system designed to monitor the health of several battery backups in a house and upload the status to MongoDB Cloud," Susman writes of his project. "It leverages a NodeMCU microcontroller in conjunction with a [Texas Instruments] ADS1115 Analog-to-Digital Converter for accurate voltage measurements. The system is versatile and scalable, with configurations that can be customized for different deployment scenarios."
The hardware upgrade triggers, Susman explains, within five seconds of the battery beginning to discharge, though the SMS-based live alerts — driven through the Twilio cloud SMS platform, meaning the project doesn't require a cellular modem — can also be configured for other warning states including an unexpected increase in current draw or low battery charge levels.
The Arduino-based firmware running on the NodeMCU — a low-cost Wi-Fi-equipped development board built around Espressif's ESP8266 microcontroller — handles tracking the battery's status via a TI ADS1115 analog-to-digital converter (ADC). A built-in health analysis takes the current draw and calculates the remaining runtime, while data gathered are uploaded to MongoDB Cloud for long-term tracking and later analysis.
Integrating the microcontroller and ADC with the UPS itself, though, isn't necessarily for the faint of heart: rather than interfacing with the UPS' built-in monitoring system, Susman's approach adds entirely new hardware directly to the battery itself via a shunt resistor — resulting in at least one blown fuse and power outage during the project's development, which given the voltages and current at play inside a UPS is maybe the least-worst outcome of incautious experimentation.
A full video walking through the project is available on Susman's YouTube channel; the project source code and a circuit diagram are available on GitHub under the permissive Apache 2.0 license.
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.