|

How to Plug in Raspberry Pi RTC Battery

How to plug in Raspberry Pi RTC battery is a key step for projects that need accurate timekeeping. A Real-Time Clock (RTC) module tracks the date and time even when your Pi is powered off — but it only works if the battery is installed correctly

In this guide, we’ll walk you through the process step by step.

Why Add an RTC Battery to Raspberry Pi?

The Raspberry Pi doesn’t come with a built-in clock that keeps time when it’s shut down. Normally, it updates the time from the internet on boot. But if your Pi isn’t always online (like in robotics, portable, or remote projects), you’ll need an RTC module with a battery to maintain accurate time.

What You’ll Need

  • Raspberry Pi (any model)
  • RTC module (commonly DS3231 or DS1307)
  • Coin cell battery (CR1220 or CR2032, depending on your module)
  • Jumper wires (if your RTC isn’t a HAT or plug-and-play board)
How to Plug in Raspberry Pi RTC Battery

Step 1: Identify the Battery Slot

Most RTC modules for Raspberry Pi include a small coin-cell battery holder. Before you begin, check the back or top of the module for the circular slot. It’s usually labeled with the battery type, such as CR1220 or CR2032.

Step 2: Insert the RTC Battery

  1. Hold the coin cell battery with the positive side (+) facing up.
  2. Slide it gently into the battery holder on the RTC module.
  3. Make sure it clicks in securely so it won’t pop out during use.

Tip: Never force the battery. If it doesn’t slide in smoothly, check that you’re aligning it correctly.

Step 3: Connect the RTC Module to Raspberry Pi

Once the battery is in place, it’s time to connect the RTC module:

  • Plug the module into the GPIO pins (if it’s a HAT-style board).
  • If it’s a breakout board, connect it using jumper wires:
    • VCC → 3.3V pin on Raspberry Pi
    • GND → Ground pin
    • SDA → GPIO2 (SDA)
    • SCL → GPIO3 (SCL)

Step 4: Enable I2C on Raspberry Pi

  1. Boot up your Pi.
  2. Run sudo raspi-config.
  3. Go to Interfacing Options → I2C → Enable.
  4. Reboot your Raspberry Pi.

This step allows your Pi to communicate with the RTC module.

Step 5: Test the RTC

Run this command to check if your Raspberry Pi detects the module:

sudo i2cdetect -y 1

You should see an address (like 0x68) appear. This confirms the RTC is working.

Conclusion

Learning how to plug in Raspberry Pi RTC battery is simple but essential if you want your Pi to keep accurate time without internet access. Just slide in the correct coin cell battery, connect the RTC module to your Pi’s GPIO pins, and enable I2C. Once set up, your Raspberry Pi will always remember the correct date and time — even after being powered off.

FAQ: How to Plug in Raspberry Pi RTC Battery

Q1: Why do I need to know how to plug in Raspberry Pi RTC battery?
A: Without the RTC battery, your Raspberry Pi loses track of time when powered off. Plugging in the RTC battery ensures accurate timekeeping even offline.

Q2: What type of battery is used when learning how to plug in Raspberry Pi RTC battery?
A: Most RTC modules use a coin cell battery, typically CR1220 or CR2032, depending on the module design. Always check the label on your module.

Q3: Is it safe for beginners to learn how to plug in Raspberry Pi RTC battery?
A: Yes! It’s one of the easiest Raspberry Pi upgrades. Just slide the coin cell into the holder with the positive side facing up, and you’re ready to go.

Useful Links for Raspberry Pi RTC Setup

Blog

Similar Posts