Set up I2C on your Pi

You'll also need to set up i2c on your Pi, to do so, run sudo raspi-config and under Interface Options  select I2C and turn it on.

For more details, check out our tutorial on Raspberry Pi i2c setup and testing at

You may need to reboot once you've done that with sudo reboot

Verify Wiring (I2C scan)

Verify your wiring by running

sudo apt-get install python3-smbus i2c-tools

to install the helper software and then sudo i2cdetect -y 1 at the command line, you should see ID #68 show up - that's the address of the DS1307, PCF8523 or DS3231!

If you have a much older Pi 1, you will have to run sudo i2cdetect -y 0 as the I2C bus address changed from 0 to 1

Once you have the Kernel driver running, i2cdetect will skip over 0x68 and display UU instead, this means its working!

This guide was first published on Aug 31, 2012. It was last updated on Apr 03, 2024.

This page (Set Up & Test I2C) was last updated on Apr 03, 2024.

Text editor powered by tinymce.