Questions tagged [i2c]

I²C stands for Inter-Integrated circuit, and is a data transferation system that allows connections between computers or microcontrollers and low-level peripherals (e.g. sensors or EEPROMS). It is a multi-master, multi-slave, single-ended, serial computer bus.

Filter by
Sorted by
Tagged with
19 votes
3 answers
38k views

Firmware 3.18.x breaks I²C, SPI, audio, lirc, 1-wire (e.g. /dev/i2c-1, No such file or directory)

I am using I²C to control a Bright Pi module. I followed instructions from 'Configuring GPIO - Adafruit' and 'Configuring I²C - Adafruit' to set up the I²C. I have done this a few months ago and ...
LittleOne's user avatar
  • 293
2 votes
2 answers
9k views

Rpi Current Sensing Using ACS712 and INA219

I've been searching through multiple forums, and gone to different links online trying to find a "cheap" solution to my question. I am currently trying to monitor the current and voltage of an ...
Aly Abed's user avatar
3 votes
2 answers
1k views

Using bypass capacitors to reduce voltage spikes and noise causing I2C read/write errors

I'm trying to communicate with an old i2c device and I'm getting wrong read values, and possibly even some incorrect write values too. My logic analyzer shows random highs in the middle of a low. ...
vaid's user avatar
  • 371
3 votes
4 answers
2k views

Multiple Rpi Serial Ports Problem

So I am undergoing a project where I will need to add 20 UART (RX/TX) to a single raspberry Pi 3. Each device runs at 9600 After looking at the pi, I found it only has 1 UART on it. What would be ...
jLynx's user avatar
  • 133
4 votes
2 answers
5k views

How do I use the I2C bus?

I want to attach an I2C device; it has 4 lines (SCA, SDL, +, -). I understand I can connect the first two to pins 3 and 5, and the last two to various places. I also understand I can multiplex the ...
goldilocks's user avatar
  • 58.5k
1 vote
4 answers
2k views

How can Rpi3/4 interface multiple ADS1015/ADS1115 ADCs?

Hello i am creating a shield for raspberry Pi 3/4 and in need of a lot of analog pins to read 30 sensors. and since the shield can only fit 5 sockets of the connector i am using i need to use 2 ...
Jack's user avatar
  • 686
3 votes
4 answers
14k views

What is Rpi's I2C Maximum Speed?

The raspberry pi 3 B has a fixed i2c speed of 100kHz because of productions errors. I assumed that they have fixed it in the new version Raspberry pi 4, but of course there have been newer standards ...
Jack's user avatar
  • 686
32 votes
4 answers
34k views

How can I use I2C to talk to sensors?

How can I talk to digital sensors over the I²C interface? Hardware: Which pins on the Raspberry Pi's GPIO can I use? Software: What I²C libraries are available?
Alex L's user avatar
  • 7,595
15 votes
2 answers
21k views

Raspberry as an I2C SLAVE

Does anyone know how to setup a Raspberry Pi 3 as an I2C slave (in C++)? Before someone answers saying that it's not possible, it is possible. Here is a link that says it is possible (pigpio ...
Sebastião's user avatar
3 votes
2 answers
2k views

Rpi3B SSD1306 OLED I2C Interface Problem

I know there are similar questions, but none of them helped me out. I have a Raspberry Pi 3 Model B Rev 1.2 and Raspbian 10 installed. I try to connect an 0.91" Oled display (Hardware Details) which ...
bernhardh's user avatar
  • 141
2 votes
3 answers
11k views

I2C: Raspberri pi as a Slave

I am trying to make two raspberry pi communicate through I2C protocol. I got little information that how I can code as a master in C using i2c-dev.h. So my question is how to make one of my raspberry ...
duslabo's user avatar
  • 191
15 votes
2 answers
25k views

How to make raspbian load the i2c-dev module on boot up

