Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
6 views

Run i2c repeated start with pi4j

i´m using pi4j at my raspberry pi. It´s possible for me to write and read to and of devices which don´t need a repeated start. But now i need to run the repeated start for a device. I already tried ...
-1
votes
0answers
22 views

How do I set up the i2c for my simple sound card?

I have the simple sound card working with a fixed 192KHz. I need to have it able to dynamically switch frequencies via the i2c interface. How do I set that up, and what do I use for a command set ...
2
votes
1answer
24 views

Changing between I2C and GPIO in the same application

My program is a test system. It should first set SCL=1, SDA=0. Read some values from other GPIOs. Then set SCL=0, SDA=1. Read some values from other GPIOs. This is in order to verify the integrity of ...
1
vote
1answer
33 views

Allowing a venv instance of Python access to I2C

I'm trying to run a python script using the adafruit_bme280 library to read a couple of sensors and display the data on a flask-generated page. I've gotten it to work outside of a venv virtual ...
1
vote
3answers
65 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 ...
0
votes
1answer
43 views

use raspberry 3+ and PN532 Itead with i2c

nfc-scan-device uses libnfc 1.7.1 1 NFC device found: error libnfc.bus.i2c error : worte only -1bytes (10 expected) error libnfc.driver.pn532_i2c Unable to transmit data(TX) pn53x check_communication:...
2
votes
2answers
56 views

Random i2c SDA spikes (bit flip)

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

Incorrect i2c read bytes

NOTE: Please read the bottom. There's a plot twist. I'm reading three bytes and my NodeJS code reads 3, 192, 144 in decimal while my logic analyzer reads 0x03, 0xC0, 0x10 which translates to 3, 192, ...
3
votes
2answers
148 views

/dev/mem vs /dev/i2c-1

What are advantages and disadvantages in accessing I2C and other interfaces directly with /dev/mem (as in this code) instead of using /dev/i2c-1 (as in most examples like this)?
2
votes
1answer
26 views

Arduino slave initiating an I2C transmission to Raspberry Pi master

Is there any way for an Arduino slave to send a byte array to the raspberry pi master without the master having called on it?
2
votes
1answer
77 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 ...
1
vote
0answers
26 views

Sending command over one I2C bus sometimes triggers a device on another bus

My setup: Raspberry Pi 3B+, 2 BigRelays connected to it over different I2C busses (1hw, 1sw). I had hoped to daisy-chain the two boards over the hardware I2C pins, though as the boards have the same ...
1
vote
1answer
57 views

Can't read the analog channels from my ADC board using raspberry pi I2C

It seems like the ADC I am using does not provide instructions about how to communicate with the pi using the I2C interface. Does that mean I can't use I2C? I have the register addresses for all the ...
1
vote
1answer
45 views

how to communicate with navio2, raspberry pi 3 to ard-ltc1867 using i2c protocol to read analog data

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....
2
votes
1answer
151 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 ...
0
votes
0answers
26 views

Connect 3 Raspberry pi using i2c

I'm trying to use i2c to exchange messages between 3 raspberry pi, all of them must receive a message do something and then send a response. Raspberry as an I2C SLAVE From here I came up with a ...
2
votes
2answers
55 views

Eight I2C buses

Is it possible to set up 8 (eight) I2C buses on a Raspberry Pi? I've been looking at software I2C using NodeJS but I am still unsure of if that's a good library. Give me tips. Backstory: I'm ...
4
votes
1answer
131 views

I2C bus hangs in master RPi access to MSP430G uC ~1 in 1000 accesses

What I've done to deal with the problem I reset the MSP430, clearing the hung state. I've slowed down the I2C clock's frequency, beefed up the Power Supply, changed pull-up resistors - no change. ...
1
vote
1answer
42 views

Pigpio reading sensor returning -83”i2c read failed”

