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
1 vote
1 answer
580 views

Raspberry Pi shows all I2C addresses in use while nothing is connected

I've been building an autonomous boat with a raspi zero, and today I added a new i2c device. I first disconnected two other I2C devices I had attached. I then used i2cdetect -y 1 to verify that no ...
  • 277
1 vote
0 answers
625 views

Pigpio for I2C slave on Pi Zero and the timing of data from the master

I'm using the pigpio library through pigpiod running on a Rpi Zero configured as a slave. The master is an ATMega328PB. On the Pi I am testing using a modified version of the python script provided in ...
0 votes
2 answers
3k views

How to interface MLX90614 temperature sensor with Raspberry Pi

I have a mlx90614 sensor and I am interfacing it with raspberry pi 3 B+. I am using adafruit library python. Below is the code: import Adafruit_GPIO.I2C as I2C I2C.require_repeated_start() class ...
  • 430
2 votes
0 answers
143 views

Enabling software i2c causes boot failure

I have a Raspberry Pi 4 model B, fresh installation of Raspberry Pi OS. I am trying to use software i2c to get around the clock stretch bug in the broadcom 2835 chip. I edit /boot/config.txt to ...
0 votes
2 answers
392 views

I2C Device Registered on CLI but not in Python

I have a JANSANE 16x2 1602 LCD I2C that i purchased and am trying to run on a raspberry pi 3 b+. Following this tutorial https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-...
  • 11
0 votes
0 answers
837 views

BMP180 OSError: [Errno 121] Remote I/O error

At the moment I am trying to get readings of pressure from a BMP180 on a Raspberry Pi (OS : Noobs) So far, I have been successful with connecting the device with the pins and the I2C is detecting the ...
  • 1
2 votes
1 answer
372 views

SSD1306 I2C 0.96" OLED Rpi Interface Problem

I have a Raspberry Pi 3B+ running Raspbian Stretch Lite. I also have an SSD1306 0.96" OLED display. Sometime ago, I had written a simple lightweight library for using this OLED with arduino over i2c. ...
0 votes
0 answers
224 views

Problem I2C when using BH1750 photoresistor

(Raspberry Pi 2, model B, V1.1 - buster OS - all updated / upgraded - smbus loaded on) Hi, I am quite new to the Raspberry Pi and recently I have hit a brick wall. I am trying to link the Raspberry ...
  • 1
0 votes
1 answer
813 views

edt_ft5x06 touchscreen probe failed with code -121

I am trying to get ER-TFTM070_5 display with capacitive touch screen to work. I hae gotten as far as getting the screen it self to work. Now I am facing a challenge to get the touch screen digitiser ...
2 votes
4 answers
333 views

connect multiple temperature sensors to rpi

I need to connect multiple temperature sensors to my RPI. can you, please, elaborate whether/how can this be done with this or this unit? or can you suggest other unit? I need to measure temp on the ...
  • 117
2 votes
0 answers
80 views

Problem in initiating i2c driver module for bmp180 i2c based sensor at kernel level

For leaning purpose i am writing a i2c client kernel module for bmp180 pressure sensor. My kernel code is -> #include <linux/version.h> #include <linux/module.h> #include <linux/init....
2 votes
2 answers
1k views

I2C interface not detected

I have a Raspberry Pi 4B and I'm trying to hook it up with a 4x20 character LCD using a PCF8574T-based I2C interface. The interface operates at 5V so I'm also using a logic level converter. It would ...
5 votes
3 answers
477 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 ...
3 votes
3 answers
11k 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 ...
3 votes
0 answers
689 views

Controlling a laser rangefinder via the raspberry pi

First, a disclaimer that I am an electronics newbie. I got my hands on a laser rangefinder which looks very similar to this: On the top left corner, there are two sets of pins. The first set has ...
  • 31
2 votes
1 answer
918 views

How to write 16 bit data to device address using the i2c wiringpi lib

I am trying to write 16 bit data to i2c device . As there are no registers specified to write to the slave device, I am not able to use the built-in wiringPiI2CWriteReg16 Api. Can some one guide me ...
1 vote
0 answers
103 views

Selectively disable i2c on Rasbian Buster

