Raspberry Pi 5 RTC battery and charging

The Raspberry Pi 5 has its own RTC and a dedicated J5 (BAT) backup connector next to USB-C. This chapter configures the Pi clock supply. The UPS DS1307-compatible clock remains a separate device; retain its existing overlay and daemon settings.

Choose the RTC backup source

M.2 backup cable: use the dedicated Pi Modules cable from the M.2 UPS PMH backup supply to J5, observing polarity and connector orientation. The main UPS battery then also supports the Pi RTC, including after external power loss and Linux shutdown, while the battery and backup path remain powered. A separate RTC coin cell is unnecessary.

The M.2 RTC backup path supplies a nominal regulated 3.3 V when the main battery provides sufficient input headroom. It does not connect the raw battery voltage directly to J5. Below the regulator’s operating headroom, the backup voltage falls with the battery.

Separate RTC battery: if the M.2 cable is not fitted, Raspberry Pi offers a rechargeable ML2020 manganese-lithium cell with a matching two-pin plug and mounting pad. Connect one source to J5; do not parallel the coin cell with the M.2 cable. Use only the designated cable, not a loose LiPo/Li-ion cell or a generic battery lead.

Non-rechargeable CR-type cells must not be charged. They are not the recommended backup source for this assembly. Backup duration depends on the actual source, temperature and clock load; a battery-life estimate is not a guaranteed retention period.

Settings for the M.2 RTC backup cable

Keep the Raspberry Pi RTC charger disabled when the M.2 cable supplies J5. Charging the main UPS battery is handled by M.2 UPS PMH. The Pi RTC charging setting does not configure that charger.

sudo nano /boot/firmware/config.txt

In the applicable [all] section, replace any enabled rtc_bbat_vchg setting with the following. Avoid duplicate or conflicting entries; preserve the UPS RTC overlay and other board settings.

[all]
dtparam=rtc_bbat_vchg=0

The firmware parameter uses microvolts. Zero, or an omitted parameter, disables the Pi RTC trickle charger. Reboot under cable power, then identify the two clocks:

sudo reboot
# Reconnect over SSH after startup:
for d in /sys/class/rtc/rtc*; do
  echo "$d: $(cat "$d/name")"
done

Select the onboard Raspberry Pi RTC for the checks on the next page. The UPS clock is the rtc-ds1307 device at 1-0068; device numbers can change.

Charging the official ML2020 RTC battery

Use this option only with the separate approved rechargeable RTC cell and the M.2 RTC cable disconnected. The official Raspberry Pi battery is ML2020; do not substitute a different chemistry merely because its connector fits.

The Pi RTC charger supplies up to 3 mA. The documented 3.0 V example is configured in /boot/firmware/config.txt as follows:

[all]
dtparam=rtc_bbat_vchg=3000000

Here, 3000000 means 3,000,000 microvolts, or 3.0 V. Save and reboot. To return to the M.2 cable, disable Pi RTC charging again before connecting it. The limits exposed by the driver are not a safe-voltage specification for every battery.

Verify charging and set the Pi clock

The examples below use rtc0 for the onboard Pi RTC. First verify its name; replace rtc0 if Linux assigned a different number. These commands must target the Pi clock, not the UPS DS1307-compatible device.

cat /sys/class/rtc/rtc0/name
grep . /sys/class/rtc/rtc0/charging_voltage*
sudo hwclock --show --rtc=/dev/rtc0

charging_voltage should read 0 with the M.2 cable, or 3000000 for the rechargeable-cell example. The _min and _max files show driver limits, not a measurement of battery voltage. If these files are absent, verify the Pi RTC identity and kernel support.

After confirming the Linux system time is correct, initialize the Pi RTC in UTC and read it back:

timedatectl status
# Run the write only after confirming the system time:
sudo hwclock --systohc --utc --rtc=/dev/rtc0
sudo hwclock --show --rtc=/dev/rtc0

Test time retention

Record the Pi RTC time, shut Linux down normally and remove external power while leaving the selected RTC backup connected. Wait several minutes, then restart and check that time advanced correctly. Arrange an offline start for this test so NTP cannot hide a retention failure. Restore normal network synchronization afterwards.

The M.2 daemon synchronizes the UPS clock; do not treat that as proof that the separate Pi RTC retained time. RTC wake alarms and EEPROM low-power changes are separate features and are not required for this backup procedure.

References: Raspberry Pi RTC documentation and official RTC Battery product page; Raspberry Pi firmware parameter reference. The Cytron tutorial provides an additional illustrated guide. The regulated-supply description also uses the TI TLV743P data sheet. Accessed 22 October 2026.

Raspberry Pi RTC documentation

Raspberry Pi RTC Battery

Firmware parameter reference

Cytron illustrated tutorial

TI TLV743P regulator data sheet

References
https://github.com/raspberrypi/documentation/blob/master/documentation/asciidoc/computers/raspberry-pi/rtc.adoc
https://www.raspberrypi.com/products/rtc-battery/
https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
https://www.cytron.io/tutorial/rtc-raspberry-pi-5
https://www.ti.com/lit/ds/symlink/tlv743p.pdf

Installer V06 applies rtc_bbat_vchg=0 automatically; reboot, then run --check.
