this UPS HAT (C) for Raspberry Pi Zero, 5V Uninterruptible Power Supply, Multi Battery Protection Circuits w

Wolfw28

Active Member
View Badges
Joined
Mar 13, 2022
Messages
200
Reaction score
138
Location
Myakka City
Rating - 0%
0   0   0
Hello let me first start by give you all a little history on my story so you understand where I’m coming from and what I’m doing and why. I just recently got back into the saltwater aquarium hobby after a 22 year hiatus. 22 years ago I lost a whole 180 gallon setup 10 year worth of fish and coral died while I was gone for a holiday weekend, because of a storm and a power outage. 2 day and lost over 8000.00 in fish and corals some you can’t get any more I’d hate to even imagine what it would be at today prices. I didn’t bother setting the tank back up again but of the shock of losing everything and the fact that a would be moving in a few months. Forward to today I live in a rural area and we get some nasty storms daily in the summer that cause the power to flicker on an off quite a bit along with frequent power outages and other electric company isn’t exactly very fast in their repairs or maintaining the lines and cutting trees and to make it worst me and my 2 neighbors are on a . completely separate secret than the rest of the people around us so we are at the bottom of the repair priority list. We went over 3 weeks without power after Hurricane Charlie so with all that being said I’m I’m a little paranoid about loosing another system do to power failure. I do have a generator but it just a regular generator not a whole house system I’d like one just can’t afford one being on a fixed income. So I designed my system around DC voltage devices 2 24v main pumps 1 24v Vortec powerheads in tank and 2 12v powerheads one in overflow and one in refugium. I’m using 2 12v 100Ah LiPo battery a friend got for me hook a Series bring the voltage up to 24v. I bought this 180W 12V 13.5A universal AC UPS/Charge function monitor switching power supply input 110/220v battery charger output 12VDC

HTB1jp2idzgy_uJjSZKPq6yGlFXaW.jpeg


Unfortunately it doses not work as described it is not an uninterrupted power supply I believe it uses a relay to transition from 110v to 24v. It interrupters for just a few milliseconds just enough time to spike the Pi and cause it to reboot and like I said the power flickers a lot and this is not good for the Pi. D

So after doing some research I found this this UPS HAT (C) for Raspberry Pi Zero, 5V Uninterruptible Power Supply, Multi Battery Protection Circuits with built in monitoring of power and reporting back over I2C. My question/what in need help with is getting that information to ReefPi. I’d like to if possible setup ReefPi to go into a kinda fail safe mode shutdown all none essential equipment and turn on a 12v air pump I have ,when the UPS hat senses the power loss. Coarse as I’m writing this ,I just realize that the hat is looking at the 5v input from the power supplied ( Robo-Tank) in my case which is 12v supplied from the 24v psi/ups so there a blink of a power loss. I guess I could plug a 5v or dropped down to 3.3v ac adapter to work as a switch. To let the Pi and Reef-Pi know there is a Ac voltage loss and run the power loss, no power,emergency operation mode,and run the shutdown sequence and then the reverse sequence when power was restored. I think I know how to do this in Reef-pi ,but the script configs sides under the hood not sure about I know nothing about writing Cade . Any help or advice on this subject would be awesome. I pan on have this system a it’s occupants for a long times.

The oldest member in my tank was almost 15year old and had from my previous 2 tanks before. I’m dammed and determined to not loose another tank due to an electrical failure. Thank you for taking the time to read this have a wonderful day.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
976
Location
Germany
Rating - 0%
0   0   0
Hi, I just had the same thought you had, that the UPS HAT would only see a brief interruption in power supplied and therefore wouldn’t be a good sensor for power outage.

