跳转到内容

3006 RPi5-UPS Scap-PD 5V5A EN

来自Mcuzone Wiki

切换语言为中文

Keywords

Raspberry Pi 5, Supercapacitor, UPS, PD handshake, 5V5A, Charge and Discharge Simultaneously, I2C current and voltage detection, Long endurance, Balance, Performance, 22F, 100F, GPIO detection

I. Introduction

The UPS_Scap_PD_5V5A is a supercapacitor-based UPS power module specifically designed for the Raspberry Pi 5. The device supports 12V PD charging and simultaneous charging and discharging. It offers three output methods: USB-C, USB-A, and pogo pins, with a total output of up to 5V5A. The USB-C port supports the 5V5A PD protocol required by the Raspberry Pi 5. It offers optional 22F, 60F, and 100F supercapacitors to meet different runtime requirements. It is equipped with a main power switch and a discharge circuit, and can be mounted beneath the Raspberry Pi for power supply via pogo pins or powered via a USB-C to USB-C adapter board. It is equipped with a battery monitoring circuit, and the supercapacitor voltage and charge/discharge current can be read via the I2C interface to estimate the remaining battery life.

II. Hardware Spec

Input Power supply via USB-C interface, PD handshake voltage 12V. Please ensure to use a PD or QC power adapter; recommended input power is at least 30W.

After the power input, it is divided into two paths: One path steps down the voltage to 5.2V and directly supplies power to the target board.

The other path charges the supercapacitor. For safety reasons, charging stops once the voltage reaches 5.2V. An isolation circuit is implemented between these two paths to prevent simultaneous output.

Output 5V5A output, employing high-efficiency boost and buck DC-DC converter ICs.

Dual ports (USB-C and USB-A), sharing a combined output of 5V 5A.

The USB-C port supports PD handshake negotiation and can utilize a USB-C small board to power the Raspberry Pi 5, achieving the 5V5A PD handshake protocol. It can also be used to connect to other development boards.

The USB-A port can supply power to other devices.

Supercapacitor The series structure offers options of 22F/60F/100F to accommodate varying endurance needs, and the capacitor has a maximum charging voltage of 5.4V when fully charged.
Power loss detection A power-loss detection pin, for Raspberry Pi 5, external power loss can be detected via GPIO26 on the 40-pin header.
Current & voltage detection It can read the voltage and current of the supercapacitor through the I2C interface, and determine whether it is in a charging or discharging state by detecting the direction of the current.
Awakening pogo pin Power-off auto-start circuit, only applicable to Raspberry Pi 5.
Adjustable cutoff voltage Respectively corresponding to prioritizing battery life or output performance, the cutoff voltage is set at 1.6V/2V/2.4V, with 1.6V as the default for shipment.
Buttons 1*power switch to disconnect the output for safe module handling.

1*discharge button for rapid discharging to ensure safe storage; for example, after use, it is recommended to press this button to discharge the supercapacitor for safety.

LEDs 1*Power LED

5*supercapacitor power LEDs, 22F charging time is about 3 minutes, 100F charging time is about 15 minutes.

Size 85*56mm。
Versions Two versions: Raspberry Pi 5 version and standard version.

Raspberry Pi 5 version: Equipped with a USB C-C adapter board, both the I2C interface and power-down detection interface feature pogo pins designs.

Standard version: Includes a USB A to C cable, with both the I2C interface and power-down detection interface using 2.54mm headers.

Note: Due to their high energy capacity and low internal resistance, it is strictly prohibited to short-circuit the positive and negative terminals of a supercapacitor when it is charged. Additionally, short-circuiting the positive and negative terminals between two supercapacitor circuits is also forbidden. We are not responsible for any risks caused by short-circuiting the terminals of the supercapacitor. Please use it with caution. Damage to the device caused by short-circuiting the supercapacitor terminals is not covered under warranty.

3006_UPS_Scap_PD_18.jpg

3006_UPS_Scap_PD_06.jpg

Raspberry Pi 5 pogo pins version:

3006_UPS_Scap_PD_07.jpg

Standard version:

3006_UPS_Scap_PD_08.jpg

III. Endurance

Automatically switch to supercapacitor power supply after an external power outage, allowing the motherboard to save data and shut down the OS. The list of actual measured backup times for the supercapacitor UPS at various cutoff voltages is as follows:

(Note: The three modes: Long Endurance Mode, Balanced Mode, and Performance Mode, are adjusted via resistors on the circuit board. The factory default setting is Long Endurance Mode.)