I want to disable i2c0 while keeping i2c1 active. Everything I can find either disables or enables both, but I haven't found a way to only activate one of them.
  • 141
1 vote
1 answer
392 views

VL53L0X error: "API Status -20: Control Interface Error" [closed]

I had a working prototype which detects distance. Plugged it in yesterday and it keeps giving me an error: API Status -20: Control Interface Error. I checked up i2cdetect and I'm getting the output:...
  • 111
1 vote
0 answers
456 views

Trouble Detecting Devices on Added I2C Buses

I decided to add additional i2c buses to my raspberry pi 4 through the use of gpios and overlays. I first came across this idea from this post by the instructables. Through editing the config.txt file ...
1 vote
1 answer
519 views

Can I Re-Purpose My I2C EEPROM Pins to Act Like SDA/SCL Pins?

Somehow during an experiment, I managed to wreck my i2c SDA and SCL pins on my raspberry pi (pins 3 & 5). I was considering converting two of my gpio pins into another i2c bus, but I thought it ...
0 votes
0 answers
279 views

Elapsed time on function

I am getting a bit of confusion when it comes to getting the run-time of a function I have that gathers data and stores it for me. I have written code for a sensor connected to a raspberry pi zero and ...
0 votes
0 answers
120 views

C++ Code not compiling of RPi after upgrading from Wheezy to Buster

I am getting the error: ‘i2c_smbus_write_byte_data’ was not declared in this scope when trying to compile GPIO code. I have a clean install of Buster (I had accidentally corrupted Wheezy). On Wheezy, ...
2 votes
1 answer
315 views

Direct reading from i2c

I am attempting to increase the frequency at which I read samples from the I2C dedicated pins. I have attempted this through the wiringPi library (C code), from which I reached just about 900Hz. As ...
0 votes
1 answer
210 views

Rpi4B python I2C AK8963C magnetometer sensor troubleshooting problem

While attempting to read data from an ak8963c sensor board over i2c I am only getting 0s as a response except when reading the first 2 registries. I have checked my connections and tried other devices ...
3 votes
4 answers
12k 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 ...
  • 656
1 vote
1 answer
934 views

Is it safe to power 5V display from 3.3V line from GPIO?

I want to use I2C 20x4 LCD with my Raspberry Pi. It works when powered from 5V line of GPIO, but works also when powered from 3.3V line. I know that this display in fact is designed to work powered ...
  • 19
5 votes
2 answers
1k views

Raspberry PI as I2C slave - problem sending data back

First, I read Raspberry as an I2C SLAVE and followed everything in there. Great thread. However, this thread does not address anything about sending data back. This is the scenario: rPI4 as master, ...
1 vote
2 answers
500 views

PN532 I2C read different Sectors with custom key

I am using the PN532 NFC Board. It's connected via I2C to my Raspberry Pi. I am looking for a library/Script which gives me any Sector of a Mifare Classic NFC card. I only can find the normal ...
  • 63
0 votes
0 answers
216 views

Can we implement a protocol other than spi on Raspberry Pi?

Pi supports SPI, I2C and UART by default. Can we implement any other protocol like MDIO into it? If yes, how do we do it?
  • 11
1 vote
2 answers
183 views

Rpi Controlling MPU9250 Accelerometer 20 Metres Away

I am doing a project which require an mpu9250 accelerometer to be connected to a Raspberry pi. Both are kept at a distance of 20m apart. What is the easiest way of data transfer without losses?
2 votes
4 answers
187 views

Why is my relay switching on automatically when I start my program?

I'm building a little automated hydroponics system using a raspberry pi zero, a 5 volt relay, a pump and a soil moisture sensor from adafruit. So far everything is working, I can pull the pin to high ...
1 vote
0 answers
40 views

Can we use pin 3 and 5 for rtc clock module and for detecting input from push button while both are connected?

I have my project where all the GPIO pins of raspberry pi have been utilized. Now I want to add an rtc clock module to the RaspberryPi. Pin 3 and 5 are already connected to the push button in input ...
0 votes
0 answers
70 views

How to build and use the kernel of the Rpi I2C to 1-Wire Bridge DS2482?

Like the post on Oct 2013 by AnyNC I to would like to use the DS2482 module in a C program on my Pi but I'm unsure how and where to get further information on this. All the reply links to his post ...
  • 1