Two ideas:
if the power only drops for a few ms, you could buffer it with a few big capacitors. If you calculate or measure your 12V current draw and measure the delay for a power outage you can calculate the required size:
C = t_out * I_draw/V_cc * drop_factor
Example:
You draw I_draw = 1 A
The Relay takes t_out = 10 ms
Supply voltage is V_cc = 12 V
You want your voltage to only drop 1% (at 12 V that’s 11,88 V), so the drop_factor = 100 (= 1/1%)
That gives a capacity of: C = 83 mF
Quite a lot, now that I think about it ^^
Stabilizing the 5V on the PI might be easier, but funnily enough lower voltages require higher capacities. The lower current draw on the 5V might help to offset that though.
it does however sounds like the UPS HAT is the safer and simpler option.

As an AC sensor you can also use a non-contact sensor build like This.
Or you can “simply” use a very small USB charger and let him drive his 5 V over a 170 ohm resistor and a 3,3 volt Zener diode (rated at 10 mA) and put a 10k Ohm resistor and a 1 micro farad capacitor in parallel to smooth out instabilities. This can probably be fed into any GPIO input on the PI/Robo-tank. Right @robsworld78 ? If that GPIO reads as active, you have AC power, if not you have not ^^
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
@Sral that's a good idea to create a buffer, would be interesting to know how many caps it would take, guessing quite a few. :) Not sure what else could be done to overcome that.

To detect if AC power is on I would use your idea with a 5v power supply or using a relay like @Wolfw28 mentioned but the power supply would be easier and safer. If you use a sensor port on the controller simply connect the power supply ground to ground and +5v to the data pin, like this you would want the sensor jumper set to "P-D" which enabled a pulldown resistor so the pin isn't floating. In reef-pi you would create an ATO to read that sensor port and reef-pi would know if AC is present or not. You could create a macro to turn off equipment you don't want running when that port isn't active. If you have problem with macro you could create multiple ATO's using the same sensor but controlling different equipment, that should work as well.
 
OP
OP
Wolfw28

Wolfw28

Active Member
View Badges
Joined
Mar 13, 2022
Messages
200
Reaction score
138
Location
Myakka City
Rating - 0%
0   0   0
Just a quick update so I got a 40 pin male to female header pin cable. Though that scene that USP hat was designed to supply a constant 5v supply to the Pi it might be an issue that Robo-Tank also supplies 5v to power the PI via the 40 pin header. So I cut the 2 5v power wires and ground that was coming out of Robo-Tank attached a usb connector and connected it to the power input to the UPS hat still allowing Rob-Tank to power the Pi. Well the Pi powered up I believe it booted up but nothing else it was if it was never connected to Robo-Tank. So double check that each pin matched up and I had the right ones retired it a same thing. So I tried plugging the Pi/hat into Robo-Tank directly and it powered up booted and RoboTank worked properly. Awesome next switch off AC power, Pi stayed powered up no reboot seamlessly transfer of power just what I wanted. So now the charge circuit for the batter, so thinking that the Pi power in usb connector is directly attached to the 40 pin connector that Robo-Tank is supplying 5v to I could use that to change the UPS hat battery WRONG. Now back to Robo-Tank not working. So I removed that and replaced it with a separate 5v supply from a cheap cellphone charger and all works well , the charge indicator came on Robo-Tank stayed operational about 10 minutes later change indicator turned off. Awesome now I can cut the change wiring and split into to circuits one suppling 5v to the hat and 5v being supplied to Robo-Tank sensor input to provide and AC electrical status to Reefpi to allow me to create a macro to turn all essential equipment off that we’re now on battery backup. Perfect just what I needed. Now just have to design and print a new case for Robo-Tank controller to accommodate the UPS hat.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
976
Location
Germany
Rating - 0%
0   0   0
Okay, that was quite confusing, had to read that several times XD

