I2C pins not being pulled low enough

I am trying to connect a sensor/controller to my Arduino Mega via i2c and I am experiencing some strange behavior on the i2c pins.

I am using a logic level converter from Sparkfun for connecting the sensor (3.3v) to the Arduino’s (5v) i2c SDA and SCK pins.

The device I am trying to communicate with is MAX31760, which is a fan-speed controller.

I connected this device as shown on the first page of the datasheet, with a 0.1uF capacitor between Vdd and GND, and I use 4.7K pullup resisters, except for the i2c pins, since the logic level converter already uses 10K pullup resisters on both the high and low side.

The code I am running is i2c scanner code which I found in the arduino playground forum.
The problem I am experiencing is that the code starts to run, and then the bus lines goes high and stays high. It seems that something causes the i2c bus to hang/lock up.

I performed another test by connecting the SCK line of the device to another pin on the arduino, and then toggle the pin between high and low with a 1ms delay.

When I connect my oscilloscope to the SCK lines on both the high (5V) side and the low (3.3V) side I clearly see a difference in the wave generated.

I attached 2 images/screenshots from my oscilloscope.
I have honestly no idea what the problem is, and would really appreciate any help with this problem.

Thank you for giving good information. It seems that the MAX31760 keeps the signal near 2V, and the high side is only a result of that. However, that can not be the problem, because then the low level of the signal would not be 1.16V for both the high side and the low side. So it must be something weird :confused:

How did you connect the level shifter ?
The high side (HV) is the Arduino side and the low side (LV) is the pwm controller side.
You must connect 5V to "HV" and 3.3V to "LV" or else the level shifter does not work.
And connect the GNDs of course.

Do you use a breadboard ? They have often bad contacts.

The 10k pullup on both sides of the level shifter is indeed enough. That should be okay.

My guesses:

  1. level shifter not properly connected
  2. bad contacts or missing GND.
  3. something is broken, buy a new level shifter and a new pwm controller.

Do you have another 3.3V I2C sensor ? If that works, then you know that the Arduino board and the level shifter are okay.

I have now connected my SerLcd to the i2c bus to test that the level shifter is working correctly, and I am able to send data to the LCD. So it seems that the bus/connections/level shifter and arduino is functioning as it should. I tested this by removing the PWM controller from the bus.

When I reconnect the PWM controller, the bus lines goes high’ish and then the bus hangs, and the LCD stops updating. It seems that it is definitely something with the PWM controller. I connected a new controller to the bus (removed the first one) and I get the same result.

I also disconnected the power from the PWM controller, only leaving the i2c pins connected, and this also gives the same result, leaving the SDA and SCK lines high’ish and causing the bus to hang.

I find it strange that two different PWM controllers cause the same problem, even when powered down/disconnected from the bus.

I’ll add some photos of how everything is connected. Maybe someone here can spot something wrong. I think I will have to contact maximintegrated to hear what they have to say.

To "disconnect" the PWM controller from the I2C bus, you have to remove it from the circuit, put it in a box and ship it to Australia. That is to "disconnect" it from the bus :wink:

When you remove the power, the internal ESD protection diodes will flow current from SDA and SCL to VDD (inside the MAX31760).
Powering down any I2C device will make the I2C bus no longer usable.
Maybe in 1980s the SDA was a open-collector transistor output and both SDA and SCL high-impedance inputs, but not today.

That is a problem for example when using battery power and trying to power down things. When an Arduino is in sleep mode, the I2C bus should still keep the signals high with the pullup resistors and all the I2C devices should be powered. Most I2C devices have a sleep-mode, so they should be put into sleep-mode one by one.

Can you add a pullup resistor to the /SHDN pin ? Is it normal, or did the PWM controller go into shutdown because the TACH signals are missing ?
Can you verify that the circuit board of the PWM controller is okay ? That every pin is connected to the chip.
That's all I can think of, I don't know anything else you could test :frowning:

Thanks for the lesson on properly disconnecting a device. I'll have to get a hold of small boxes then. :smiley:

You provided a lot of good information so far, much appreciated. I still have a lot to learn. :slight_smile:

I performed a test by using my multimeter and tested that each pin on the controller actually is connected all the way to the relevant breadboard line. For the power lines I tested that the correct voltage is provided, and I tested that there are no shorts between neighboring pins, since this is an SMD and I did the soldering by hand. I had pullup resisters connected to all the pins before, but then removed them afterwards to confirm that this wasn't an issue (just before I took the photos I uploaded).

I cannot find anything in the datasheet regarding going into sleep mode or shutting down when no TACH signal detected. But this might be something that was left out. :smiley:

I am also out of ideas. I've been struggling with this for about 2 weeks now. :o
Again, thanks for the help. Much appreciated.