3

Good day all,

I have a 5 volt I2C device that I want to use with my pi. Am I able to pull the bus up via resistors to the 5-volts that my device runs off of, or does it need to be 3.3 volts? If it must be 3.3v, can I just create a simple voltage divider from my 5 volt rail?

I guess the big question is, does it matter what voltage I tie my I2C bus to when using the rpi?

Thank you!

Lanet Rino
  • 167
  • 2
  • 6

2 Answers2

6

Some of the other comments are true, but not totally clear.

You can use the Pi I²C to connect to another I²C device, even if it is powered by 5V provided there are no pull-up resistors to 5V.

I routinely do this, and it works. Technically the High level output is marginal, but works in all cases I have tried.

If you want to be safe, use a bi-directional MOSFET level shifter. Many of the modules available have a combination of MOSFET level shifter and resistive voltage dividers. Resistive voltage dividers will NOT work with I²C, because of the pullups.

Milliways
  • 62,573
  • 32
  • 113
  • 225
3

The Pi's GPIO are all 3V3. Exposing them to 5V can damage the GPIO and/or the Pi.

The Pi's I2C bus operates at 3V3 - to that end hard wired 1k8 resistors are wired between GPIO 2/3 (SDA/SCL) and 3V3.

joan
  • 71,852
  • 5
  • 76
  • 108