So basically:
  1. connecting the PI to Robotank via a modified 40 pin header cable DIDN'T work
    1. you connected the 5V+GND of RoboTank to the charging port of the UPS HAT
    2. Maybe Robotank doesn't utilize all GND lines of the Pi ? (@robsworld78 ?)
    3. Maybe the long header cable is interfering too much, especially with I2C ?
  2. plugging the PI with the UPS HAT attached into RoboTank DID work
    1. However, then using Robo-Tank 5V to charge the UPS didn't work
      1. didn't expect it too, because you then have a loop of the UPS HAT powering it's own charge input, god knows what happens there, especially if RoboTank supplies a slightly different voltage than the UPS HAT wants to regulate to or vice versa
    2. Using a separate AC to USB phone charger worked
      1. now you will split that USB cable into two:
        1. powering the UPS HAT
        2. supplying a 5V signal to Robo-Tank for AC power on
I looked up the schematic and parts description of the UPS HAT and you have to insert Power through the USB in, it's not designed to utilize any 5V power present at the PI's 5V pin.

I only see the problem, that you currently do not know whether the power for the components currently comes from RoboTank's 5V or the UPS HAT's 5V. Having two voltage sources in a system might cause unintended side-effects. The Output of the UPS HAT is at least overvoltage protected up to 16V, so if Robo-Tank supplies more than the UPS HAT, everything should be fine.
 
OP
OP
Wolfw28

Wolfw28

Active Member
View Badges
Joined
Mar 13, 2022
Messages
200
Reaction score
138
Location
Myakka City
Rating - 0%
0   0   0
Okay, that was quite confusing, had to read that several times XD

So basically:
  1. connecting the PI to Robotank via a modified 40 pin header cable DIDN'T work
    1. you connected the 5V+GND of RoboTank to the charging port of the UPS HAT
    2. Maybe Robotank doesn't utilize all GND lines of the Pi ? (@robsworld78 ?)
    3. Maybe the long header cable is interfering too much, especially with I2C ?
  2. plugging the PI with the UPS HAT attached into RoboTank DID work
    1. However, then using Robo-Tank 5V to charge the UPS didn't work
      1. didn't expect it too, because you then have a loop of the UPS HAT powering it's own charge input, god knows what happens there, especially if RoboTank supplies a slightly different voltage than the UPS HAT wants to regulate to or vice versa
    2. Using a separate AC to USB phone charger worked
      1. now you will split that USB cable into two:
        1. powering the UPS HAT
        2. supplying a 5V signal to Robo-Tank for AC power on
I looked up the schematic and parts description of the UPS HAT and you have to insert Power through the USB in, it's not designed to utilize any 5V power present at the PI's 5V pin.

I only see the problem, that you currently do not know whether the power for the components currently comes from RoboTank's 5V or the UPS HAT's 5V. Having two voltage sources in a system might cause unintended side-effects. The Output of the UPS HAT is at least overvoltage protected up to 16V, so if Robo-Tank supplies more than the UPS HAT, everything should be fine.
In a nut shell yes didn’t think my description was so confusing. The 40 pin harness was Originally designed to cut the voltage from Robo-Tank off to the Pi .So it wasn’t feeding the pie voltage from two sources. The cable was only 3 inches long so I don’t think there was a problem with the length. I don’t know the internal circuitry of the Robo-Tank control board, either way the pie and Robo-Tank along with UPS hat do not seem to mind being attached to one another as long as Robo-Tank 5 V circuit is not attached to the hat input/charge circuit.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
The Pi does have all the grounds connected and there are two 5v pins that get powered up, maybe that's why results weren't as expected. The Pi 3.3v pin isn't used to power anything, I have other regulator for that. The 5v regulator is good for 3 amps at 95% efficiency and the overall ripple or noise is very low even when high loads get switched on the DC ports so as long as main power supply is strong the 5v rail should be as well.
 

Clear reef vision: How do you clean the inside of the glass on your aquarium?

  • Razor blade

    Votes: 130 59.6%
  • Plastic scraper

    Votes: 63 28.9%
  • Clean-up crew

    Votes: 77 35.3%
  • Magic eraser

    Votes: 38 17.4%
  • Other

    Votes: 63 28.9%
Back
Top