How to Find I2C Device Addresses
The method to find the address of I2C devices connected to Raspberry Pi’s hardware I2C pins (GPIO 2, 3) is as follows:
Open the terminal and enter the following:
sudo i2cdetect -y 1
The addresses of currently connected I2C devices will be displayed in hexadecimal format.

Addresses of I2C devices connected to pins other than the hardware I2C pins (GPIO 2, 3) – software method, bit-bang – cannot be found.
The i2cdetect command simply outputs the addresses of connected I2C devices and does not display device names or types. Therefore, when using multiple I2C devices, the address for each device must be determined by referring to each device’s datasheet.
The i2cdetect command simply outputs the addresses of connected I2C devices and does not display device names or types. Therefore, when using multiple I2C devices, the address for each device must be determined by referring to each device’s datasheet.