I have installed 2012-07-15-wheezy-raspbian, and the i2c-dev module and i2c_bcm2708 are there and work with i2c-tools. How do I get the i2c-dev module etc. to load at bootup?
John La Rooy's user avatar
  • 11.9k
10 votes
2 answers
4k views

Controlling 400 LEDs from a raspberry pi

I have a client who has several large bronze signboards, each with 100-150 little light bulbs on it, totaling approximately 400 bulbs. The bulbs are turned on and off on a schedule, currently by hand ...
Moshe Katz's user avatar
3 votes
1 answer
1k views

Filtering noise w/ pi as FM transmitter and sound source

I have an I2C FM transmitter for the pi; it has a 3.5mm stereo jack for input. Everything works great -- I attached a short dipole antennae and get clear reception for at least 25'. However, if I ...
goldilocks's user avatar
  • 58.5k
3 votes
1 answer
9k views

I2C cable length and type

I have made some tests with a temperature sensor tmp102 connected with 1m long cables and it works great. Now I am wondering if I can use a 10m long cable and if yes, what type of cable shall I use? I'...
Penbeuz's user avatar
  • 143
2 votes
1 answer
13k views

Rpi Python I2C IOError: [Errno 121] Remote I/O error Problem. How to fix it?

I am trying to read analog data from a potentiometer using I2C connection between the pi and adc board using python code. Below is my code so far: import time import smbus bus = smbus.SMBus(1) bus....
Yukti Kathuria's user avatar
1 vote
2 answers
1k views

Rpi interfacing MCP4725 12-bit DAC pproblem

I am using raspberry pi 3. I am trying to run the AC induction motor for that I want an analog pin. In raspberry pi model doesn't have an analog pin. All pins are digital IO pins. So I have tried MCP ...
uvan's user avatar
  • 13
13 votes
2 answers
18k views

How to use a DS18B20 temperature sensor in my Pi?

I have a few DS18B20 temperature sensors. These are normally used in Arduino projects, but I don't see why not to use them with a Pi. There is a software called DigiTemp that seems to drive the device ...
Tomas's user avatar
  • 273
12 votes
4 answers
28k views

Is there an I2C Library

Is there a simple library to talk to I2C for C++? I have found some stuff for python and Java, but I wanted C++. I was hoping someone has ported the Arduino Wire library so I could use code I have ...
kevin's user avatar
  • 1,294
5 votes
1 answer
2k views

Does the Raspberry Pi support I2C multi-master configurations?

We are using Raspberry Pi 2 single board computers for test automation (they run our feature test against an actual DUT). Our Device Under Test (DUT) uses I2C multi-master mode to communicate with its ...
Arno Moonen's user avatar
5 votes
4 answers
6k views

Read data from Si7021 via I2C

I have an Si7012 temperature / humidity sensor attached to the i2c pins on my Raspberry Pi. Specifically, I have the Adafruit "break-out" with this sensor attached https://www.adafruit.com/product/...
Brick's user avatar
  • 1,377
5 votes
3 answers
521 views

What hardware peripherals might be capable of reading 6.144, or better yet, 9.216 megabits/second?

I'm hoping to interface a Raspberry Pi 4 with an 8 channel, 48 kHz ADC. Ideally a 24 bit ADC, which if my math is right means 9.216 megabits per second. But a 16 bit ADC would be acceptable: that ...
Phil Frost's user avatar
4 votes
2 answers
2k views

Raspberry pi GPIO extension

I recently started using rasperry pi. I am trying to do some home automation and controlling toy car motors. I am able to control the motors and 2 plug points. I wanted to control more servo motors. ...
venu's user avatar
  • 61
4 votes
2 answers
9k views

Connecting multiple devices via I2C

http://www.modmypi.com/raspberry-pi/breakout-boards/adafruit/adafruit-pwmservo-driver-16-channel-12-bit-pca9685 How do I connect two I2C devices to my R Pi? Specificaly 16 Channel 12 Bit PWM Servo ...
sixtyTonneAngel's user avatar
3 votes
3 answers
12k views

