2

I am attempting to use a bi-directional level shifter for an IMU to shift the SDA and SCL lines in an I2C implementation, however cannot get the level shifter working with the Arduino at all. It feels like the bi-directionality is confusing the master<>slave relationship and pulling the high and low levels to some average, preventing communications.

At idle, with no connection, the SDA and SCL lines on the Adruino are are 5 V, however when connected to two channels of the level shifter, the voltages drop to 2.5 V on the high side and 1.7 V on the low side of the shifter. The low side of the shifter is completely open so shouldn't be controlling the voltage at all, I've even tried a 10 kOhm and 1.5 kOhm pullup resistor between the low and high sides and their respective voltages, 3.3 and 5 V, but that hasn't worked either.

The level shifter works fine interfacing the MEGA to an SD card over the SPI pins, so I don't understand quite why the level shifting would stop working with the I2C.

The fault manifests as the Arduino hanging on a Wire.endTransmission(); call, which would seem to suggest the MEGA is failing to oscillate its SDA and SCL pins as it wishes. The problem occurs when either of the SDA or SCL pins are connected to the shifter high-side.

I also know that the Sparkfun datasheet for the IMU states that for I2C a level shifter is not necessary, but in debugging another problem, this is being attempted as a solution.

Level shifter: Adafruit 8-channel Bi-directional Logic Level Converter

IMU: Sparkfun LSM9DS1 breakout

Arduino: MEGA 2560 v3

2

For I2C you need a special kind of logic translator. This one isn't suitable.

This device can only translate push-pull CMOS logic outputs. If for open-drain signal translation, please refer to TI TXS010X products.

Personally I use the PCA9306DCUR since it is specifically designed for I2C operation.

  • 1
    I always use the I2C level shifters with mosfets. 30 cents at AliExpress (search for: i2c level). Adafruit: adafruit.com/product/757 Sparkfun: sparkfun.com/products/12009 – Jot May 31 '17 at 14:14
  • 1
    @Jot they take up too much room for my liking. One of the variants of the PCA9306 is smaller than just one of those SOT23 MOSFETs. It's about the size of one pin and needs a microscope to work with it ;) – Majenko May 31 '17 at 14:19

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.