I am testing using my new air quality 5 click sensor with my Raspberry Pi (https://www.mikroe.com/air-quality-5-click) using command line. When I enter i2cdetect -y 1it appears at address 48. Then ...
0
votes
2answers
38 views

ADS1115 simplest.py works in terminal but not in Thonny

I defined two GPIO pins as SCL and SDA for another I2C, (e.g., i2c3 on busnum=3). ADS1115 was successfully detected by runing (sudo i2cdetect -y 3). Also, the modified simplest.py (where ...
1
vote
3answers
76 views

Problem controlling LED on GPIO3

I need to add a status led to my pi zero w and after taking a look at the pin out I decided to put an led between pin 5 and 6. Please see attached picture. I soldered a blue 0805 SMD led directly on ...
2
votes
1answer
42 views

i2c-bus electrically damaged due to wrong wiring

In a hurry I mistakenly connected the VCC of the Bmp280 to ground and the ground of the Bmp280 to 5V. Afterwards, I checked the i2c-bus with another sensor but i2cdetect -y 1 only reported --. Q How ...
1
vote
1answer
27 views

Earliest place in boot for output to I2C LCD (not HDMI)

We're using an embedded Raspberry Pi that uses a (I2C) 4x20 LCD (character) instead of HDMI. Since the boot process can take some time I'd like to get something on the LCD as soon as possible to say ...
1
vote
1answer
36 views

How Can I connect 5 flex sensor in a raspberry Pi

we are making a glove based on 5 flex sensors. The problem we are facing is that flex sensor transmit data in analog version while Raspberry pi 3 receive only digital data.if we are using ADC ...
2
votes
2answers
53 views

pigpio I2C reply value

I'm sending a command e.g. "wifion" with I2C arduino(master) to RPI(slave) That works perfect but I need to return a confirmation value. How can I send back/reply from the RPI to the Ardunio a value? ...
0
votes
0answers
35 views

Multiple SDA/SCL | Getting 16x32 RGB LED to work with MCP23017?

I am close to completing a device which will have a 16x32 led matrix as well as quite a few lights/buttons/sensors. All these lights and sensors go through an MCP23017. I am using the Adafruit led ...
4
votes
0answers
54 views

Custom camera driver

Is it possible to write a driver, say for a OV camera, based on the existing drivers at the RPI git repo? As is I understand, with a datasheet for a sensor it should be possible to write a similar ...
2
votes
1answer
80 views

I2C devices - How to physically connect multiple devices

I have a one of these https://shop.pimoroni.com/products/adafruit-veml6075-uva-uvb-and-uv-index-sensor-breakout and one of these https://taaralabs.eu/1-wire-shield-for-wemos-d1/ I would like to ...
0
votes
1answer
36 views

How to hook up multiple devices with sda pins?

I am building something with raspberry pi. I am using the 16x32 led matrix as well as the port expander (MCP23017). Both use the SDA and SCL pins. I am having trouble hooking it up. I realize this may ...
1
vote
2answers
182 views

5V-3.3V Sensors Confusion

Most of the sensors available in the market requires 3.3V-5V. The GPIO of the Raspberry Pi is 3.3V max only and not 5V tolerant. I have seen tutorials around the internet that they supply the sensors ...
3
votes
1answer
75 views

Using RTC on Raspberry Pi Zero while SDA/SCL pins are occupied

I have a portable project on my Raspberry Pi Zero and I am using a i2c 0.96" OLED on the SDA/SCL pins on my Raspberry Pi. I would like to add a RTC Module to my project, but all of the tutorials I ...
0
votes
1answer
33 views

I2C slave on a RPi Model B with pigpio?

I want to use the I2C slave provided by pigpio with a Raspberry Model B. pigpio documentation says GPIO 18 and 19 are used for that. Unfortunately there is no GPIO 19 on an RPi1. Is it possible to ...
0
votes
0answers
46 views

I2C devices not detected on Pi Zero

I'm trying to connect an OLED screen to an RPI zero through I2C. They look a little out of date, but I followed the instructions here (more or less), but i2cdetect -y 1 Doesn't find anything... In ...
0
votes
1answer
51 views

{ [Error: , Remote I/O error] errno: 121, code: '', syscall: 'writeByte' } from raspberry pi to Azure

I tried to follow the instruction below to send sensor data from my raspberry pi 2 to Azure. Connect Raspberry Pi to Azure IoT Hub (Node.js) I connected the sensors to my pi device in a different ...
0
votes
0answers
50 views

LCD Display with I2C gives garbage when called by interrupt

I have problems with a 2x16 LCD Display controlled via I2C. I use python 2.7 and have a Raspberry Pi Zero W. When called from the main loop everything works fine and I can access the display with ...
0
votes
0answers
31 views

Converting C driver to NodeJS

I am looking for a bit of guidance. I am attempting to convert a Arduino LCD driver to nodejs. LCD:https://www.dfrobot.com/product-1737.html - spec PDF after bottom. I have researched I2C protocol, ...
0
votes
2answers
51 views

i2cdetect detects device - Pi can't access / find it

Currently I'm working with a gyro-sensor and need to use i2c in order to use it. Using a Pi 3 B (os:NOOBS) on kernel: Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/...
0
votes
1answer
36 views

Upon starting Node-RED my Pi detects all of its i2c addresses as connected

I've been trying to connect an MPU-9250 module to my raspberry pi B+ in order to output the sensor's data through a Node-RED UI, i followed this tutorial to setup the MP-9250: https://kingtidesailing....
0
votes
1answer
341 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 ...
0
votes
0answers
75 views

Si7021 temperature & humidity reader — Python code errors

I'm new at this. I bought an Si7021 temperature and humidity sensor, and it's wired to a breadboard -- I believe correctly. I have code, here, from the book "Make: Jumpstarting the Raspberry Pi Zero ...
0
votes
1answer
65 views

enable software i2c on raspberry pi gpio

I am trying to interface more than one sensor with Raspberry Pi Zero W, which communicate using i2c interface. So far I am able to connect sensor to dedicated i2c and read the data. Want to know ...
0
votes
0answers
37 views

Unable to get accurate RPM with Adafruit Stepper Motor HAT v0.1

I'm trying to drive some stepper motors using a Raspberry Pi 3 B V1.2 and an Adafruit Stepper Motor HAT v0.1 and am having trouble setting them to the speed I want. The motors have a step angle of 1.8 ...
0
votes
1answer
67 views

I2C Level Shifter 3,3V Raspi 5V Arduino Mega

I am connecting Raspi (Master) via I2C with Arduino Mega (Slave). Do I need a level shifter for this or is it non compulsory? As of now my code runs for some time before i get a Remote I/O Error ...
0
votes
2answers
35 views

How to get the i2c ground signal to pass into the rasberry pi

I want to build a circuit, that is a Raspberry Pi Zero W, powering 8 Adafruit Alphanumeric displays (or even more). The max, theoretical current draw from an Adafruit Alphanumeric is 280mA. ...
0
votes
1answer
235 views

I2C Programm stops running after a few seconds / Remote I/O Error nr 121

i have an Arduino Mega hooked as slave to the raspi via i2c. My python scripts looks like this import smbus import time bus = smbus.SMBus(1) SLAVE_ADDRESS = 0x08 def requestreading(): block = ...
0
votes
0answers
36 views

I2C Raspi (Master) Arduino Mega (Slave) creating a csv File from sensor values

i am trying to connect raspi 3 (master) with an Arduino Mega (slave). I have 4 analog sensors on the on the Arduino Pins A0 - A3. I now want to be able to manually start and stop the readings from ...
0
votes
1answer
33 views

I2C instability

I2C was working great for over a month using an Adafruit Motor Hat, and an LSM303 accelerator/compass also on the interface passing through the Motor Hat and consuming 3v. As a side note, power-wise, ...
0
votes
1answer
247 views

Can't get MLX90640 working

Warning. Really long post. Hi. I’ve been having problems in getting my MLX90640 thermal camera to work on my Raspberry Pi Zero W. I’ve connected the camera to Pins 1,3,5,7,9 as instructed. I then ...
0
votes
0answers
53 views

How to stop the NXP NFC-EXPLORE library from interfering with my i2c oled display?

I've been working on a new project with my raspberry pi 3b+ to turn in into a NFC jukebox/bluetooth speaker and I used the NXP EXPLORE-NFC header to take on the NFC scanning part. I've connected it ...
1
vote
0answers
176 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 ...