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
3answers
37k 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 ...
3
votes
2answers
201 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. ...
4
votes
1answer
4k 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 ...
2
votes
1answer
3k views

Raspberry Pi Current & Voltage Sensors (10A rating and ~40V respectively)

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 ...
1
vote
3answers
525 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 ...
29
votes
4answers
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?
2
votes
3answers
9k 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 ...
2
votes
3answers
590 views

Options to add 20 UART to RPi

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 ...
9
votes
2answers
8k 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 ...
13
votes
2answers
21k 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?
3
votes
1answer
878 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 ...
3
votes
1answer
8k 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'...
1
vote
3answers
180 views

How to interface more than 10x ADS1115 a raspberry pi?

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 ...
13
votes
4answers
25k 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 ...
10
votes
2answers
3k 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 ...
12
votes
2answers
17k 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 ...
5
votes
4answers
5k 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/...
2
votes
4answers
6k 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 ...
2
votes
3answers
2k 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 ...
1
vote
1answer
6k 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 ...
3
votes
2answers
380 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 ...
3
votes
2answers
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. ...
2
votes
1answer
183 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....
1
vote
1answer
362 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 ...
13
votes
3answers
56k 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 ...
6
votes
2answers
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. ...
10
votes
1answer
3k 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 ...
6
votes
3answers
9k 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 ...
5
votes
1answer
6k 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?
3
votes
3answers
2k 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 ...
2
votes
2answers
3k views

How to use Rpi3 to receive I2C data from Arduino-based sensors

I am trying to format data from several Arduino-based systems so my Rpi3 can display it as a web page. But the Rpi3 seems to only work as an I2C master, and the Arduinos have little memory in which ...
7
votes
2answers
19k 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 ...
6
votes
2answers
2k 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 ...
4
votes
2answers
7k 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 ...
2
votes
2answers
393 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,...
2
votes
3answers
15k views

How can I use a LCD display with a I2C adapter?

I'd like to try to communicate to a 16x2 LCD display, however whole docs I found assume I should connect the whole pin-out however I got some kind of I2C adapter from mjkdz.com which makes a 4 pin ...
2
votes
2answers
2k 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 ...
1
vote
1answer
1k views

smbus/I2C sensor returns fixed data

I am attempting to use a sensor in conjunction with a raspberry pi smbus. When I try and read a specific byte of data, it returns 181. No matter what byte you tell it to read it returns 181, ...
6
votes
1answer
6k 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 ...
5
votes
1answer
1k 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 ...
4
votes
4answers
20k 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....
3
votes
1answer
1k views

Has anyone successfully used I2C repeated starts on the PI2? My scope says they are broken

I've looked at all the info that I could find on I2C repeated starts, and I tested a simple example that uses ioctl calls with the standard two message structure required to cause a repeated start: ...
3
votes
1answer
3k views

Rpi Python 1-Wire File System to read DS2482 I2C to 1-Wire bridge connected DS18B20 Temperature Sensors

I'm currently working on the project with a lot of DS18B20 Digital Thermometer Sensors. For a better performance I decided to use this Raspberry Pi compatible 1-wire master board, which is based on ...
3
votes
1answer
419 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 ...
3
votes
1answer
231 views

I2C device inside case + GPIO ribbon outside case

I have a model B in a nice prefab case with a slot through it to connect a 26-wire ribbon to the GPIO header. However, I'd like to leave a small I2C based device inside the case as well. I've ...
2
votes
1answer
708 views

Model B+ i2c issues with 7 segment display

I purchased a 4 digit 7 segment display from adafruit and got it working on my old model A running adafruit occidentalis operating system. I recently bought a model B+ and installed the latest version ...
2
votes
2answers
206 views

How can Rpi4B select multiple ADS1115 ADCs using PCA9546 / TCA9548A I2C multiplexer?

I have a PCA9546 i2c multiplexer hook to my raspberry pi under it are 4 ads1115 i2c ADC. My first main problem is how do you switch the address of the i2c in python the sample code that i have seems ...
2
votes
1answer
467 views

py532lib - i2c - Working But Too Many Files Open After A While

I'm successfully reading data from my NFC tags with the py532lib, using the i2c connection, put out by Hubcitylabs 5 years ago. https://github.com/HubCityLabs/py532lib/blob/master/py532lib/i2c.py ...
2
votes
1answer
564 views

Not all devices that are connection via I2C are showing

I have linked this chip to my raspberry pi. I used these instructions to do it then installed everything I was told to install using these instructions. For some reason only two of the devices are ...
2
votes
0answers
4k views

Daisy Chaining MCP23017 & Addressing

I'm looking to daisy chain multiple MCP23017 chips (upward of 10) to essentially give me more IO to play with from my Pi. I've started to work on the circuit diagram, but I'm really lost with all ...