🛠 Interroger un capteur I2C sur le connecteur 40 broches

Radxa ROCK 3B (Rockchip RK3568) · intermediaire · Schéma : IMG-radxa-rock-3b-intermediaire-2-rock3b-i2c-capteur.svg — module capteur I2C relié aux broches SDA/SCL du connecteur 40 broches de la Radxa ROCK 3B, loupe sur les deux broches signal

Objectives

Connect an I2C sensor or peripheral (OLED SSD1306, BME280, CO2 sensor…) to the 40-pin connector of the ROCK 3B and detect it with i2c-tools. The official documentation lists 3 I2C controllers on the connector (header function table); the exact pins depend on the muxing of your hardware revision — the number of functions varies between the CNX launch sheet and the current documentation, so we verify on the board.

Hardware

Complete code

sudo apt install i2c-tools
# Activer le contrôleur I2C du connecteur (Radxa OS : outil rsetup)
sudo rsetup    # Interface/Overlay settings -> activer l'I2C du header, reboot

sudo modprobe i2c-dev
i2cdetect -l                     # lister les contrôleurs i2c-0, i2c-1...
# Identifier le bus du connecteur via le device tree :
for d in /sys/bus/i2c/devices/i2c-*; do
  echo "$d : $(cat $d/of_node/fullname 2>/dev/null)"; done
sudo i2cdetect -y N              # N = bus du connecteur repéré ci-dessus
sudo i2cget -y N 0x76 0xd0       # exemple : ID du BME280 -> 0x60

Expected verification

i2cdetect -y N displays a grid where the sensor's address appears (3c, 76, 77…); i2cget returns a consistent value (0x60 for the BME280). No UU if no kernel driver already claims the module.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials