Source: Enable I2C Interface on the Raspberry Pi
Why
The default Raspberry Pi (and reTerminal) image has I2C disabled. It must be enabled before any I2C devices work — including the Grove Base Hat ADC and AHT20 sensor.
Method 1: raspi-config (command line)
sudo raspi-configNavigate: Interface Options → I2C → Yes → reboot when prompted.
Method 2: GUI
Menu > Preferences > Raspberry Pi Configuration → Interfaces tab → set I2C to Enabled → OK → reboot.
Install I2C tools
sudo apt-get update
sudo apt-get install -y python3-smbus i2c-toolsVerify I2C is loaded
lsmod | grep i2c_
# Look for: i2c_bcm2708Detect connected I2C devices
i2cdetect -y 1 # use bus 1 (all Pi models except original B Rev 1)
i2cdetect -y 0 # only for original Model B Rev 1Output example:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
...
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- Hex address = device connected at that address
UU= address in use by a kernel driver--= nothing detected
Shutdown before connecting hardware:
sudo haltSee Also
- I2C concept
- Serial Protocols topic
- GPIO and reTerminal topic (grove.adc requires I2C enabled)
- grove-adc source