Raspberry Pi UPS HAT (DFR0494)

Hey RB,

That’s a good question, there shouldn’t be any problem using the UPS hat with the DigiHat as long as they don’t use the same GPIO to interface with the Pi (they almost certainly won’t). It’s only when you’ve got another HAT that has a battery involved that you’d be running into issues with differential voltages. This UPS HAT uses I2C on pins 3 and 5 on the Pi, so unless you’re using another device with I2C on those same two pins with the same address as the UPS HAT or using the pins for some other application in your project then you should be good to go! :grin:

1 Like

Thanks for the quick reply. Unfortunately, the HiFi Berry Digi devices use I2C on Pins 3 and 5.

But all might not be lost yet… I need to find out what this UPS HAT’s I2C address is. If it is different to the Digi (which seems to be 30) then it will work OK…

Edit: the UPS HAT’s default address is 0×10 and seems configurable.

1 Like

Hey RB,

It should still work, the address of the two boards on the I2C bus are different (which it appears they are) then you can actually run them both on the same I2C bus on the same pins at the same time.

1 Like

Yep… hoping that… I have just purchased a board and I will report back once I have received and tested it, just so to help others that might come across this same question.

Thanks again…

2 Likes

Bryce, reporting back.

Unfortunately, I have to say to people DO NOT BUY this if your PI is in an enclosure. I built my own small cabinet for my PI (using it as a digital audio player and it is mounted with all my other Hi-Fi gear.

So, testing it, it does work somewhat, however the following:

  1. It does not turn on automatically (I dont mean the PI itself), I mean when power is restored, the unit just goes into charge mode and does not supply the 5 volts for the PI. You have to manually push its small button for over 2 seconds, then it turns on. I cant see why as it knows there is power back as the charging circuit turns on. I dont understand why it has been designed not to sense power and turn on.

  2. If your battery is below 7% (which mine was always as when I shutdown, the battery power is still supplied to the PI in a shutdown state until it drops below 5% and auto shutoff by the UPS) then you have to wait until it is charged back to >7% before the 5v supply is turned on to the PI. My battery was 2000mha, so took 20 mins to charge to 8%. Mine got to 33% and still hadn’t auto turned on likeDFRobot’s doco states. I had to do it manually. The Shutdown was never relayed to the UPS (would be a normal feature I would have thought) for it to turn off the supply to the PI

  3. The Python program for monitoring worked first go.

  4. I suppose the good thing was that from my original question, the HiFi Berry Digi+ hat worked flawlessly when this board was connected to the PI as well.

Honestly, this board is only suited to someone that has a PI sitting on a bench, not in any enclosure, so you can manually turn it on and that their PI runs constantly 24x7 and need something just in case the power is lost.

It is not for someone that like me, keeps the PI shutdown and Power off to it when not in use, but need a safe guard if one (or the family) forget to shut it down through the web interface of the Audio Software it is running.

What firmware revision? From v1.2 it should restore power automatically once the battery is >=7%. It means that the boards sold still have rev. 1.1 or 1.0. Is there a way to flash an updated firmware?
In any case, to avoid long recharge times between 5% and 7%, just put in Cron a script to check the charge level (every minute, if need be) and if it goes below 10% initiate the shutdown, so the battery will never go below 7%.

Edit: apparently you cannot flash a new firmware as they have no bootloader… At least it is what their support service says. Pity, I agree that they are useless in any project that puts them in an enclosure or where no human intervention is available.

1 Like

Hi, I wonder if there’s a suitable case with some cooling that will accomodate the UPS hat plus a battery? I can’t see any obvious ones.

High Peter,

The UPS hat fits nicely into the HighPi case:

Unfortunately, cooling isn’t its strong point, but the Pi will throttle itself before it gets too hot, so if you’re not doing anything millisecond-precise, you probably won’t notice.

All the best with your projects!
-James

Hi There,

I would like to use this with my IoT project based on a Raspberry Pi 3. The Pi is running 24x7 but is sometimes having problems booting back up when the power supply is cut out (due to an unscheduled power outage). Can this HAT be used to simply trigger a safe shut down of the Pi when the main supply cuts out, and once the Pi is properly shut down go into a ‘sleep mode’ which does not drain the UPS battery? I want to maximise the battery life so I do not need to replace it frequently. Does anyone have a script that enables this functionality on this UPS?

Thanks for your response!

1 Like

Hi Sam,

While you’d definitely be able to code up a Python script that monitors the battery level of your UPS hat and shuts down once it gets to a certain level, the PiJuice HAT is usually a little more user friendly (it comes with a GUI with that feature built in, and a bit more documentation:

Keen to see what you think, and which route you’d like to go down!
-James

2 Likes

Hi all,
purchased a DFR0494 v2.0 last week and I have been playing around with it over the weekend.
Connected the board up, hooked up a small 120mA Lipo.
Push the button, rpi power up! Wait for bootup and putty into pi, all good.
Ran the suggested ups.py. All seems to be working nicely :slight_smile:

Now, push button again, rpi powers down instantaneously! It does not look like it instigates any shutdown process.

Is there something missing from the wiki for v2.0?
I am using an old rpi 1B, but this should work? true?

Anything I am missing here?

By the Way, anyone got a circuit diagram?

Hi Kaza

I believe the firmware versions (now up to V1.3) are different from hardware versions (now up to 2.0)

Looking at the product wiki, it looks like the most recent changes to button behavior are below:
image

How long are you holding the button? Looks like this HAT only cuts the power, rather than doing a graceful shutdown.

You might have to roll your own shutdown python script and wire a button to some GPIO:

-James

Thanks for the reply James. The short and long press do exactly what the wiki says for v1.2. The description says “…assure safe shut down…”. I would not call disconnecting the power instantaneously a “safe shutdown”. Any chance on finding a circuit diagram?

After a close look at the parts of the pcb, I can’t find any devices that config can be changed on apart from the max17043. These registers only look like config of trigger levels.

This poor user has had no reply on forum https://www.dfrobot.com/forum/topic/28063

I’m looking for a battery for a dfr0494, can you recommend anything that is available in USA?

This product does not work as I expected. I have the UPS HAT mounted on a Raspberry Pi 3B+. The UPS is connected to a 5V supply and a Polymer Lithium Ion Battery (LiPo) 3.7V 6000mAh (CE04381). The UPS seems to supply power to the RPi until the battery gets to 5.4% and then it cuts power. At some random time after that, it reconnects power and the battery shows a charge of 90-100%. The cycle repeats. In contrast, sometimes when the RPi is powered up, the battery starts discharging and the UPS will start to recharge the battery. This is the behaviour I expected. I expected the UPS would continuously supply power to the RPi and manage the battery charging/discharging to maintain the battery’s health. Only when the 5V supply fails do I expect the battery to discharge and the RPi power down. Is this UPS working as designed? I have failed to get an acceptable reply from the DFRobot forum. Thanks.

1 Like

Hey @Allan58118,

This is interesting behaviour to be sure.

From my understanding of this HAT seeing the HAT cut power when the battery is around 5% charge is to be expected. The product page for this item says:

“When the battery power is lower than 5%, the 5V power output to the Raspberry Pi will be cut off automatically. When the charger is plugged in and the battery power increases to 7%, the 5V power supply will restart automatically.”

I would assume this is a safeguard to protect the battery from damage. I would say that this behaviour happening at 5.4% charge instead of 5% is an acceptable difference but that’s more a matter of personal preference.

When the battery is sitting at a charge level of 7% or more it should start to provide 5v again.

Its odd that the HAT seems to be discharging the battery even when the Pi is being correctly powered from another source. Do you know how healthy your battery is?

From my understanding the 5v input on the HAT is designed only to charge the battery and not as a passthrough to power the board. Are you providing power directly to the Pi board as well?

Thanks, Sam

1 Like

Hi @Samuel - thanks for replying.

I am OK with the UPS cutting power when the battery gets to 5.4% - that’s not an issue. The problem is that the UPS doesn’t seem to consistently charge the battery. The UPS does supply power (eventually) when the battery charges.

I assume the battery is OK. I bought it at the same time as the UPS HAT (15 April 2024) - both from Core Electronics. I don’t have power connected to the RPi USB power connector - only via the UPS HAT. If the UPS doesn’t do passthrough power to the RPi, how would it work? I am happy to be educated on how it should work!!!

I have attached a graph of how the RPi reported the battery capacity. It appears that the UPS HAT restored power to the RPi around 7:30am and the charge was at 84%. The RPi then gradually depleted the battery until it got to 5.4% (around midday) and then the UPS HAT cut power, charged the battery a little and restored power - it did this a couple of times and then cut power. I don’t know why it wasn’t consistently charging the battery because the 5V supply to the UPS was OK. All of this happened with no intervention from me.

I also found this statement on the DFRobot Wiki… https://wiki.dfrobot.com/Raspberry_Pi_UPS_HAT_SKU_DFR0494

  1. Please use a separate USB to power the UPS HAT and do not use another USB to power the Raspberry Pi.

I assume this means that 5V power should be connected to the UPS HAT and not the RPi (but I could be wrong).

1 Like

Hey Allan,

Yeah this is weird behaviour. I have found the section you are referring to in the wiki for this product.


Maybe following these instructions all the way through will correct this behaviour? At the very least doing this reset wont hurt.

Off the top of my head this may be related to your power source. What kind of Volt / Amps are you providing the HAT with?