Earlier Raspberry Pi models have no real-time clock. A Pi that boots without network access starts with a wrong time, which breaks TLS certificate checks and log timestamps. The Raspberry Pi 5 has a built-in RTC.
Timekeeping
- The RTC sets the system clock at boot, which is useful where NTP isn't reachable.
- It works without a battery while the board has power. For timekeeping while unplugged, connect a backup battery to J5 (BAT), next to the USB-C power connector.
- Battery choice (official guidance):
- Use the official rechargeable lithium-manganese coin cell, or an equivalent.
- Don't use a primary (non-rechargeable) lithium cell. The RTC's backup current is higher than most dedicated RTC modules, so it would drain quickly.
- Never use a lithium-ion cell.
- Charging is disabled by default. Enable it as described in the official RTC documentation when you fit a rechargeable cell.
Periodic jobs with a wake alarm
For a device that only needs to run every few minutes or hours (time-lapse, data upload), let it sleep in between:
- Enable the low-power halt in the bootloader config:
sudo rpi-eeprom-config --edit
# add:
POWER_OFF_ON_HALT=1
WAKE_ON_GPIO=0
- Set the alarm and halt:
echo +600 | sudo tee /sys/class/rtc/rtc0/wakealarm # wake in 600 s
sudo halt
The board drops into a very low-power state (about 3 mA) and powers back on after 10 minutes. In your application, set the next alarm just before halting, e.g. from a systemd service that runs at the end of each job.
Notes
- This applies to the Pi 5 RTC. On older models, use an external RTC module on I2C with its device tree overlay.
WAKE_ON_GPIO=0disables waking via GPIO in this low-power mode. If you also need a button wake-up, test the combination on your hardware before deploying.