How can Rpi read the MAX30100 / MAX30102 Oximeter?

I want to connect the sensor max30100 to the Raspberry Pi board.I think everything is accurate.When I run the code, the red light flashes.I activated I2C.max30100 device address 0x57 is detected. When ...
saeed sadati's user avatar
3 votes
1 answer
813 views

Strange I2C behaviour

First of all: sorry for the title, I don't know how to describe further... Background: I'm working with the RDA5807M FM receiver chip. It worked fine for at least one month now. I just had jumper ...
linusg's user avatar
  • 432
2 votes
4 answers
8k views

How to read a long int via i2c?

I tried to connect an Arduino Uno with my Raspberry using the i2c bus, with code and wiring suggested here. This example is sending only one byte from RPi to Arduino and back, and everything works ...
gtatr's user avatar
  • 524
2 votes
3 answers
3k views

Reading and writing with smbus package

I am trying to read/update I2C address of a device. However, in order to do that during the communication state of pin LDAC has to be changed, as shown in the manual: Is that possible to do with ...
Pygmalion's user avatar
  • 448
2 votes
2 answers
3k views

How to install RTC on RPi3 with Kali Linux as OS?

I am using Raspberry Pi3 B with OS: Kali Linux Kernal: 4.1.19-v7 RTC: DS3231 Real Time Clock I configured I2C manually following the instruction here. Steps I did: Install the i2c-tools utility ...
haccks's user avatar
  • 173
2 votes
2 answers
4k views

Setting up multiple I2C buses using dtoverlay

I am trying to set up multiple I2C interfaces on my pi. I have added the following lines to my /boot/config.txt and rebooted: dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=29,...
Tmello225's user avatar
1 vote
1 answer
1k views

Is there an easy way to share the power and I2C GPIO pins between multiple sensors without soldering?

I'm trying to connect multiple sensors to the Power and I2C pins of the GPIO header of a Pi 3B, but I can't find an easy way to do it using the standard plug-in jumper cables that are often used for ...
Metamorphic's user avatar
1 vote
2 answers
3k views

How to connect two BME280 sensors via I2C to a Raspberry Pi 3B+

I have a Raspberry Pi 3B+ and I bought two BME280 sensors (specifically these) and I would like to connect them via I2C. I read that you can do software multiplexing but all the information I am ...
Mark Cilia Vincenti's user avatar
1 vote
1 answer
7k views

How to get pin addresses on a MCP23017

Recently I purchased a few MCP23017. I've been reading up on them and I've gotten a few lights to turn on and such. I am having a problem trying to understand how to figure out the register address ...
Joe Jankowiak's user avatar
0 votes
2 answers
119 views

How can i set up my owm serial communication between two Raspberrys?

i have following Problem: I have A raspberry Pi 3B+ with a Touchscreen, which uses every Single Pin on the 40Pin GPIO header. The only thing i have is a i2c breakout on my Touchscreen. But i have the ...
manintree's user avatar
14 votes
3 answers
57k views

Safest way to connect Raspberry Pi to Arduino Uno R3

I am working on a robot using an Arduino Uno R3 and I wanted to have the ability of controlling the Arduino wirelessly, like stopping the Arduino without having to pull the power-plug every time. I ...
RPiAwesomeness's user avatar
13 votes
4 answers
27k views

Meaning of cmd param in write_i2c_block_data

I am testing i2c communication between Pi and Arduino. The doc says: write_i2c_block_data(addr,cmd,vals) Block Write transaction. int addr,char cmd,long[] None I have this test: On Pi: ...
Gus Smith's user avatar
  • 133
10 votes
1 answer
5k views

Pi 4 I/O interface options... and where to find them

The BCM2711's hardware documentation lists multiple I/O interface options. Among others these are: up to 6 × I2C, up to 6 × UART (muxed with I2C), up to 6 × SPI (only five exposed on Raspberry Pi ...
Ghanima's user avatar
  • 15.8k
