0
\$\begingroup\$

I have programmed an I2C slave on an Arduino Nano and an I2C master was on an Arduino Mega. I'm now working on upgrading the master to a Teensy 4.1.

The new master is a 3.3v microcontroller, where as the original setup was all 5v microcontrollers. So now I'm looking into level shifting as I need to upgrade the master and for various reasons upgrading the slave is not practical at this time.

My question is about the difference between these two breakout boards:

https://www.adafruit.com/product/5649

https://www.adafruit.com/product/5637

One is described as a 5v to 3v I2C level shifter and the other 3v to 5v. The documentation suggests that one is designed for a 5v master and 3v slave and the other vice-versa.

I find this confusing since I2C requires signals to go in both directions.

My question is: Are these products in fact interchangeable or do they really need to 'know' which side the master is on to function?

\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

I²C indeed is bidirectional, so on which side the master and slave are placed does not matter. (And it is possible to have multiple masters.)

But these boards are not only level shifters:

On one side of this board is 3V power and logic level inputs. In the middle is a 5V charge-pump boosting regulator that can provide 100mA continuous (250mA peak) plus level shifting circuitry. On the opposite side is the same I2C traffic but now safely shifted up to 5V.

On one side is 5V-safe power and logic input. In the middle is a 3.3V regulator that can provide 500mA plus level shifting circuitry. On the opposite side is the same I2C traffic but now safely shifted down to 3.3V

Both boards have a single power input, and generate the other voltage from that. The other power connector is an output, and you must not connect another power supply to that.

These boards are useful when you can access only a single power supply. When both supplies are available, use a plain level shifter (like this board from Adafruit).

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for this. Setting aside the power function. If I connect the full QUICK connector on the input side and only the clock and data lines on the other side will it function as a level shifter? (or it is at least worth trying?) \$\endgroup\$
    – Hubert B
    Commented May 26 at 10:40
  • \$\begingroup\$ @HubertB On the "other side" suggest the ground needs to be connected as well as the clock and data lines. \$\endgroup\$ Commented May 26 at 12:19
  • \$\begingroup\$ All devices need to share their ground, either through this connector or in some other way. \$\endgroup\$
    – CL.
    Commented May 26 at 15:20
0
\$\begingroup\$

The products are more than just I2C level shifters. These also convert a 5V supply down to 3.3V, or a 3.3V supply up to 5V. Which is why you have two different products.

If you just need a level shifter for I2C, then buy one that does not convert supply voltages.

\$\endgroup\$

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