Mengaktifkan Header I2C di Orange Pi Zero 3

Bus i2c di Orange Pi tidak otomatis aktif, dan Anda harus mengaktifkan overlay / konfigurasi device tree agar i2c3 muncul dan bisa digunakan.

Cara ini telah diuji pada Orange Pi Zero 3 dengan OS Ubuntu Server 22.04

PRETTY_NAME=”Orange Pi 1.0.2 Jammy”
NAME=”Ubuntu”
VERSION_ID=”22.04″
VERSION=”22.04.3 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL=”https://www.ubuntu.com/”
SUPPORT_URL=”https://help.ubuntu.com/”
BUG_REPORT_URL=”https://bugs.launchpad.net/ubuntu/”
PRIVACY_POLICY_URL=”https://www.ubuntu.com/legal/terms-and-policies/privacy-policy”
UBUNTU_CODENAME=jammy

 

Langkah-langkah sebagai berikut:

Update daftar repositori

sudo apt update

Edit file environment/konfigurasi boot

cd /boot/
sudo nano orangepiEnv.txt

Tambahkan overlay

overlay_prefix=sun50i-h616

Reboot orangepi

sudo reboot

Cek apakah bus i2c sudah muncul

ls /dev/i2c-*
/dev/i2c-3 /dev/i2c-4 /dev/i2c-5    # Contoh output

Hubungkan perangkat i2c anda ke header, lalu cek apakah sudah terbaca

 
i2cdetect -y 3
# Misalnya saya pasang LCD i2c, maka hasilnya seperti ini
 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

LCD i2c saya terbaca di alamat 0x23.
Jika belum berhasil, bisa tulis pertanyaan di kolom komentar. Terima kasih, semoga membantu.

Leave a Reply

Your email address will not be published. Required fields are marked *