Go Down

Topic: Another I2C question (Read 646 times) previous topic - next topic

Lsnyman

I have 2 devices that will use the I2C bus talking to an UNO. I understand that I need 1 set of Pullup resistors between the SDA/SCL lines and VCC.
My problem is the 2 devices have different supply voltages. One is an LCD display that only has 3.3v supply and the other is ADS1114 A-D converter that will read a sensor powered off 5v, so I intended to use a 5V supply for this part.
Can these 2 communicate on the same I2C bus?
Where do I connect the pullup resistors to? 5v or 3.3v?

Any help would be appreciated.

Nick Gammon

You probably want a logic-level converter, eg.

https://www.sparkfun.com/products/8745

I think I would put the resistors on the 5V side (where the Uno is).
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

retrolefty


I have 2 devices that will use the I2C bus talking to an UNO. I understand that I need 1 set of Pullup resistors between the SDA/SCL lines and VCC.
My problem is the 2 devices have different supply voltages. One is an LCD display that only has 3.3v supply and the other is ADS1114 A-D converter that will read a sensor powered off 5v, so I intended to use a 5V supply for this part.
Can these 2 communicate on the same I2C bus?
Where do I connect the pullup resistors to? 5v or 3.3v?

Any help would be appreciated.


Yes the I2C bus (via the two pull-up resistors) can only work at one voltage, suitable to the devices that wire to the I2C bus although there may be I2C slave devices that run at 3.3vdc Vcc power but are '5 volt toleration' on their two I2C I/O pins. As you may already know the ADS1114 chip will work at 3.3vdc or 5vdc.

The fact that you have a sensor that requires +5vdc is not a show stopper by itself but rather what is the signal measurement range that the sensor outputs to the ADS1114 input pins? If it's 3.3vdc or less not a problem. If it can output up to +5vdc then maybe you could just use a two resistor voltage divider to knock down the maximum sensor output (say /2) and then in your sketch software just un-divide it with a simple x2 of the measurement value returned by the ADS chip.

Lefty

Lsnyman

Thank you. That was going to be my next question. Although the sensor is powered off 5v, the output is only between 0 and 2.5v.
Before using the ADS I was using the internal 1.1v reference to improve reolution a little.
So in this case I would power both off the 3.3V rail? The Atmega328 is still using 5v so that is ok, correct?

Thanks again for your time and input.

Nick Gammon

That sounds OK.

Ultimately if you deploy your project "in the field" it might be easier to run the whole lot off 3.3V and avoid having to use the level converters.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Lsnyman

I would like to but the sensor is unstable below 4v.

Go Up