Technical Details

This section introduces the concepts and terms that are crucial for the understanding, implementation and use of Sixfab Power Management & UPS HAT

Hardware Details

Hardware specifications

  • Microchip ATSAMD21G18 ARM® Cortex®-M0+ Microcontroller
  • Texas Instruments bq25703A Multi-Chemistry Battery Buck-Boost Charge Controller With System Power Monitor and Processor Hot Monitor
  • Texas Instruments bq27441-G1 System-Side Impedance Track™ Fuel Gauge
  • Texas Instruments INA219 Zerø-Drift, Bidirectional Current/Power Monitor

Pinout

Pinout image alt

Layout

Layout image alt

Layout image alt

Dimension

Dimension image alt

3D Files

You can download the 3D design files of the Sixfab Power Management UPS HAT from github repository.

Power Inputs/Outputs

Inputs/OutputsDescription
J2Micro USB 5V 2.5A max. input
J3USB Type-C 5V 3A max. input
J4Terminal Block 5V to 21V. 4A max. current input.
J75V rated 2.6A max output, solderable pads on the bottom side.
Info:
  • The recommended input voltage is 5V and the input current is 2A minimum. For the 12V input voltage, the minimum is 1.5A. We recommend the official Raspberry Pi power supply.
  • An external device can be connected to J7 for 5V output(underneath the HAT) and be aware of the polarity when sourcing via J7.
Note:
  • Use only one of these two inputs(J3, J4) at a time, i.e. do not plug a USB(J3) adapter while a power source is inserted through the terminal block(J4) or the other way.
  • The UPS HAT has several Battery input options such as J5, J9. Do not use multiple batteries at a time.

Battery(Not Included)

The HAT comes with an integrated Protected 18650 Li-on battery holder without a battery. It can be breakable if needed to use it in a different placement. Then you need to use the battery cable included in the package to connect the battery to the mainboard via JST- SFH connectors(J5 and J10)

You can plug an external single-cell 3.7V Li-on or Li-po rechargeable batteries when bigger capacities or special dimensions needed. Use JST-SFH connector(J5) with a suitable battery cable with it or you can solder cables to battery header(J9) by paying attention to the polarity.

Battery Discharge Time

For 3500 mAh Battery

Device / TaskIdlingWith Base HAT 4G Connection - IdleWith Cellular IoT HAT Cellular Connection - Idle
Raspberry Pi 4 (2 GB)5 Hrs 36 Min4 Hrs 35 Min4 Hrs 45 Min
Raspberry Pi 3B+ (1 GB)5 Hrs 58 Min5 Hrs 3 Min5 Hrs 29 Min

Buttons

There are two right-angle push buttons(S1,S2) at the edge of the HAT.
The default behaviors of the buttons are as follows.

BehaviorStatus
S1(Long Press)Hard shutdown by cutting power of Raspberry Pi
S1(Short Press)Hard boot-up by powering Raspberry Pi
S2(Long Press)Soft shutdown via I2C then power off (agent_service dependent)
S2(Short Press)Soft Power On. Power on if power conditions are alright*
*Note: The pogo pin needs to be soldered for soft power on. Click more details.

LEDs

There are three LEDs on the HAT as two of them are programmable RGB.

LEDStatus
PWRThis red LED is ON when the Raspberry Pi is powered.
L1Can be programmed as shows temperature level or heartbeat for the system.
L2Used for battery charging level and status by default. Blinks if charging the battery, steady if the system powered by battery or fully charged

  • Blinks if charging the battery, steady if the system powered by battery or fully charged.
  • The color shows the percentage of the battery.
    • RED when the lower than 30%.
    • YELLOW between 30% and 60%.
    • GREEN when the battery is charged more than 60%.
Qwiic Connector

The Qwiic cable and the qwiic connectors(J1-J11) on board are used to read the temperature of the battery holder card when battery holder broke off from UPS HAT.

I2C Address

The UPS HAT uses 0x41 I2C address. The sensor on the battery uses 0x48 i2c address. Make sure it is not conflicting with another device using the same address.

Software Details

Software services

This installs two services,power_agent and power_request which provides communication between the UPS HAT and the Power Software Platform.

Note: The power_request service must be running for the power_agent service to run.

Functions dependent on the power_agent service

While using the following functions the agent service should be active.

Watchdog

Watchdog is a power software dependent function. If the power_agent service shuts down or freezes in any way, it restarts the Raspberry Pi at the end of the watchdog interval value set.

If you want to use it with the Python API, after disabling the power_agent service, you can use it by sending the watchdog_signal command. If the signal is not sent to the MCU within the watchdog_interval time, it does hard_reboot. Also, get_watchdog_status should return 1 when active and the watchdog_interval can be set using set_watchdog_interval function.

Power Mode

The UPS HAT can be operated in 2 power modes as follows:

LPM(Low Power Mode)
This is an energy-saving mode. L1 LED turns off. L2 LED blinks at an interval of 10 seconds indicating the charge status.

To enable/disable the low power mode use set_lpm_status(status).

EDM (Easy Deployment Mode)
This mode is to save the battery after development to deployment.
It allows the Raspberry Pi and it’s peripherals to sleep while powered through the battery. Thus, it provides long-term use without consuming the battery before deployment.

To activate Easy Deployment Mode follow:

  • Update Software and Firmware. (Minimum FW version: 0.3.0)
  • Disconnect the adapter/power source(J2, J3, J4) from the HAT.
  • Press the S1 button shortly 5 times. Avoid long-press!

Activating the Easy Deployment Mode will turn off all LEDs of the HAT.

Connect the power source to UPS HAT to exit EDM.

Note: EDM is not active when any one of the power sources(J2, J3, or J4) is connected.

Default Settings

The default behavior of the UPS HAT is defined as follows:

PropertiesValue
WATCHDOG_STATUSWATCHDOG_PASSIVE
RGB_ANIM_TYPERGB_DISABLED
RGB_ANIM_COLORRED
RGB_ANIM_SPEEDRGB_FAST
FAN_AUTOMATION_SLOW_TRESHOLD40
FAN_AUTOMATION_FAST_TRESHOLD100
BATTERY_MAX_CHARGE_LEVEL100
BATTERY_SAFE_SHUTDOWN_LEVEL5
BATTERY_SAFE_SHUTDOWN_STATUSSAFE_SHUTDOWN_PASSIVE
BATTERY_DESIGN_CAP2500
BATTERY_WAKEUP_STATUSWAKEUP_PASSIVE
POWER_STATUSRPI_POWER_ON
LOW_POWER_MODELPM_DISABLED
EASY_DEPLOYMENT_MODEEDM_DISABLED
FAN_MODEFAN_ON_MODE
WATCHDOG_INTERVAL4 minutes
BATTERY_SEPARATION_STATUSNOT_SEPARATED
DEVICE_CURRENT_THRESHOLD250 mA
BATTERY_CUT_OFF_TEMP65
WAKE_UP_TOLERANCE5%
MAX_CHARGE_TOLERANCE2%
POWER_OUTAGE_EVENTPOWER_OUTAGE_EVENT_DISABLED
RUNTIME_ON_POWER_OUTAGE5 minutes
SLEEPTIME_ON_POWER_OUTAGE25 minutes

What’s Next