2

I have an LSM9DS1 breakout board by Sparkfun, and am communicating with it using a Mega 2560 over I2C. The board is given 3.3 V power as defined in the data sheet, though there seems to be confusion whether the SDA and SCL pins need level shifting for communicating with the 5 V Mega. In theory it shouldn't need to.

I am able to connect with the device and get its accelerometer and magnetometer data, however the gyro is just returning noise and no signal. I have dug in to all the registers I know of regarding high pass filters, logging rates, enabling and powering the sensor, but the only hints are that when the gyro is disabled and then polled, it returns a constant nonzero value on all three axes, as though a bit somewhere is stuck. With any other setting the results are unchanged: finite noise on a constant DC signal. Is this even possible? How can I dig deeper to understand and solve this problem?

1 Answer 1

1

In theory you must use a level shifter for SDA and SCL. The Arduino Mega 2560 board has internal pullup resistors of about 50k for SDA and SCL and extra 10k pullup resistors of 10k to 5V and according to the datasheet the ATmega2560 requires 3.5V to detect a high level for the I2C bus.

Those pullup resistors might damage the LSM9DS1.
5V-3.3V / 50k//10k times two (both SDA and SCL) = 400nA that might be pushed into the sensor (I assume there are protection diodes, and the maximum voltage is 3.6V, therefor the 400nA is just an indication). I assume the 10k pullup resistors to 3.3V on the sensor module are enabled. They will take away some over-voltage.

The current by the pullup resistors (to 5V) is a very small current, and I don't know if the sensor is in sleep mode during startup.

To be sure you need to buy another LSM9DS1 and a level shifter. Or even better: buy a 3.3V Arduino board, like the Due or the Zero, M0, and so on.

Have to compared the raw sensor data with others ? Those sensors are very noisy. That is why there is so much to do about filter algoritms to get data that can actually be used. The LSM9DS1 does not do processing or smart filtering with the raw data. All you get is the raw data. Did you assume that the values would be zero ? They never will be, because such sensors are far too noisy and too sensitive for that.

6
  • I am confused genreally by your suggestion that I2C communications requires a level shifter. Your description is fair of the reality but I was under the impression the design spec for I2C was for voltage tolerance by communicating on open collector. I am using a 3.3 V supply to the chip, it is only the SDA and SCL that are running at the Mega-native 5 V. On the noise, of course I expect noise that is there, but what I am not getting is any signal on top of it. Additionally this is the second system I've used using the exact same model of IMU and Arduino, the other unit works perfectly.
    – J Collins
    Commented May 15, 2017 at 10:52
  • Further, this is the information I am using to determine the necessity of using a level shifter with I2C. It says that is there is a 3.3 V supply, that I2C will not need level shifting: learn.sparkfun.com/tutorials/…
    – J Collins
    Commented May 15, 2017 at 16:17
  • That voltage tolerance might have been a design feature long ago, but it does not really work with Arduino or todays sensors. They have ESD protection diodes inside, so there is a path from SDA and SCL to VCC. That sentence at Sparkfun says that with a 3.3V board everything is okay at 3.3V. That is the same as when I wrote: "Or even better: buy a 3.3V Arduino board". You have bad luck with the Arduino Mega 2560, it has 10k pullup resistors at SDA and SCL. And the Arduino Mega also requires 3.5V for SDA and SCL for a valid high. It's not a joke, 3.3V sensors have been damaged with Arduino Mega.
    – Jot
    Commented May 16, 2017 at 13:09
  • Well luckily I have a level shifter in this latest build for the I2C connection with an SD card and it has spare channels, so it's not a bit deal to add this to it. Nonetheless I am able to communicate with the chip and see meaningful data. Are you suggesting that the SCL and SDA pins going over voltage might influence the power to the gyro sensor even it the accelerometer and magnetometer are okay?
    – J Collins
    Commented May 16, 2017 at 14:38
  • Yes. I don't know what the LSM9DS1 will do, but other gyro and accelerator MEMS sensors can get damaged. They might still work, but the data could be noisy and drifting (even when returning to normal voltages). Perhaps the gyro is the most sensitive part in the chip for voltages that are too high.
    – Jot
    Commented May 16, 2017 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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