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
Layout
Dimension
3D Files
You can download the 3D design files of the Sixfab Power Management UPS HAT from github repository.
Power Inputs/Outputs
Inputs/Outputs | Description |
---|---|
J2 | Micro USB 5V 2.5A max. input |
J3 | USB Type-C 5V 3A max. input |
J4 | Terminal Block 5V to 21V. 4A max. current input. |
J7 | 5V rated 2.6A max output, solderable pads on the bottom side. |
- 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.
- 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 / Task | Idling | With Base HAT 4G Connection - Idle | With Cellular IoT HAT Cellular Connection - Idle |
---|---|---|---|
Raspberry Pi 4 (2 GB) | 5 Hrs 36 Min | 4 Hrs 35 Min | 4 Hrs 45 Min |
Raspberry Pi 3B+ (1 GB) | 5 Hrs 58 Min | 5 Hrs 3 Min | 5 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.
Behavior | Status |
---|---|
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* |
LEDs
There are three LEDs on the HAT as two of them are programmable RGB.
LED | Status |
---|---|
PWR | This red LED is ON when the Raspberry Pi is powered. |
L1 | Can be programmed as shows temperature level or heartbeat for the system. |
L2 | Used 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%.
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.
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.
Functions dependent on the power_agent service
While using the following functions the agent service should be active.
- Functions that will trigger the HAT: soft_reboot, soft_power_off, hard_reboot, send_system_temp, send_battery_temp
- Watchdog
- Fan: auto mode
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.
Default Settings
The default behavior of the UPS HAT is defined as follows:
Properties | Value |
---|---|
WATCHDOG_STATUS | WATCHDOG_PASSIVE |
RGB_ANIM_TYPE | RGB_DISABLED |
RGB_ANIM_COLOR | RED |
RGB_ANIM_SPEED | RGB_FAST |
FAN_AUTOMATION_SLOW_TRESHOLD | 40 |
FAN_AUTOMATION_FAST_TRESHOLD | 100 |
BATTERY_MAX_CHARGE_LEVEL | 100 |
BATTERY_SAFE_SHUTDOWN_LEVEL | 5 |
BATTERY_SAFE_SHUTDOWN_STATUS | SAFE_SHUTDOWN_PASSIVE |
BATTERY_DESIGN_CAP | 2500 |
BATTERY_WAKEUP_STATUS | WAKEUP_PASSIVE |
POWER_STATUS | RPI_POWER_ON |
LOW_POWER_MODE | LPM_DISABLED |
EASY_DEPLOYMENT_MODE | EDM_DISABLED |
FAN_MODE | FAN_ON_MODE |
WATCHDOG_INTERVAL | 4 minutes |
BATTERY_SEPARATION_STATUS | NOT_SEPARATED |
DEVICE_CURRENT_THRESHOLD | 250 mA |
BATTERY_CUT_OFF_TEMP | 65 |
WAKE_UP_TOLERANCE | 5% |
MAX_CHARGE_TOLERANCE | 2% |
POWER_OUTAGE_EVENT | POWER_OUTAGE_EVENT_DISABLED |
RUNTIME_ON_POWER_OUTAGE | 5 minutes |
SLEEPTIME_ON_POWER_OUTAGE | 25 minutes |
Updated about 3 years ago