Choosing Appropiate IC to Shift Voltage Levels for I2C Commu

I have seen several references to using the CD4050 non-inverting hex buffer converter between Uno’s 5 volt I/O and 3.3 volt I2C sensors, but I have also seen a few references suggesting the use of bi-directional ICs like IT’s 74LVT245 Low Voltage Octal Bidirectional Transceiver with 3-STATE Inputs/Outputs if the communication is to be bi-directional; Sparkfun also sells the Level Translator Breakout - PCA9306 which I understand is bi-directional. When I’m using I2C sensors, either singularly or daisy chained, I’m having to send info back-and-forth when requesting data. Could someone please explain when it’s appropriate to use the CD4050 versus a bi-directional level shifter like the 74LVT245?

You don’t want to use a generic bi-directional buffer like the one you suggested. This requires additional signalling that the I2C controller is not capable of generating. If you were to make this work you would have to bit-bang the I2C bus and add in the additional directional control.

More commonly, microcontroller inputs have TTL input levels, meaning that a digital-low is guaranteed below 0.8V and a digital-high is guaranteed above 2.0V regardless of operating voltage. This makes the interface easy since you just pull the I2C bus lines to 3.3V instead of 5V and everything works out. Well I should add, this only works because I2C uses open-collector or open-drain outputs.

However, the micro that’s used on the Uno only works on CMOS input levels, 0.3Vdd for low, 0.7Vdd for high. So if you pull the bus up to 3.3V you won’t be able to reliably reach the required levels. Some people are doing it (see http://playground.arduino.cc/Main/I2CBi … velShifter) but I wouldn’t recommend it.

That same website I referenced includes a clever circuit for a bidirectional level shifter with some MOSFETs, I would recommend using something like that.

There’s no simple answer to your question, each problem requires you to evaluate the best options given the constraints.

The [TI TCA9406 is about as simple as it gets, it even includes internal pull-up resistors. Just pay attention to which side is which, voltage-wise (check the datasheet).](http://www.ti.com/product/tca9406?qgpn=tca9406)