Morphology
Posts: 36
Joined: Tue Jan 10, 2012 11:16 am
Contact: Website

I2C Pullups with powered peripheral

Mon Mar 27, 2017 7:41 am

We all know about adding external pull-up resistors to the i2c bus (SDA / SCL) and, ordinarily, these would be between these lines and the 3v3 rail from the Pi. I have done this many times as, generally, I am then feeding the i2c signals through a bi-directional level shifter before connecting them to a peripheral board running at 5v.

I now have a situation where the peripheral board I am designing has i2c chips that run at 3v3 and, as I want to be able to daisy-chain a number of these on the i2c bus, each of these peripheral boards will have its own on-board 3v3 supply (so that I don't overload the Pi).

My question is: should the pull-up resistors be between the i2c lines and the 3v3 supply FROM THE PI, or should they be between the i2c lines and the 3v3 rail ON THE PERIPHERAL?

Rough sketch attached - should they be in position A or position B or does it make no difference?

Thoughts? Comments?

Morph
i2c pullup.PNG
i2c pullup.PNG (54.94 KiB) Viewed 615 times

User avatar
joan
Posts: 14196
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: I2C Pullups with powered peripheral

Mon Mar 27, 2017 7:46 am

The Pi has hard-wired pull-ups to 3V3 on SDA/SCL. You shouldn't add another.

Morphology
Posts: 36
Joined: Tue Jan 10, 2012 11:16 am
Contact: Website

Re: I2C Pullups with powered peripheral

Mon Mar 27, 2017 8:02 am

True, maybe I'll just leave them off, and it does seem to work fine without them, though I was influenced by the schematics of various external boards such as this Pimoroni bi-directional level shifter, which include 10k pull-ups on the 3v3 side:
level shift.png
level shift.png (6.82 KiB) Viewed 600 times

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

Re: I2C Pullups with powered peripheral

Mon Mar 27, 2017 4:29 pm

Morphology wrote:True, maybe I'll just leave them off, and it does seem to work fine without them, though I was influenced by the schematics of various external boards such as this Pimoroni bi-directional level shifter, which include 10k pull-ups on the 3v3 side...
IIRC, those pull-ups are of an order of magnitude higher in resistance that the Pi's on-board I2C pull-ups (and thus, unless many are connected "in parallel", should have a negligible effect). FWIW, a few level-shifting modules are classed/labelled "I2C safe":
http://www.cpmspectrepi.uk/raspberry_pi ... dules.html
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

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: I2C Pullups with powered peripheral

Mon Mar 27, 2017 4:44 pm

Morphology wrote:... this Pimoroni bi-directional level shifter ...
That can be used on any GPIO, not just the I2C ones. Leaving the resistors off would perhaps compromise its versatility, while putting them on doesn't hurt the I2C

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