Version 100F, charging to 5.2V before discharging begins:

Output voltage and current Maintainable time
Long Endurance Mode

(Turns off at 1.6V)

Balanced Mode

(Turns off at 2V)

Performance Mode

(Turns off at 2.4V)

5V5A 9s 9s 9s
5V4A 15.5s 15.5s 15.5s
5V3A 24.5s 24.5s 24.5s
5V2A 47.5s 47s 44s
5V1A 1min41s 1min36s 1min28s
5V0.5A 3min31s 3min19s 3min01s

Version 60F, charging to 5.2V before discharging begins:

Output voltage and current Maintainable time
Long Endurance Mode

(Turns off at 1.6V)

Balanced Mode

(Turns off at 2V)

Performance Mode

(Turns off at 2.4V)

5V5A 5.5s 5.5s 5.5s
5V4A 9s 9s 9s
5V3A 14s 14s 14s
5V2A 27s 27s 25s
5V1A 58s 54s 51s
5V0.5A 1min57s 1min53s 1min47s

Version 22F, charging to 5.2V before discharging begins:

Output voltage and current Maintainable time
Long Endurance Mode

(Turns off at 1.6V)

Balanced Mode

(Turns off at 2V)

Performance Mode

(Turns off at 2.4V)

5V5A 3s 3s 3s
5V4A 4s 4s 4s
5V3A 6s 6s 6s
5V2A 11s 11s 10s
5V1A 26s 24s 23s
5V0.5A 55s 51s 47s

IV. Related Instructions

4.1 PD handshake protocol

The USB-C power port of the Raspberry Pi 5 uses a non-standard PD handshake protocol. Therefore, if the input power does not comply with the Raspberry Pi 5's handshake protocol, even if the input voltage and current meet the 5V5A requirement, the Raspberry Pi OS or Ubuntu OS will still display a warning indicating that the power supply does not support 5V5A, as shown in the red box in the figure (using Raspberry Pi OS as an example):

3003_21700_5V5A_PD_16.jpg

Our supercapacitor module's USB-C port comes with built-in PD handshake protocol, enabling communication with the Raspberry Pi 5 to deliver 5V/5A power, so the OS won't display the low-power warning (red box).

▶ If a supercapacitor module is used to power two Raspberry Pi 5 devices simultaneously, you can plug our USB-A to USB-C PD adapter into the USB-A port, which will also achieve normal handshake negotiation with the Raspberry Pi 5 without OS pop-up warnings. As shown in the following figure:

3006_UPS_Scap_PD_14.jpg

4.2 The characteristics of power loss detection

Timing sequence analysis for power recovery after supercapacitor power loss:

The OS experienced a power loss during operation, shut down normally, and power was restored after the supercapacitor discharged completely. Normal boot
The OS experienced a power loss during operation, normal shutdown, and power restoration before the supercapacitor is fully discharged. Normal boot
The OS experienced a power loss during operation and restored before executing the shutdown command to save data. Exit shutdown process and keep running.
The OS experienced a power loss during operation, and the power was restored multiple times before the shutdown command could be executed to save the data. Exit shutdown process and keep running.
The OS experienced a power loss during operation and restored 1-2 seconds after the data-saving shutdown command was executed. Dead zone, unable to boot [Note]

The supercapacitor UPS board is equipped with a microcontroller for power management. When external power is restored, it sends a boot signal to the Raspberry Pi 5 via a pogo pin. If the OS is in a shutdown state at this time, it will power on; if the OS is already running, a dialog window will pop up in the Raspberry Pi OS as shown in the figure below.

5001_CM5_WiFi7-PoE_47.jpg

The application needs to promptly clear this dialog box to avoid continuous power loss and triggering a forced shutdown after two recovery attempts. Our company's provided demo code already includes the logic to clear this dialog.

Note: After executing the shutdown command, the message "plymouth-poweroff.service" will briefly appear on the display for about 1-2 seconds. If power is restored during this time, the OS will fail to boot and will remain in a shutdown state until the next power outage and subsequent restoration. The probability of entering the dead zone is extremely low. There's no need to worry for local use, but careful evaluation is required for remote unattended operations.

V. Real-time voltage and current monitoring

The supercapacitor UPS can read voltage and current values through the I2C circuit to monitor the status of the supercapacitor.

This operation is based on the Raspberry Pi OS version: 2024-11-19-raspios-bookworm-arm64.img.xz

You can download it in:

https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit

5.1 Raspberry Pi OS

5.1.1 Enable the I2C interface