4 votes
2 answers
2k views

Proper way to bit bang I2C

As already mentioned in this question Reading and writing with smbus package, there are chips that, apart for standard SDA and SCL lines, use a third communication line. This means that this "...
  • 429
1 vote
0 answers
950 views

I2C devices on docker container

I am running a docker container on Raspberry Pi 3 and I am trying to read from an I2C device from the container. When I use i2cdetect inside docker I can see the devices. The run option I use is sudo ...
0 votes
0 answers
62 views

SDA/SCL values of accelerator VALUES get affected when I use other pins

Essentially the SDA/SCL reads the I2C values of the accelerometer perfectly fine when no other pin on the pi is active. I have connected 4 drone propellers and whenever I give thrust to them by ...
  • 101
0 votes
0 answers
144 views

Voltage amplifier for pwm output

I am trying to use the PCA9685 to power a regular desktop pc cooler fan, the idea being to later be able to freely adjust the fan speed depending on the pwm set in the pwm driver.(similar to this) On ...
2 votes
2 answers
2k views

Multiple i2c with same address

I have tried to look in various foruns but couldn't find the solution for my problem. I'm trying to build a project where I have to use three VEML6070 sensors... These sensors obviously use the same ...
1 vote
0 answers
676 views

Raspberry 3 model B v2 I2c slave, ESP8266 I2c master

I try to learn I2C with goal : read my ESP8266 events (I2C master) from my Raspberry 3 model B v2 (I2C slave). I use the Arduino Wire library on the ESP and python pigpio lib on the Raspberry. ...
  • 2,107
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 ...
  • 141
2 votes
2 answers
1k 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 ...
  • 656
0 votes
0 answers
124 views

MMA845X Accelerometer outputs the same values constantly

This is my code: import time import Adafruit_GPIO.I2C as Adafruit_I2C import struct from math import * # Registers OUT_X_MSB = 0x01 CTRL_REG1 = 0x2A XYZ_DATA_CFG = 0x0E i2c = Adafruit_I2C.Device(...
  • 101
0 votes
0 answers
148 views

i2cdetect show bus is different every time

I am use ToF sensor(VL53L0X) on my Raspberry Pi's GPIO,I discover one problem about VL53L0X. I am input command i2cdetect -l It's show i2c-1 i2c bcm2835 I2C adapter I2C ...
  • 1
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 ...
0 votes
0 answers
373 views

Connect two PCF8575 to I2C bus

I have two PCF8575 breakout boards that I would like to connect to my Raspberry Pi 3B+ running Debian Buster kernel version 4.19.75-v7. Since both have the same address (0x20), I need to create a new ...
  • 1
-1 votes
1 answer
279 views

Choosing the pull-up resistor value for i2c that can cater up to n-number of modular devices

Hello i have designed a modular shield like value that uses the i2c buss of the raspberry but i do not know what resistor value for the pull ups to use. most guides tells us to use a safe 4.7k ...
  • 656
1 vote
1 answer
567 views

How can you use pigpio's set_servo_pulsewidth with an i2c address?

I've tried to use hexadecimal for the GPIO address to see if it would work with GPA0 on the MCP23017 import pigpio import time pi = pigpio.pi() gpio_num = 0x21 while True: pi....
3 votes
3 answers
2k views

GPIO vs I2C SMBUS2

This example scans for any I2C slave address current on the I2C bus. (I am using a RPi 3B+ with raspbian buster from september release) Script trial_smbus.py: from smbus2 import SMBus channel = 1 ...
  • 133
2 votes
1 answer
464 views

I2C works but gives wrong value

I have an RPi3b (Master) wired up to an MCU (Slave) communicating via I2C. I did have an RPi1b wired up and upon which I did my first development (cheaper to accidentally fry). Suddenly I'm getting a ...
-1 votes
1 answer
601 views

How do I read all registers of an INA219 sensor via SMBus in Python at once?

I'm trying to Connect my Raspberry Pi 3B+ with a Raspbian 10 to an INA219 current sensor (that also returns voltage and a premultiplied power) via SMBus in Python 3.7. After destroying one Raspberry ...

1
3 4
5
6 7
16