Monitor Line Current with UPS

Looking for suggestions…

I have an IOT device that has a BBB with a power cape powered by a 5vdc psu hooked up to a switch and a 4g modem that are powered by a 24vdc psu all powered off of an incoming 120vac line.

The power cape is setup to gracefully shut down the BBB if the power is off for more than 30 seconds coming off of the 5vdc psu.

I’am adding an APC UPS in front of both of the smaller PSU’s so that I can keep the entire unit connected to the network on powerloss.

What I’am not sure how to approach is monitoring supply current so that the beagle knows when Line voltage is no longer being supplied. Some of my ideas have included using one of the random sensors I see floating around or using a NC relay and holding it open with power. I main want to be able to send an sms to myself if the power switches to the UPS and I’am currently less concerned about monitoring the status of the UPS or anything like that (although that would be cool). More important that the device tells me when it goes off mains power and when it goes back on mains power so I can decide weather or not I need to go attend to it.

Has anyone tried to do anything like this? Any suggestions for a simple way to monitor when the current drops to zero with the gpio pins? Seems like I should be able to do this some real ghetto, yet reliable way…

Thanks

Hi Trevor,

My first thought would be to use a UPS that provides a Power HID device over USB. It’s safe and should be simple. I haven’t messed with it but there is Linux software for monitoring and reporting UPS status.

The “ghetto” way would be to use an opto-isolated zero-crossing type circuit to pull down a GPIO. The signal will briefly pop back up near the zero crossings but at least you’ll know that AC is present. The usual disclaimer on this method: 120VAC can kill.

-Ron

Hi Trevor Morris,

have you tried using current sensor? i usually using these to monitor power consumption of any electrical device that using main power source (110V~240 V AC). Mine is using 8-bit microcontroller connect to analog pin, and the result is great. Take a look at this YHDC Non-invasive current sensor