Appearance
RTC Backup Battery
The Raspberry Pi 5 has a built-in real-time clock. With the official RTC battery (a rechargeable coin cell on a connector) plugged in, the Pi keeps correct time across power outages — without waiting for NTP after boot, which matters for a home-automation box whose automations and history are time-based.
Charging is disabled by default
The RTC includes a constant-current (3 mA), constant-voltage charger, but battery charging is off by default — it must be enabled explicitly (official docs).
Current state can be inspected through sysfs:
sh
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/battery_voltage
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/charging_voltage
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/charging_voltage_max
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/charging_voltage_minExample output before enabling (voltages in µV — battery at ~2.71 V, charging off, allowed range 1.3–4.4 V):
2711963
0
4400000
1300000Enabling charging
Add to /boot/firmware/config.txt (that's 3.0 V — six zeros):
ini
dtparam=rtc_bbat_vchg=3000000Reboot, then re-check the sysfs files to confirm the charging voltage is set.
Doing this on HAOS
HAOS gives no easy shell onto the boot partition, so the config.txt edit is done by mounting the boot partition of the installed disk on another Linux machine (source: HA community thread, verified on the haos_rpi5-64-13.1 image):
- Connect the HAOS disk (NVMe in a USB adapter, or SD card) to a Linux machine.
- As root, mount the boot partition — e.g.
mount /dev/nvme0n1p1 /mnt/boot(device name varies; it's the small FAT partition containingconfig.txt). - Edit
config.txtand adddtparam=rtc_bbat_vchg=3000000. sync, unmount, safely remove the disk.- Put the disk back in the Pi, power up, and verify from an SSH add-on shell:
sh
[core-ssh ~]$ cat /sys/devices/platform/soc/soc\:rpi_rtc/rtc/rtc0/charging_voltage
3000000
[core-ssh ~]$ cat /sys/devices/platform/soc/soc\:rpi_rtc/rtc/rtc0/battery_voltage
2886321No Linux machine at hand?
A Linux VM works too if the disk can be passed through to it. Collected notes on that: SD cards in VirtualBox, a VirtualBox forum thread, and raw disk access in VirtualBox.