Using analog input interferes with i2c

Hi! For our project we're using an UNO with analog pins 0 through 3 being used for our sensors and then we have an IMU in I2C hooked up to pins 4 and 5. And we're storing the data on an SD card. So when we only call the IMU we get correct values and they're changing as we move it, as it should. However, if we call all the analog sensors and the IMU in the same program, the IMU gives us strange values that never change, no matter how we move it. The IMU is Sparkfun's 6dof. My advisor said that if you're using the analog and I2C devices in the same program, the sda and scl lines will get changed to analog inputs. Will that only happen if you're trying to use A4 and A5 with ans I2C device and an analog one? Any help is appreciated, thank you!

Your advisor basically is wrong. Have you got pull up resistors on the I2C lines? You should have 4K7. What is the impedance of your analogue input. It needs to be about 10K or less for good operation.

Whoops, he actually said the you would get conflicts if you're using an analog device with an IMU device both on the analog scl and sda pins. We're using three LM19s temperature sensors and their data sheet says that their output impedance is at most 160 ohms. And we also have a SSCSANN015PAAA3 pressure sensor, I can't find it's output impedance, but I'll keep looking.

Whoops, he actually said the you would get conflicts if you're using an analog device with an IMU device both on the analog scl and sda pins.

In that case he is correct, you can only use either an I2C or analogue 4 & 5.

So let's see how you have wired it up. Schematic please.

Okay, here's the schematic from the EE's:

You have got no pull up resistors on the SDA and SCL. You need a 4K7 resistor on each line to V+ on the chip.

However, as you are powering the device from 3V3 the weak internal pull up resistors in the arduino will over voltage that chip. If you need to run a library that does not enable these resistors. So either hack the official library or use another one like:- http://dsscircuits.com/articles/arduino-i2c-master-library.html

But why are you connecting this chip to 3V3, will it not work with 5V?

The IMU has parts ITG-3200 and ADXL345 and they both are only rated to a max 3.6V. We thought that you could just connect it. Would just adding the 4.7K pull ups work or do we also need to disable the internal ones? Thank you!

I found in twi.c the lines that enable the internal pull-up resistors and commented them out. So, we'll see.

I found in twi.c the lines that enable the internal pull-up resistors and commented them out. So, we'll see.

Pull-up must stay deasabled. Pull-up value are between 30K and 70kohms, fonction of the batch. This value is too higher for I2C.

Grumpy_Mike say you the good value : 4,7 kohms.

Have a look on UM10204 I2C-bus specification Rev4 13 february 2012.

We disabled the internal 5V pull up resistors and have 3.3V ones, we tested and are now able to communicate with the IMU again. We're having some other electrical issues, so we haven't been able to test the analog/IMU issue we were having earlier. I'll post again if it comes up. Thank you very much for your help, I had no idea about the 3.3V device and internal pull up resistor issue. XD