This device is used to check real-time power parameters via the I2C interface. You need to enable the I2C interface in the Raspberry Pi OS.

Top-left Raspberry Pi logo—Preferences—Raspberry Pi Configuration—Interfaces

Enable the I2C as shown in the figure:

3003_21700_5V5A_PD_07.jpg

With this, the configuration is complete.

5.1.2 View real-time power parameters

Open the terminal and download software to view real-time power parameters:

wget -O INA219.py http://www.mcuzone.com/wiki/3006_UPS_Scap_PD/INA219.py.zip

After launching the software, you can view real-time power parameters:

python INA219.py

When charging:

3006_UPS_Scap_PD_19.jpg

When discharging:

3006_UPS_Scap_PD_20.jpg

Note: The "Current operating time" here refers to the execution time of the INA219.py program, not the actual charging time.

This is the process of the supercapacitor UPS starting to discharge when fully charged (capacitor voltage around 5.2V). It discharges until the capacitor voltage drops below 3V, then begins recharging until fully charged again (capacitor voltage around 5.2V).

5.2 Ubuntu OS

This operation is based on the Ubuntu OS version: ubuntu-24.10-preinstalled-desktop-arm64+raspi.img.xz

You can download it in:

https://ubuntu.com/download/raspberry-pi

5.2.1 Enable the I2C interface

This device is used to check real-time power parameters via the I2C interface. You need to check whether the I2C interface is enabled on the Ubuntu OS:

sudo nano /boot/firmware/config.txt

Please check if the i2c_arm in the red box is set to "on". If not, configure it as shown in the image below:

5.2.2 View real-time power parameters

Open the terminal, first install the smbus support:

sudo apt-get install python3-smbus

Then download software to view real-time power parameters:..

wget -O INA219.py http://www.mcuzone.com/wiki/3006_UPS_Scap_PD/INA219.py.zip

After launching the software, you can view real-time power parameters:

python3 INA219.py

When charging:

3006_UPS_Scap_PD_21.jpg

When discharging:

3006_UPS_Scap_PD_22.jpg

Note: The "Current operating time" here refers to the execution time of the INA219.py program, not the actual charging time.

This is the process of the supercapacitor UPS starting to discharge when fully charged (capacitor voltage around 5.2V). It discharges until the capacitor voltage drops below 3V, then begins recharging until fully charged again (capacitor voltage around 5.2V).

VI. Power loss detection demo

The board has a built-in power loss detection circuit. For Raspberry Pi 5, it is directly connected to GPIO26 on the 40-pin GPIO header. Detailed steps are as follows (using Raspberry Pi OS as an example, the I2C interface must be enabled beforehand).

6.1 Power loss indication script demo

The script code is as follows (the script is named gpiot.sh):

2011_CM4_4G_UPS_89.jpg

Execute the command below to give the script executable permissions:

sudo chmod +x gpiot.sh

Then, execute the script:

./gpiot.sh

The executing result is: when the input power is properly connected (i.e., in charging state), the terminal displays:

3009_UPS_Scap_10.jpg

The current state of GPIO26 is hi (high level).

When the input power is disconnected (i.e., during discharge), the terminal displays:

3009_UPS_Scap_11.jpg

The current state of GPIO26 is lo (low level).

Example video showing the script's execution results:

Reference script:

http://www.mcuzone.com/wiki/3009_UPS_Scap/gpiot.sh.zip

Note: After downloading, rename the file to gpiot.sh and copy it to the Raspberry Pi OS for use.

6.2 Demo of power-down parameter retention system

After testing, the Raspberry Pi OS after July 2024 requires the installation of runtime libraries to run this program. The installation method is to execute the following command in the terminal:

sudo apt install python3-rpi.gpio

sudo apt install python3-rpi-lgpio

Then run the program:

sudo python Mcuzone_RPi5_SCap_UPS_demo.py

3006_UPS_Scap_PD_15.jpg

At this point, disconnect the input power supply of the supercapacitor UPS. The program will save the system settings and automatically start a countdown before power off:

If power is lost during system operation but restored before the data-saving shutdown command completes, the system will abort shutdown and resume normal operation:

If you need this program after purchasing the product, please contact our customer service!

Contact Us

0001_x.jpg 0002_fb.jpg 0004_ytb.jpg 0003_bb.jpg 0005_qq.jpg QQ:8204136

Email: mcuzone@vip.qq.com

Tel: +86(0)13957118045

If there are any omissions, errors, or infringements on this page, please contact us through the above methods. Thank you!

Copyright 2004-2025 Wildchip