1
\$\begingroup\$

Is it safe to connect any 5V I2C slave device to 3.3V host?

I know, that DS1307 realtime clock can be connected to Raspberry Pi (3.3V IO), because DS1307 just pulls down data lines and 5V voltage never "comes out" from DS1307 SDA and SCL pins.

When I'm connecting pullups to 3.3V - it's not a problem for DS1307.

But what about other I2C devices, like MCP3421 ADC or ADT7420 temperature sensor for example?

\$\endgroup\$
  • \$\begingroup\$ well, 5V will be seen at the IO pin, just the logic drives low. You usuaslly pull I2C lines high with resistors - why not pull high to 3.3V rather than 5V? \$\endgroup\$ – KyranF May 21 '14 at 9:43
  • \$\begingroup\$ Lets assume that pullups are connected to 3.3V. See edit. \$\endgroup\$ – Kamil May 21 '14 at 9:46
  • \$\begingroup\$ check datasheets of the devices that are 'using' 5V supplies, and see if their logic high/low falls within 3.3V logic levels. if it does, just do 3.3V pullups for I2C ;D \$\endgroup\$ – KyranF May 21 '14 at 9:51
  • \$\begingroup\$ OK. But what about 5V coming from I2C device? It's impossible (when device is slave)? \$\endgroup\$ – Kamil May 21 '14 at 10:02
  • \$\begingroup\$ use a bi-directional level shifter IC, such as the PCA9306 and also check out the use of MOSFET to allow two different voltage pull-ups for bi-directional I2C use - adafruit.com/datasheets/an97055.pdf check this and make sure if you do this, the Vgs-Threshold to turn on the gate must be as low as possible (like, 1V) \$\endgroup\$ – KyranF May 21 '14 at 10:08
1
\$\begingroup\$

I think I got it.

Many I2C devices connected to 5V and 3.3V I2C line (pullups connected to 3.3V) will not work.

High state for many devices is 0.7Vdd.

enter image description here

ADT7420 temperature will not work too - it has minimum high state level = 0.7Vdd.

For 5V Vdd minimum high level is 3.5V (above 3.3V). With 3.3V pullups 5V powered device will read line always as low state.

DS1307 is working, because minimum high state input level is 2.2V (below 3.3V).

enter image description here

\$\endgroup\$
  • \$\begingroup\$ yeah, so like I said check the datasheet for the part. Sometimes it works, sometimes not. As for "not needing level shifter" maybe you dont know what I mean by that - usually you power the level shifter with like a "port A supply" and "port B supply" and inputs/outputs appearing on each port will have those voltages respectfully \$\endgroup\$ – KyranF May 21 '14 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.