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
0
votes
0answers
17 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
0answers
13 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
1answer
48 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
1answer
44 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 ...
1
vote
3answers
178 views

What is the max i2c speed of the raspberry pi 4?

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 ...
1
vote
1answer
54 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 ...
3
votes
1answer
65 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
2answers
55 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 ...
0
votes
0answers
43 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?
0
votes
0answers
42 views

Why is i2c-bcm2835 trying to use GPIO pin 2

I am trying to understand, why is i2c-bcm2835 trying to use GPIO pin 2. As shown below. [ 4.256474] gpio-28 (ffffffff.i2c): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ ...
1
vote
2answers
61 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
4answers
78 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
0answers
21 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
0answers
12 views

DS2482 kernel example / usage

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 ...
4
votes
2answers
197 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 "...
1
vote
0answers
83 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
0answers
36 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 ...
0
votes
0answers
47 views

RaspiCam IVPort Dual Camera Multiplexer failure

I'm trying to design an RPi based system that should switch between two raspberry cameras. I just need to switch between the two cameras I don't need to mix their frames in any way. Moreover, in the ...
0
votes
0answers
44 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
2answers
145 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
0answers
101 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. ...
3
votes
2answers
273 views

SSD1306 OLED I2C Detection 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 ...
2
votes
2answers
150 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 ...
0
votes
0answers
39 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(...
0
votes
0answers
31 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
vote
1answer
336 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
0answers
53 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 ...
0
votes
1answer
33 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 ...
0
votes
0answers
30 views

Customize i2c driver - Change i2c line speed

For the BCM2835, what I would like to do is the following: I want from the user space to be able to change the I2C bus line speed, not just by modifying the CDIV field of the DIV register (Reference), ...
1
vote
1answer
67 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
3answers
314 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 ...
2
votes
1answer
79 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 ...
0
votes
0answers
112 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
vote
0answers
125 views

Raspberry pi with 1.3" oled i2c screen

I'm currently trying to use this 1.3" i2c oled screen with the Adafruit oled i2c library, but I'm currently getting this issue: I have made sure to run the setup.py and all of the code is the same. ...
1
vote
1answer
158 views

i2cdetect shows all blanks or UU

I am facing a difficulty using MCP23017 with raspberry pi (stratodesk OS). I would like to know if I missed any configuration to get MCP23017 working my config.txt file: dtparam=i2c1=on, dtparam=...
0
votes
2answers
71 views

I2C Usage difference in Arduino and WiringPi

I'm using a device through I2C interface and I'm having some issues when the I2C bus fails, I don't know if it fails because an interferance in the cable or just timing issues in the Raspberry over ...
0
votes
1answer
196 views

Pi Zero W: Second i2c Bus

I did a really stupid mistake - I set up a second i²C bus months ago, so I have two gyro sensors connected - but din't document it. I can see the connected devices with i2cdetect -y 1 and ...
0
votes
2answers
352 views

I2C MPU9250 Gyro/Accelero/Magneto 9-DOF Sensor MicroPython Programming Problem

so I've recently set up my raspberry pi. Am following a tutorial for the MPU9250, from https://github.com/tuupola/micropython-mpu9250. I have did a install of the micropython-mpu9250, and tried the ...
0
votes
1answer
45 views

how can I know the current i2c speed?

I could not find this information anywhere. Where can I find the current i2c speed? It's not in dmesg, and in /sys/module/i2c_bcm2835/parameters/ I only have a file called "debug".
1
vote
1answer
451 views

WiringPi and ADS1115 C/C++ sample programs

I am trying to create c++/c program to AnalogRead using and ADS1115. I have seen that wiringPi has support for ADS1115 but i could not find any sample program to start with. Can anybody link guide me ...
0
votes
0answers
89 views

ADS1115 change i2c address and speed in python

Hello i am using a custom raspberry pi shield on my raspberry pi 4. Currently Im testing only 1 shield with 4 ads1115. In python im using adafruits library to read the data and it can only sample 50x ...
0
votes
0answers
51 views

i2cdetect detects the device but also shows a full row of addresses

I have successfully setup a RTC clock ( DS3231 ) on a RPi zero. The whole process was explained here. It works as expected but with only a minor difference: Row 5 is filled with numbers from 0x50 to ...
2
votes
1answer
34 views

How to securely share linux devices from client to another linux server

I have 3 I2C devices connected to my raspberry pi 3 i2c bus 1. I want to share this whole I2C bus 1 (/dev/i2c-1) to another linux server, which is running in the cloud, through a secure TLS, username ...
1
vote
3answers
147 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 ...
0
votes
1answer
75 views

Slaves on i²c bus aren't detected

I'm currently trying to get multiple i²c slaves with the same address working without the use of a multiplexer on a PI Model 3b. I followed this instrutable for the creation of a second i²c bus: cd /...
2
votes
1answer
99 views

Need advice for connecting multiple arduinos to raspberry pi

I have a project in hand where I need to connect 5 arduinos as slaves to Raspberry Pi. Load Cells, Reed Switch, Solenoid lock will be connected to each of the arduino. The arduinos need to send the ...
0
votes
0answers
82 views

Issue with I2C communication with raspberry pi and arduino

I am new to I2C communication and python coding so please bear with me if my question is naive or my code looks very bad. I am able to achieve I2C communication between raspberry pi and arduino and ...
1
vote
2answers
314 views

How to physically wire two I2C sensors' SCL/SDA signals to a single I2C bus?

I need to connect two sensors like this https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRDDlL2AK_eYo9BKbImJcekMZ0PgIYC2GL0OLIMVGzkWAtq54zG to rpi 3 b. I found that it is not a problem and ...
2
votes
2answers
323 views

Adding I2C Bus with dtoverlay Does Not Show Up in i2cdetect

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,...
0
votes
1answer
118 views

How to access BCM i2c registers? i2c speed halves on raspbian buster (Zero W, Pi 3 B, Pi 4 B), fine on raspbian stretch

I have a problem with I2C clock in Raspbian Buster (using either SMbus or i2c-dev). It defaults to 50 kHz on RPi 4B and to 62.5 kHz on RPi 3B and Zero W. However, if I set the speed i2c_arm_baudrate=...

1
2 3 4 5
12