How to enable I2C

From Geekworm Wiki
Jump to navigation Jump to search

How to enable I2C funcion on Raspbian:

Please run the following command after you start the Raspberry Pi

sudo raspi-config

Select 5 Interfacing Options and then P5 I2C - Enable/Disable automatic loading. A prompt will appear asking Would you like the ARM I2C interface to be enabled?, select "Yes"

Rpi-config-1.jpg
Rpi-config-5.jpg
Rpi-config-6.jpg

Select "OK"

Select "Finish" to return to the command line and reboot your raspberry pi.

sudo reboot

The Raspberry Pi will reboot and the 'i2c' interface will be enabled.


Then run the following command to check i2c port

sudo i2cdetect -y 1

The following is the I2C address of X729

pi@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- 36 -- -- -- -- -- 3c -- -- -- 
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --    
#36 - the address of the battery fuel gauging chip
#3c - OLED display
#40 - TI INA219 12-bit current/voltage/power monitor
#68 - the address of the RTC chip

PS: Different hardware products may have different I2C addresses

Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #3

4 months ago
Score 0++

on my setup, when i run sudo i2cdetect -y 1

at address 68 it shows "UU" which I assume means unavailable. Is that normal for X728 v2.5?

Harry

4 months ago
Score 0++

Hello.

This is not normal.

UU indicates that the device is used in the driver.

Wondering if you used other external I2C devices? Can you also upload a

physical connection diagram to us? Or contact us at support@geekworm.com

Anonymous user #2

7 months ago
Score 0++
I'm trying to add this to homeassistant os for the rpi. Any suggestions? It's not systems. I'd really like for a backUPS unit to be on my smart home brain.

Anonymous user #1

9 months ago
Score 0++

Minor suggestion:

Even thought the text is clear, the first image appears to suggest that the user follow the menu breadcrumb path of

Advanced Options -> I2C

Which of course does not exist. I would suggest replacing it with an image that shows the item

3 Interface Options Configure connections to peripherals

highlighted rather than what you have now which is

6 Advanced Options Configure advanced settings

Harry

9 months ago
Score 0++
This tutorial has been very clear, but raspberry pi OS is constantly updated, so there will be small differences on the latest version. what should we do?