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.
807
questions
0
votes
1
answer
30
views
I2C R/W to a MLX90640 Thermal Imager on a RPI5
I am trying to interface a MLX90640 Thermal Image camera to a Raspberry Pi5 over I2C using C. The register addresses are 2byte words, so SMBus/ioctl seems unworkable (as it uses 1 byte register ...
0
votes
0
answers
31
views
Grove Shield for RPi Pico doesn't detect one I2C connection
My hardware: I am using RPi Pico W and Grove Shield for Pi Pico. This shield has two female headers for I2C connection: I2C0 and I2C1.
I am also using Grove Pressure Sensor (DPS310).
Here is the ...
0
votes
2
answers
50
views
i2c-tools are installed, but i2cdetect returns "command not found" error
I've got a raspberry pi zero (with a fresh install of the current raspian OS) and I'm trying to find the i2c address of a connected display. When I try to scan for devices using i2cdetect -y 1 I get ...
0
votes
0
answers
28
views
PWM nozzle with Adafruit TIme of FLight Sensor - Nozzle turns fully on after a while
I'm relatively new to this so apologies in advance. I have a raspberry pi4 with a Bete Ehpi pulse width modulatin nozzle and a Adafruit-Vl53l4cd time of flight sensor. Code below is set to control the ...
2
votes
1
answer
94
views
Control multiple push buttons on a raspberry pi using an mcp23017 over C++
Having followed various tutorials on the web (i.e. 1,2), I have made the following connections:
To enhance clarity, I post another picture depicting the connections on the mpc23017 using a cropped ...
1
vote
0
answers
39
views
When trying to unload i2c-bcm2835 module dynamically in raspberry pi I'm always getting the "rmmod: ERROR: Module i2c_bcm2835 is in use"
I made some changes in the i2c_bcm2835.c file and now I want to dynamically load this module, i2c-bcm2835.ko which I got from below,
obj-m += i2c-bcm2835.o
all:
make -C /lib/modules/$(shell uname -...
0
votes
0
answers
33
views
I2C Sensor Returning 0's on Pico but works Perfectly on RPi 3
I'm at my wits end over an ENS160 sensor I have working perfectly with a Raspberry Pi 3 (running full Linux OS and Python), but refuses to return any data when interfacing through a Raspberry Pi Pico ...
0
votes
1
answer
63
views
Troubleshooting Temp/RH Sensor with RPi
I am working off of a Raspberry Pi 4B. I have recently connected this temperature/RH sensor, but I am having trouble to with the python code. This is the datasheet for the sensor (Pg. 11-18 are most ...
0
votes
1
answer
159
views
How to get temperature and humidity data from a Sensiron SHT3X
The more I read, the more confused I become...
I have a SHT30 Temperature And Humidity Sensor. I bought it from Adafroot some time ago, but never found a real use for it. Now that Raspberry Pi has ...
0
votes
1
answer
24
views
Receiving String Data From Secondary Arduino on Main Raspberry PI I2C
I am working on a project where I'm trying to implement 14 RDM630 RFID sensors that will send any recorded RFID tags to the Main RPi. Unfortunately, these sensors use RS232 communication, and it seems ...
0
votes
0
answers
34
views
CQRobot Ocean: MCP23017 IO Expansion Board - "No pull up found"
I've got an IO Expansion board made by CQRobot that I'm trying to get working, but I can't get i2c to initialize. Here's the board: http://www.cqrobot.wiki/index.php/MCP23017_IO_Expansion_Board_SKU:...
0
votes
1
answer
58
views
Crazy acceleration with EVAL-ADXL373Z
I am extremely new to both Raspberry Pi and working with MicroPython (and i2c protocol). When trying to read data from the EVAL-ADXL373 using Raspberry Pi Pico W I get values ranging from 0 m/s^2 to ...
0
votes
2
answers
60
views
Pico W I2C timeout occurs when using multiple sensors on a single bus
I am using to VL53 lidar sensor chips on a single I2C bus.
This specific chip does not have an option to change I2C address through hardware and so I must do it through software. This works and I am ...
0
votes
0
answers
66
views
How to enable Raspberry Pico's I2C0_IRQ and set a callback function using MicroPython?
I need to setup a Raspberry Pico as a I2C Slave device. I know how to do this, but I don't know how to eneble the I2C IRQ and set a callback function on it so I can be notified of the I2C events ...
0
votes
0
answers
37
views
2nd MUX PCA9548A not showing up
Trying to add a 2nd MUX on bus 1 of my Room.
I added the following to the config.txt, essentially duplicating my original MUX with a second one, changing the address:
dtoverlay=i2c-mux,pca9548a,addr=...
1
vote
0
answers
41
views
MCP23017 connected to raspberry pi not showing up until I remove and reconnect SDA cable
I am testing an MCP23017 I2C port extender connected to a Raspberry Pi Zero 2w. I can get i2cdetect to detect the extender only after I remove and reconnect the cable going to SDA (GPIO2). I have to ...
0
votes
1
answer
160
views
I am looking for clarity on how the libgpiod works with higher functions (esp I2C)
I am working on a RPi 5 running Bookworm with C.
Adding the line dtparam i2c_arm=on to the config.txt enables I2C on GP Pins 2/3 accessed through /dev/i2c_1. Reboot to activate. This works fine on ...
1
vote
1
answer
136
views
It is possible to set I2C bus speed programmatically without the bcm2835 library?
All, I've ported a C++ OLED library from the bcm2835 library to use i2c-smbus to prevent having to run the executable as root. (not the best from a security standpoint). However, i2c-smbus and ioctl() ...
0
votes
0
answers
42
views
Connecting multiple sensors, servos, etc. to Raspberry Pi 4 B
Hello everyone 👋
I recently got a bunch of sensors, servos, transmitters, etc. (like literally I have now a hundred of different sensors)
But now, how to connect it all to Raspberry Pi (in my case ...
0
votes
0
answers
52
views
Pi Zero as I2C slave
I'm trying to set up a Pi Zero as I2C slave via the pigpio library. While receiving data seems to work great, sending data is a problem.
When the host asks for data for a given register, the request ...
0
votes
0
answers
46
views
Where is the C file with the I2C functions?
I can find in raspberry pi (5), using Raspbian, in directory /usr/include/linux the files i2c.h and i2c-dev.h. I am looking for the .c files that have the I2C functions and use the header files.
...
0
votes
0
answers
29
views
Does I2C clock also change if system clock is altered? Pi4
SPI clock speed is tied to system clock so for example of the system clock changes the SPI changes. To prevent this you need to prevent power scaling/fix the frequency.
Is this also the case for I2C ...
0
votes
0
answers
68
views
Connect Raspi to touch display via I2C
I have a touch display with a microcontroller. That microcontroller will read the touch data and convert it linux multi touch protocol and send to raspi via I2c.
Hardware is setup properly. Raspi can ...
0
votes
0
answers
28
views
Raspberry Pi Zero detecting too many i2c
After this command in raspberry pi
i2cdetect -y 1
Its detects too many i2cs
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 ...
0
votes
0
answers
21
views
Diagnosing / Debugging I2C comms on the command line
This is sort of a vague question, and I apologize for that. I am trying to gain enough understanding and context to ask a more detailed one. But here goes:
Q: To what extent is the I2C bus self ...
0
votes
2
answers
364
views
BME280 sensor: OSError [Errno 5]
I recently bought a Raspberry Pi 4B along with a BME280 T/P/humidity sensor. I use the bme280 and smbus2 Python libraries to interface with the sensor. For a while it worked pretty well, but yesterday ...
0
votes
0
answers
92
views
Raspberry Pi 4 8GB not booting Rasbian (green led blinking 3 long, 3 short; 3lL/3S - "I2C error - Pi 4")
For starters, this is the exact product I purchased. I'm not from the US and I have little access to RPis, so I bought it during my vacation (around Dez 20).
It's a RPi model 4B, 8GB and what seemed a ...
0
votes
0
answers
75
views
Raspberry Pi 4 - hwclock DS3231 RTC delay at boot
Running a Raspberry Pi 4 with a DS3231 RTC setup.
Everything is setup correctly and working fine and the hwclock is synced correctly.
The unit is running without any internet connection.
The problem ...
1
vote
1
answer
425
views
Why is my measured I2C clock frequency significantly slower than its setting?
I am setting the I2C frequency on the Compute Module 4 (running Ubuntu 22.04.2 LTS) with dtparam=i2c_arm=on,i2c_arm_baudrate=400000. The I2C bus has two parallel 10kOhm pullup (to 3.3V) resistors per ...
-1
votes
1
answer
159
views
Multiprocessing to speed up data acquisition for I2C devices
Here's my situation: I have four FDC1004 devices that I want to have connected to an array of 64 electrodes through four ADG1206 16:1 multiplexers. Each device is slaved to a pi4 using separate I2C ...
0
votes
1
answer
2k
views
I2C Device is not detected
Another issue arises since my last question which I have not solved yet. I am trying to use SGP40 sensor on Raspi4
the sensor has built-in pull up 10k resistors in both SCL and SDA, the sensor VLogic ...
-2
votes
1
answer
337
views
Using 2 SDA and SLC for 2 different sensors
So,
Currently I am using a RTC with my Pi. It takes up the SDA and SCL pins which are GPIO2 and GPIO3.
I now wish to add a Lux sensor. I am using the BH1750 Light Sensor. It too needs to use the SDA ...
-1
votes
1
answer
572
views
ValueError: No I2C device at address: 0x29 (and others) with TSL2591 on raspberry pi zero W with pijuicezero
I am trying to get the TSL2591 outputting values on a raspberry pi zero W with extended pins and a pijuice zero over it. The following code
import board
import adafruit_tsl2591
import time
i2c = ...
0
votes
1
answer
186
views
MCP23017 not seen in the i2c bus
I have a pin multiplexer with a premade board: https://core-electronics.com.au/mcp23017-io-expansion-board-expands-16-i-o-pins.html
My Pi 4 is powered by USB C. The multiplexer is powered with its ...
0
votes
0
answers
126
views
Raspberry pi power up button and i2c devices
I have a ads1115 connected to my i2c pins of the raspberry pi. The i2c pins are pin 2 (i2c-SDA) and pin 3 (i2c-scl).
Additionally i want to power up and shutdown my pi with the WAKE_ON_GPIO. Example. ...
0
votes
0
answers
221
views
i2c LCD Backlight
I have an LCD display that has a backlight (since when I plug it in it lights up). However, using the code below I cant get it to turn on. Any help would be greatly appreciated
import smbus
import ...
0
votes
1
answer
1k
views
Python code cannot detect my i2c address
I would like to ask some opinions regarding i2c communications with pca9685. My i2c1(SDA=GPIO2, SCL=GPIO3) of my rpi 4b is used by my mpu6050, which I had to enable one more i2c channel of my ...
1
vote
0
answers
148
views
PCA 9685 i2c communication issue
I would like to ask a question regarding the usage of secondary channel of i2c in rpi 4b.
I have enabled the secondary channel through adding "dtoverlay=i2c-gpio,bus=2,i2c_gpio_sda=22,...
3
votes
2
answers
677
views
i2c Real Time Clock IC on Raspberry
I am using an industrial device based on a Compute Module Raspberry Pi 3 called Kunbus RevPi Core 3+.
The device is shipped with Raspbian and a pre compiled Image but I would like to install an ...
0
votes
3
answers
44
views
I2C Ievel shifter with no device overloads IDs
Im having a problem with my current project.
I am using a 128x32 oled for stats and an RTC.
I also have a logic level shifter with a plug attached for optinal extention(like lcd, etc) running on 5V.
...
2
votes
1
answer
333
views
Struggling with I2C devices
I had 2 devices connected using I2C on my Rasp pi 3b.
A clock RTC8563 and a humidity sensor AHT20. Both were working.
I mucked about with the wiring, and did something wrong, as I smelled smoke before ...
2
votes
1
answer
183
views
Multiple Sensors connected using I2C with different addresses software approach
I'm using a Rapberry Pi 4 Model B with 4 same I2C sensors. I want to get real-time data from them, but my knowledge of I2C is limited. I know that I can connect them, using different buses, but same ...
0
votes
1
answer
145
views
Using TCA9548A for multiple MQ-X gas sensors
I have about 8-9 gas sensors I want to use on my Pi but I'm trying to understand how to use The TCA9548A. The TCA9548A Has 8 pairs of SDL and SCL pins to handle multiple I2C devices, but the output ...
-1
votes
2
answers
485
views
How to run Hyperpixel 4.0 on I2C-0 (GPIO's 44&45)?
I use a Hyperpixel 4.0 touchscreen in combination with my custom ComputeModule4 board. I've seen on the CM4 that there is one more I2C-Bus on GPIO's 44&45 which could be used. Is there any ...
1
vote
0
answers
34
views
I2C 1 light at a time`
i am currently using the NCP5623 (I2C LED Driver) to light up my 5V 1A (as written on the box) RGB LED strip.
i followed the sample connection as shown on the datasheet of the NCP5623 and when i ran ...
0
votes
1
answer
371
views
i2cdetect shows addresses starting from 8
I have currently installed the latest raspbian as of posting this question.
I have an i2c device with address 0x03 which works when running my program I successfully communicate with it, but when I ...
2
votes
1
answer
479
views
16x2 LCD text not showing up on Pico W
I have been using an online tutorial, https://www.youtube.com/watch?v=B8Kr_3xHjqE&t=166s, to display text on a LCD. The LCD can do all the functions except the displaying of text. I know there is ...
3
votes
2
answers
558
views
Raspberry PI 4 B 8Gb running 2 ov9281 cameras with camarray hat: ERROR: *** no cameras available ***
I have a Raspberry PI 4 B 8Gb.
I have this kit (2 ov9281 cameras with camarray hat): https://www.uctronics.com/arducam-1mp-2-stereoscopic-camera-bundle-kit-for-raspberry-pi-nvidia-jetson-nano-xavier-...
0
votes
1
answer
512
views
how to use a multiple rc522 (RFID) sensors with i2c on a PICO with a Adafruit PCF8575 board
I've been looking through the web for the case of multiple rc522 (RFID sensors) attached to a PICO/W using I2C. Most of the examples and Micropython library code seem to be using SPI. Can someone ...
3
votes
2
answers
585
views
i2c_arm bus initialization and device-tree overlay
I've built a Pi1541 HAT, just for fun, and am now playing with the device-tree autoconfiguration in Raspbian. I've made an overlay that autoloads during boot, based on the EEPROM contents, and that ...