8 votes
2 answers
21k views

What bitrate can I get from an i2c bus?

In short, what is the maximum bitrate that can be achieved writing to an I2C bus from a Raspberry Pi? Should it be the theoretical maximum of 100KB/s? In more detail, I'm writing to an I2C bus from ...
user7015's user avatar
  • 183
8 votes
4 answers
8k views

PoE hat fan activation on OS other than Raspbian

I'm aware that the only officially supported OS that the PoE hat works on is Raspbian. I can confirm that both my hats work, and that the fan does switch on and off if I have Raspbian installed on the ...
Larnu's user avatar
  • 185
6 votes
2 answers
4k views

PREEMPT_RT and RPi Drivers

I'm planning to do some realtime control loop tasks with the RPi. In this post PREEMPT_RT and Xenomai were proposed. I'm thinking about trying PREEMPT_RT, as I'd like to keep it as simple as possible. ...
fabb's user avatar
  • 283
6 votes
2 answers
7k views

Can we use other GPIO pins as I2C

I would like to connect multiple I2C devices to my Raspberry Pi. Can I do that? What do i need to take care? Also is there any library which will output I2C on other GPIOs?
KMP_a learner's user avatar
6 votes
2 answers
3k views

How to setup a MCP79410 real time clock?

I was trying to set up a MCP79410 real time clock (RTC) and had to search quite a bit until I found a way to integrate the RTC's time signal into my Raspbian Jessie: Apparently, even there, some ...
Fantilein1990's user avatar
6 votes
5 answers
15k views

How to allow I2C access for non-root users?

How do you allow non-root users to access I2C on the Raspberry Pi 2? I've compiled this code for accessing an MPU6050 sensor via I2C, and it works perfectly, but only when I call it via sudo. I ...
Cerin's user avatar
  • 2,261
6 votes
1 answer
9k views

Raspberry Pi as slave

I am using a Pi compute module and wish to make two of them to communicate to each other. I have hooked up some slave I2C devices to it (RTC, Temperature sensor). So I don't think making Pi as slave ...
Dennis's user avatar
  • 383
5 votes
4 answers
22k views

How can I automatically update the hwclock with NTP when I have internet connection

I'm using an RPi with Raspbian which runs the NTP-daemon by default. I have connected an rtc-ds1307 external i2c hardware clock. I was following the instructions given here to set it up: http://learn....
Thomas's user avatar
  • 81
5 votes
1 answer
3k views

Is there a python library to allow I2C between Pi (master) and Pico (slave)

I want my Raspberry Pi to control my Raspberry Pico. I'm trying to send bytes of data to the pico and then read the data on the pico so that I can take different actions depending on the data sent (e....
pcoates's user avatar
  • 153
4 votes
1 answer
932 views

I2C baudrate in Raspberry Pi, depends on arm core frequency

I'm using a Raspberry Pi 3, with a Raspberry Pi OS (arm64) official image to communicate with a PMBus compatible device (rpb1600-48 battery charger). I was experiencing communication problems. ...
Federico Ruiz's user avatar
4 votes
4 answers
14k views

Raspberry Pi 3 not detecting i2c device

I've been following a tutorial to hook up an electronic compass that relays info to the Pi via i2c. The only differences between my equipment and the tutorial's is that I am using a Raspberry Pi 3 ...
Patchwork's user avatar
  • 135
4 votes
3 answers
9k views

Raspberry Pi Multiple I2C Busses

EDIT: Other people I've talked to and one poster here (since deleted) have said that they have the same issue while going through the Instructables tutorial to set up multiple I2C busses. There are ...
Murey Tasroc's user avatar
3 votes
1 answer
674 views

Pi locking up trying to use rising/falling edge detection

I have a B+ v1.2, with a motor controller and 2 quadrature encoders setup. It's running Arch: 4.19.69-2-ARCH armv6l. It's completely locking up, requiring a plug-pull when either of the encoders ...
Nick's user avatar
  • 195