loading
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.

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.

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.

SCRIPT
<p>This is so cool! I've been researching how to do this (except I was thinking of using the piezo buzzer not the LED).</p><p>I even asked whether it was a good idea to do so on electronics.stackechange.com. Most people seem dead-set against it. (http://electronics.stackexchange.com/questions/254820/using-ups-buzzer-as-a-method-of-determining-ac-power)</p>
Thanks for the comment. This is a simple solution.
<p>Hi, es possible to use these device for repalce my disck drive from and old Apple II ?</p>
You will of course need to install &quot;wiringPi&quot; to use the gpio commands. I forgot to mention it earlier.

About This Instructable

5,234views

25favorites

License:

More by DarkTherapy:Monitor an older UPS status with a Raspberry Pi 
Add instructable to: