Monitor an older UPS status with a Raspberry Pi

Here is a small mod I made for an OPTI-UPS VS575C.

The ups has a serial port and works well with Windows, along with a serial to USB adapter and the Opti-UPS ‘Sentry’ software, the UPS can tell Windows when it has switched to battery mode on an AC power failure. This allows Windows to shut down properly if needed.Monitor an older UPS status with a Raspberry Pi

The Sentry software is not available for Linux and the serial data is non-standard and not easy to decipher. It’s not even supported by NUT (http://www.networkupstools.org)

So I decided to use the front LED’s on the device to ascertain the current state of the UPS, the green LED means the UPS is on AC mode, orange means battery mode.
I took the UPS apart and soldered two wires to the battery mode LED, fed these outside of the UPS and hooked them up to a Raspberry Pi’s GPIO port and ground.

Now when the AC power fails, the UPS sends 1.8v to the front LED and the Raspberry Pi reads a logic 1 on it’s GPIO pin (pin 5 set as an input).

This means I can monitor that pin with a BASH script, and have the script shutdown my NAS, and other networked devices all being powered by the UPS – over SSH.Monitor an older UPS status with a Raspberry Pi schematich

The example script I’ve made checks the GPIO pin every few seconds, and if it reads a “1” then the AC power is down, It then sends me a push notification to my iPhone using Prowl/Growl.  If the AC power remains off for longer than 30 seconds the script issues a shutdown command to my NAS drive.  The GPIO pin is then monitored again, until the power is restored, then it sends a WakeOnLan packet to the NAS to power it up again.

You’ll need to enable passwordless ssh logins to your own devices if you use this same method.

 

 

 

Source: Monitor an older UPS status with a Raspberry Pi


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *