🛠 Interroger un capteur I2C sur les broches 3/5 du connecteur

Orange Pi 3B (Rockchip RK3566) · intermediaire · Schéma : IMG-orangepi-3b-intermediaire-2-opi3b-i2c-capteur.svg — capteur I2C relié aux broches SDA/SCL (broches 3/5, I2C2_M1) du connecteur 40 broches de l'Orange Pi 3B

Objectives

Connect an I2C sensor or peripheral (OLED SSD1306, BME280, etc.) to the Orange Pi 3B and detect it using i2c-tools. Note: on the 40-pin connector, the only conflict-free I2C interface is I2C2_M1, pins 3 (SDA) and 5 (SCL); it is enabled in the mainline device tree only since the commit dated 2025-11-21 — a recent kernel is required, otherwise use the manufacturer's image or a custom overlay (kernels 6.11 to 6.17).

Hardware

Complete code

sudo apt install i2c-tools
sudo modprobe i2c-dev
i2cdetect -l          # lister les contrôleurs
# Trouver le bus du connecteur : le nom du device tree contient i2c2
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 = numéro du bus i2c2 repéré ci-dessus
# Exemple de sortie attendue : un périphérique répond 3c (OLED SSD1306)
# Lecture rapide d'un registre :
sudo i2cget -y N 0x3c 0x00

Expected verification

i2cdetect -y N displays a grid; the sensor's address appears (3c, 76, 77…). No UU should appear if no kernel driver already claims the device.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials