EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Yaroooo on October 22, 2019, 04:07:50 pm

Title: Several devices on same I2C bus
Post by: Yaroooo on October 22, 2019, 04:07:50 pm
I've a question about level-shifting using mos. In my case I've several my devices that works at 3v3 and communicate between them using I2C bus. I must modify my board to communicate between them, but allowing to connect external boards (not from me) that use 5v as voltage level.

Schematic will result like this:

(https://www.circuitlab.com/circuit/w99mrtuqm699/screenshot/1024x768/)

I'm sure I'll not have problem to interface 3v3 and 5v.

With two 3v3 I'll have something like this:

(https://www.circuitlab.com/circuit/x6n9a4dh8585/screenshot/1024x768/)

It should work with same principle. Can someone just check and (in case) confirm?
Title: Re: Several devices on same I2C bus
Post by: magic on October 22, 2019, 05:00:41 pm
I think it would work, even without 5V pullup on the middle segment, as drawn. Maybe try in in SPICE or on breadboard to be 100% sure.
But it's more complex than it needs to be. You can use one 3.3V bus segment for all the on-board devices and add just one level shifter to bridge with the 5V system.
Title: Re: Several devices on same I2C bus
Post by: Yaroooo on October 23, 2019, 07:59:50 am
Thanks for your answer. This 5V devices are already commercial boards with a connector on them, I can't modify them. On other side, create a special adapter will add additional logistic complexity and cost.
Title: Re: Several devices on same I2C bus
Post by: aries1470 on October 24, 2019, 01:59:46 am
Hi,
Have you looked at the i2c level shifters?
They are small and cheap. You can have all the 3p3V ones on one side and the 5V on the other?
You can use as many of either one before and after the shifter.
I have attached a rather rudimentary drawing on how to do this and a couple of links to ebay for these devices, of which are fairly cheap too.

Search for items on eBay - Australia:
https://www.ebay.com.au/sch/i.html?_from=R40&_nkw=i2c+5v&_sacat=0&LH_TitleDesc=0&_sop=15 (https://www.ebay.com.au/sch/i.html?_from=R40&_nkw=i2c+5v&_sacat=0&LH_TitleDesc=0&_sop=15)
https://www.ebay.com.au/itm/Two-Channel-5V-to-3-3V-TTL-I2C-IIC-Logic-Level-Converter-Bi-Directional-Module/262664199077?hash=item3d28019ba5:g:51sAAOSwZJBX-Ju8 (https://www.ebay.com.au/itm/Two-Channel-5V-to-3-3V-TTL-I2C-IIC-Logic-Level-Converter-Bi-Directional-Module/262664199077?hash=item3d28019ba5:g:51sAAOSwZJBX-Ju8)
https://www.ebay.com.au/itm/2Pcs-4-Channel-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-3-3V/301924606812?epid=778328238&hash=item464c1be35c:g:NvIAAOSw5VFWJwmj (https://www.ebay.com.au/itm/2Pcs-4-Channel-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-3-3V/301924606812?epid=778328238&hash=item464c1be35c:g:NvIAAOSw5VFWJwmj)

All the best.
Title: Re: Several devices on same I2C bus
Post by: JustMeHere on October 24, 2019, 04:02:03 am
Look for something just like this:

http://www.ti.com/product/PCA9306 (http://www.ti.com/product/PCA9306)
Level shifter IC for I2C.

http://www.ti.com/product/TXS0102 (http://www.ti.com/product/TXS0102)
Bidirectional level shifter that's faster.
Title: Re: Several devices on same I2C bus
Post by: mikerj on October 24, 2019, 08:23:48 am
Look for something just like this:

http://www.ti.com/product/TXS0102 (http://www.ti.com/product/TXS0102)
Bidirectional level shifter that's faster.

Note that the TSX0102 level shifters take some liberties with the Vol levels that degrades noise immunity.  The TI LSF0102 parts appear to be better in this respect.