1
\$\begingroup\$

The only real UPS solution for me where I live is "RCT", a UPS manufactured by a local PC Hardware supplier.

It has a USB port, but I can't find any details about it. I've even contacted the manufacturer specialist via email, but He doesn't seem to like answering potential customers, so I'm hoping that I can get your opinion here.

I want to use the UPS (650VA) to power a Raspberry Pi (2). The Pi will be monitoring freezer temperatures and will email the owners if their temperatures rise above a certain preset value. However, this all means nothing if the Pi looses power because no-one knew that the power was out.

This now becomes a question of "How can I determine whether the AC-in on the UPS is being powered". I've been trying to think of a number of really cheap, yet elegant ways to accomplish this, and the one that I've decided on is, quite unusual and I'm wondering if it's a good idea.

The UPS comes with a standard piezo-buzzer. When the lights go out, the UPS goes into battery-mode and emits a loud beep every few seconds. So I was thinking of linking 2 GPIO ports on the PI to the buzzer in parallel and monitoring it for power. If it's "buzzing", then the power is out and everyone important gets an email letting them know that they need to start making a plan to fix whatever went wrong.

I could even take it a bit further and determine the frequency of the buzzer (not the pitch, but how often the buzzing happens), and when the buzzing is once every second, send another email letting everyone know that the UPS is on it's last legs. (0.2Hz = Battery mode, 1 Hz = very little time left).

Good idea? Bad idea? I look forward to hearing your input.

P.S. Another solution that someone had was to buy a cheap (network) switch and plug it into the Pi (and power it from the mains). The idea behind this would be that when thee power goes out, the network will drop. Fine, but I don't really want to go buy more unnecessary hardware if it can be avoided.

P.P.S I have a spare Raspberry Pi that I'll be using for this. I'm comfortable with Raspbian and it works for what I want to do.

P.P.P.S The UPS I want to get is very cheap. I don't want to make too much of an effort building a custom home-baked UPS system. And I'm not too concerned about the energy efficiency loss because of the DC-AC-DC conversion.

Unlike the question here, My question is whether the solution that I proposed is a feasible one.

\$\endgroup\$
29
  • 2
    \$\begingroup\$ Sounds pretty inefficient, a backup battery for the Pi directly sounds much more appealing and likely much smaller too. Besides that a Pi seems to be vast overkill for that task. \$\endgroup\$
    – PlasmaHH
    Aug 29, 2016 at 13:31
  • 3
    \$\begingroup\$ Since you alread have the UPS, install NUT on your Pi. NUT should be in the Raspbian repositories (see tutorial here) Plug in your RCT, connect the USB to the Pi, see what NUT says. Costs you nothing but time to try. If it works, cool. If not, you aren't out any monetary costs. \$\endgroup\$
    – JRE
    Aug 29, 2016 at 13:37
  • 1
    \$\begingroup\$ Many cheap UPS devices are made by some OEM manufacturer. The name on the box is different from the name it calls itself when it talks to your computer through USB. \$\endgroup\$
    – JRE
    Aug 29, 2016 at 13:40
  • 1
    \$\begingroup\$ FYI: I want to use the Pi as it's convenient, I have a spare one lying around, and I'm very comfortable with Raspbian. With regard to the UPS, It's cheap, and custom building a home-baked 6-cell AA Battery UPS (or battery-bank UPS) would just make more work for me that I'm trying to avoid. There are some really nice solutions for a UPS, but they get very expensive, and I'm trying to avoid that. (Sorry I should have included this in the OP). \$\endgroup\$
    – Jim
    Aug 29, 2016 at 13:54
  • 4
    \$\begingroup\$ Possible duplicate of Sensing AC high voltage to microcontroller \$\endgroup\$ Aug 29, 2016 at 14:52

2 Answers 2

1
\$\begingroup\$

You can plug an AC to DC adapter to the mains. the output goes through a voltage divider to one of Rpi's IO. you can buy small USB adapters for as cheap as 2$. Now you can know when the mains goes off.

Powering the Rpi from a UPS is a very bad idea unless the UPS is actually used for some equipment or appliances. Check the quiescent power of the UPS. It's probably much more what the Rpi is consuming so you should know that the conversion efficiency of the inverter will be very low when you are consuming a small portion of the UPS power (which is the case you are only powering the Rpi) and will not be anywhere near the advertised efficiency. Simply buy a battery charger to charge the batteries along with a switching DC-DC converter to power your electronics. That will be more efficient and much cheaper (obvious) than buying a UPS!

\$\endgroup\$
5
  • \$\begingroup\$ "AC to DC Adapter" as in a wall-wart? Buying a reliable one here is about R250 (at current exchange rate = about 17USD). As for the bad idea, I get that, it's highly inefficient, however, it's a cheap pre-built solution that would work in keeping the Pi running while there is no mains power coming in to the building. It would also be powering a GSM-Wifi router (that would need to stay on so that the Pi can send those emails). I wouldn't have to buy any other hardware other than the UPS, and I'm not very concerned about the DC-AC-DC efficiency loss. \$\endgroup\$
    – Jim
    Aug 29, 2016 at 14:10
  • 1
    \$\begingroup\$ The Question I'm actually asking is: Is using the current to the Buzzer on the UPS as a way of determining power-out status a good idea or a bad idea? Is there a more elegant hack that I can use if the NUT software (mentioned by JRE above) doesn't go my way. \$\endgroup\$
    – Jim
    Aug 29, 2016 at 14:12
  • \$\begingroup\$ Well something similar along those lines would be an AC split core current transformer or hall effect sensor. However the Raspberry Pi doesn't have onboard ADC so may need to use a small circuit to have an on/off on a GPIO pin or an external ADC IC. \$\endgroup\$
    – D-on
    Aug 29, 2016 at 14:18
  • \$\begingroup\$ @D-on I was initially thinking about using something like a hall-effect sensor, but that would involve more money (I'm really very cheap). You don't think that hooking up 2 wires to the buzzer (or LED as mentioned by JimmyB) would be an easy answer? \$\endgroup\$
    – Jim
    Aug 29, 2016 at 14:22
  • \$\begingroup\$ to be specific on what you asked, the buzzer thing could work. If you're trying to impress someone or yourself, connect a microphone to the Pi and program the pi to detect a buzz, so you don't need to open the UPS and solder wires which can get messy. same thing with the UPS LEDs. you can place a phototransistor on the LED which will be save you from the inconvenience of soldering wires on the UPS's PCB \$\endgroup\$
    – fhlb
    Aug 29, 2016 at 14:32
0
\$\begingroup\$

The only "real" solution for you may be to consult the OEM UPS supplier to determine a low cost interface and COmm. Port with software and UPS backed network.

e.g. software solutions. http://www.power-software-download.com/viewpower.html

\$\endgroup\$
8
  • \$\begingroup\$ I actually have that tab open in another browser window! So it's on the To Investigate list. :-) Thanks! \$\endgroup\$
    – Jim
    Aug 29, 2016 at 14:36
  • \$\begingroup\$ synchronicity is amazing \$\endgroup\$ Aug 29, 2016 at 14:36
  • \$\begingroup\$ Also - the problem is getting the manufacturer to actually get back to me - I am trying. \$\endgroup\$
    – Jim
    Aug 29, 2016 at 14:39
  • \$\begingroup\$ Downloaded the correct version of the software, unpacked it, made executable, and installed it. However, running it produces an error that I can't seem to solve. :-( \$\endgroup\$
    – Jim
    Sep 1, 2016 at 12:44
  • \$\begingroup\$ what errors? Run as admin? \$\endgroup\$ Sep 1, 2016 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.