DFR0494 Raspberry Pi UPS HAT - charging algorithm
I have a Raspberry Pi in a remote location. It is connected to two 12V car batteries with a 24V-5V 10A DC-DC converter. The 5V converter is connected to the DFR0494 (V1.3 firmware) and a 3.7V 6000mAh LiPo battery, which is mounted on a Pi 3B+.
It all works great. The DFR0494 powers the Raspberry Pi and discharges the battery (to a level around 5.4%) and then starts charging the battery (to a level around 80%) and the cycle repeats. Sometimes, the battery discharges below 5.4% and the DFR0494 cuts power to the Raspberry Pi. Sometimes it then recharges the battery and the power is restored. Sometimes the power is not restored (but the battery keeps charging). The 12V car batteries do not discharge completely.
I was expecting the DFR0494 to keep the battery charged all the time and only discharge the battery when the 5V supply stops.
When does the DFR0494 start charging the battery and when does it stop charging the battery? Here is a graph of the battery level over a period of days:
I've got a similar problem in the sense that the DFRobotUPS isn't powering up the Pi when the charge level reaches 7% — I'm powering it from an internal 5V power supply in an old Mac SE/30. It charges up and a process on the Pi monitors the charge level and halts the system when it drops to 7%.
When I reapply the power, however, the charge level increases (I can see the level LEDs lighting up) but the power isn't restored and I have to hold the button to get it to return. This is awkward as it's inside the Mac and I can't get to the button!
According to the I2C query, I've got firmware version 1.3, so I'm not clear why it's not automatically resuming. Very annoying!
Robert.FranklinIf you are using a standard 3.7V Lipo (full voltage is 4.2V). The logic of the battery output is as follows:
The 5V power output will be automatically disconnected when the battery level is less than 5%. Plug in the charger and when the battery level rises to 7%, the 5V power supply will be automatically switched back on.
And it will stop charging when the battery voltage is 4.2V.
This is to keep the battery from being over-discharged or over-charged.
Yeez_BThanks for the reply.
My UPS HAT is connected to a 5V supply all the time but the UPS appears to randomly charge the attached LiPo battery. Sometimes, it allows the battery to discharge to 5.4% and then it cuts power to the Raspberry Pi. At some random time after that, it may apply power again and the battery shows a charge of 90-100%. At other times, the UPS discharges the battery to 20-40% and then starts charging the battery again (leaving the Raspberry Pi powered up - this is the behaviour I was expecting).
What I expected to happen, is that the UPS supplies constant power to the Raspberry Pi and manages the charging/discharging of the battery to maintain its health. If the 5V supply fails, the Raspberry Pi should remain powered up until the battery is discharged or the 5V supply returns.
Why doesn't the UPS HAT operate like that? Thanks.