Jaikumar62
Posts: 3
Joined: Mon Jul 02, 2018 11:52 am

Multiple I2C devices interface

Mon Jul 02, 2018 12:15 pm

Hi,
We are using Raspberry Pi to read the data of Acceleration sensors through I2C. And we need to read 2-6 Sensors.To read multiple sensors, we have connected SCLK lines of sensors together and SDA lines together.We are able to detect the devices with addresses 1d and 1e .But, when we try to read data from sensors one sensor is disconnecting(1d) and one senso(1e)r is giving proper data (We have connected 2 sensors).
Is it required to add pull up resistors? and what values we need to use?
Please suggest the possible solution.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5000
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Multiple I2C devices interface

Mon Jul 02, 2018 2:14 pm

Jaikumar62 wrote:
Mon Jul 02, 2018 12:15 pm
Hi,
We are using Raspberry Pi to read the data of Acceleration sensors through I2C. And we need to read 2-6 Sensors.To read multiple sensors, we have connected SCLK lines of sensors together and SDA lines together.We are able to detect the devices with addresses 1d and 1e .But, when we try to read data from sensors one sensor is disconnecting(1d) and one senso(1e)r is giving proper data (We have connected 2 sensors).
Is it required to add pull up resistors? and what values we need to use?
Please suggest the possible solution.
The Pi has it's own on-board pull-ups on the main I2C channel IIRC (1k8 I think).
Are the sensors running at 3.3V or, with the I2C signals buffered by level-shifters**, at 5V? (The Pi's GPIO's are not 5V tolerant)
What type of sensors are they? (make, model & maybe, link to specs)
Trev.
**FWIW, some examples here: http://www.cpmspectrepi.uk/raspberry_pi ... dules.html
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Jaikumar62
Posts: 3
Joined: Mon Jul 02, 2018 11:52 am

Re: Multiple I2C devices interface

Wed Jul 04, 2018 4:08 am

Hi Gowen,
>The sensors are running at 3.3V
> The sensor we are using : https://www.st.com/en/mems-and-sensors/lis3dsh.html

User avatar
Arjan
Posts: 261
Joined: Sat Sep 08, 2012 1:59 pm

Re: Multiple I2C devices interface

Wed Jul 04, 2018 2:45 pm

With respect to level-shifters; even when the I2C slave is running at 5V, then there could be no need for level-shifters. It depends on the factors a. If the I2C slave has pull-ups to 5V, b. The ViH min for the I2C slave is greater then 3V3
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5000
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Multiple I2C devices interface

Wed Jul 04, 2018 5:21 pm

Arjan wrote:
Wed Jul 04, 2018 2:45 pm
With respect to level-shifters; even when the I2C slave is running at 5V, then there could be no need for level-shifters. It depends on the factors a. If the I2C slave has pull-ups to 5V, b. The ViH min for the I2C slave is greater then 3V3
However that 5V pull-up is likely to damage a Pi . The Pi's GPIO's are not 5V tolerant! Hence the level shifters.
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Interfacing (DSI, CSI, I2C, etc.)”