Serial Port Mod Introduction
Posted: Sun Sep 22, 2019 4:13 am
Serial Interfacing with a CyberPower UPS
By Jeff Mayes, October 2018
Preface
This all started when I decided we needed a UPS to integrate into our products and searched with the following criteria. Must be low cost, 300w, rack mounted, have batteries that load into the front and have a serial port. Of course APC and Tripp-lite were on top of the list but now they only have USB or dumb ports for connection plus cost was prohibitive. Now CyberPower comes into the picture, it fit all my requirements AND had a neat display to add to the WOW factor (more on the display later). Thinking I had found the perfect solution I ordered one and with great disappointment found it had a serial port that does NOT support serial data! CyberPower marketing their product as having a serial port was plain not accurate. In fact pins 2 & 3 (the data pins) of the port are not connected to anything!! The only functions available from that port are on/off hardwired signals for “Load on battery” and “Load on line”, it had one input to shut down the unit, not very functional at all. It did have a USB port which DOES support data transfer but there is no published protocol and home-brew interfacing to USB is a major job which is why I ruled out the other UPS’s. However there was a port for a plug in optional network card which also could provide useful data but at a cost as much as the UPS which was not a cost efficient solution.
Needing to interface the UPS to our products I decided to reverse engineer the available ports. USB as mentioned earlier is very tricky and time consuming to make a driver for and would require a 3rd party microprocessor to convert it to serial so that is ruled out. The actual serial port is useless so that left only the network option port.
I ordered the network option board and joyfully found an internal simple 4 wire interface, gnd, v+, rx & tx which turned out to be good ole serial data in TTL form (and not even inverted). After some sniffing I easily found it communicated at 2400 baud and used plain English commands (mostly single keystrokes, wow!) If anyone has done interfacing to APC serial ports you will notice much similarity. I also found that since the rx/tx signals were positive polarity I could just wire them to a standard computer serial port without any drivers and get error free data communication (again WOW!).
Data I discovered included on/off line, line voltage, battery charge, load percentage, estimated battery life, frequency and MORE! Functions that could be sent include Battery quick test, Battery Deep test, UPS shutdown and UPS reboot (the latter will shut down the ups for a few moments and turn it back on, perfect to remote reboot the equipment)
Now that I found the interface I needed to make it easy to connect to the UPS, I need this solution for many installations so it became apparent that a slide in board that would fit just like the option board with a DB9 serial connector was the best solution. I needed to order a large quantity of boards to make them cost efficient so I have extras!!
As I said earlier I am running directly from the TTL port to a computer RS232 port, not 100% proper but works great for short runs. I decided for situations where there needs to be a long run of cable or if your just too geeky to get over putting TTL into a RS232 port I put a driver circuit on the board that can be optionally added. By adding a MAX2232 some caps, 5v lp reg and cutting 2 traces makes it a fully compliant RS232 interface.
I am making the boards available on Ebay and my website (jmayesdeals.com) for $29 complete with connector or $39 with the driver circuit added. Any CyberPower UPS that will accept a RMCARD202 or RMCARD205 network card should work. Want to roll your own? Read on for all the info you will need.
By Jeff Mayes, October 2018
Preface
This all started when I decided we needed a UPS to integrate into our products and searched with the following criteria. Must be low cost, 300w, rack mounted, have batteries that load into the front and have a serial port. Of course APC and Tripp-lite were on top of the list but now they only have USB or dumb ports for connection plus cost was prohibitive. Now CyberPower comes into the picture, it fit all my requirements AND had a neat display to add to the WOW factor (more on the display later). Thinking I had found the perfect solution I ordered one and with great disappointment found it had a serial port that does NOT support serial data! CyberPower marketing their product as having a serial port was plain not accurate. In fact pins 2 & 3 (the data pins) of the port are not connected to anything!! The only functions available from that port are on/off hardwired signals for “Load on battery” and “Load on line”, it had one input to shut down the unit, not very functional at all. It did have a USB port which DOES support data transfer but there is no published protocol and home-brew interfacing to USB is a major job which is why I ruled out the other UPS’s. However there was a port for a plug in optional network card which also could provide useful data but at a cost as much as the UPS which was not a cost efficient solution.
Needing to interface the UPS to our products I decided to reverse engineer the available ports. USB as mentioned earlier is very tricky and time consuming to make a driver for and would require a 3rd party microprocessor to convert it to serial so that is ruled out. The actual serial port is useless so that left only the network option port.
I ordered the network option board and joyfully found an internal simple 4 wire interface, gnd, v+, rx & tx which turned out to be good ole serial data in TTL form (and not even inverted). After some sniffing I easily found it communicated at 2400 baud and used plain English commands (mostly single keystrokes, wow!) If anyone has done interfacing to APC serial ports you will notice much similarity. I also found that since the rx/tx signals were positive polarity I could just wire them to a standard computer serial port without any drivers and get error free data communication (again WOW!).
Data I discovered included on/off line, line voltage, battery charge, load percentage, estimated battery life, frequency and MORE! Functions that could be sent include Battery quick test, Battery Deep test, UPS shutdown and UPS reboot (the latter will shut down the ups for a few moments and turn it back on, perfect to remote reboot the equipment)
Now that I found the interface I needed to make it easy to connect to the UPS, I need this solution for many installations so it became apparent that a slide in board that would fit just like the option board with a DB9 serial connector was the best solution. I needed to order a large quantity of boards to make them cost efficient so I have extras!!
As I said earlier I am running directly from the TTL port to a computer RS232 port, not 100% proper but works great for short runs. I decided for situations where there needs to be a long run of cable or if your just too geeky to get over putting TTL into a RS232 port I put a driver circuit on the board that can be optionally added. By adding a MAX2232 some caps, 5v lp reg and cutting 2 traces makes it a fully compliant RS232 interface.
I am making the boards available on Ebay and my website (jmayesdeals.com) for $29 complete with connector or $39 with the driver circuit added. Any CyberPower UPS that will accept a RMCARD202 or RMCARD205 network card should work. Want to roll your own? Read on for all the info you will need.