Page 1 of 2

LSM9DS0 IMU Breakout problems

Posted: Sun Mar 09, 2014 2:14 am
by kirash4
I'm testing out this 9DOF sensor package (https://www.sparkfun.com/products/12636) and having some issues. The accelerometer isn't changing, nor does the Pitch & Roll reading. I'm running the LSM9DS0_Simple example that comes with the SFE library and this is what I'm getting:
Code: Select all
LSM9DS0 WHO_AM_I's returned: 0x49D4
Should be 0x49D4

G: 87.06, -2.48, -11.33
A: -1.50, -1.50, 1.50
M: -0.17, 0.21, 0.10
Heading: 129.50
Pitch, Roll: -21.82, -21.82

G: 6.25, -1.55, -9.19
A: -1.50, -1.50, 1.50
M: -0.15, -0.10, 0.25
Heading: -57.28
Pitch, Roll: -21.82, -21.82

G: -37.53, -4.18, 0.52
A: -1.50, -1.50, 1.50
M: -0.14, 0.05, 0.24
Heading: 159.55
Pitch, Roll: -21.82, -21.82
Notice how the accelerator reading remains at -1.50, -1.50, 1.50 and the Pitch and Roll stays at -21.82, -21.82 regardless of how much I shake, spin, swing, or drop the thing. The Gyro, Mag, and Heading readings change, but nothing else does.

In the setup(), there's an example to initialize the library with sensor scales and data rates. When I enable that (and disable the default one), this is the result:
Code: Select all
LSM9DS0 WHO_AM_I's returned: 0x49D4
Should be 0x49D4

G: -72.39, 161.62, 10.31
A: -4.49, -4.49, 4.49
M: 0.28, 0.16, 0.06
Heading: 28.98
Pitch, Roll: -10.32, -10.32

G: 50.29, -422.85, 11.47
A: -4.49, -4.49, 4.49
M: -0.32, -0.03, 0.15
Heading: -84.35
Pitch, Roll: -10.32, -10.32

G: -591.31, 102.29, 288.02
A: -4.49, -4.49, 4.49
M: -0.33, 0.03, 0.12
Heading: 175.18
Pitch, Roll: -10.32, -10.32
This time, the accelerometer seems stuck at -4.49, -4.49, 4.49 and the pitch & roll are stuck at -10.32, -10.32 ...

When I run the other example, LSM9DS0_SerialMenus, the accelerometer reads a constant -24539, -24539, 24539. Doesn't change.

What am I missing here? Aren't they all supposed to be changing, particularly the accelerometer with the way I'm spinning/swinging this thing?

Re: LSM9DS0 IMU Breakout problems

Posted: Sun Mar 09, 2014 9:18 am
by waltr
How are you reading the IMU chip? SPI or I2C?
Which processor? Code?

Re: LSM9DS0 IMU Breakout problems

Posted: Sun Mar 09, 2014 10:08 am
by kirash4
As I mentioned in my post, I'm running the examples that come with the library, as-is. No changes were made to the unit. By default it's set as an I2C device and I'm following three guide published by SFE: https://learn.sparkfun.com/tutorials/ls ... okup-guide

It doesn't matter what I use, but I tried an Uno, Micro, Leonardo, Mega ... No dice.

Re: LSM9DS0 IMU Breakout problems

Posted: Sun Mar 23, 2014 7:09 pm
by hmmyep
I'm having the same exact problem. Any developments on this issue?

Re: LSM9DS0 IMU Breakout problems

Posted: Mon Mar 24, 2014 12:54 pm
by kirash4
Negative. I needed to move on with my project, so this ended up on the back burner with no resolution. My next step is taking it up directly with SFE.

Re: LSM9DS0 IMU Breakout problems

Posted: Tue Mar 25, 2014 10:10 am
by Jimb0
Hey all,

I wrote the library and hookup guide. I've tested the library using a handful of breakout boards and Arduinos, and I haven't encountered any problems as you've described. So, at first glance, I'm not really sure what the problem might be. Can you try uploading something really simple to only test the accelerometer? Here's an example:
Code: Select all
#include <SPI.h> // Included for SFE_LSM9DS0 library
#include <Wire.h>
#include <SFE_LSM9DS0.h>

#define LSM9DS0_XM  0x1D // Would be 0x1E if SDO_XM is LOW
#define LSM9DS0_G   0x6B // Would be 0x6A if SDO_G is LOW
LSM9DS0 dof(MODE_I2C, LSM9DS0_G, LSM9DS0_XM);

void setup()
{
  Serial.begin(115200);
  uint16_t status = dof.begin();
  Serial.println(status, HEX);
}

void loop()
{
  dof.readAccel();
  char temp[24];
  sprintf(temp, "%d, %d, %d", dof.ax, dof.ay, dof.az);
  Serial.println(temp);
  delay(500);
}
That should work over I2C, just connect 3.3V, GND, SDA, and SCL. Assuming the boards jumpers haven't been modified. Here's an example of what on the serial port, seems good:
Code: Select all
49D4
24488, 24533, 22404
-1137, -1367, 15873
-1226, -1431, 16020
-1170, -1395, 15948
-1164, -1354, 16093
-1208, -1382, 16063
-1249, -1422, 16068
-1152, -1131, 16204
4649, -9233, 12068
5488, -6381, 13835
6601, 324, 15095
230, -2074, 14245
590, 18004, 4339
I have some thoughts on what might be happening, but I'm not sure how it would. I wonder if the accelerometer outputs are being disabled in some way. Bits 2:0 in the CTRL_REG1_XM (20h) register need to be set to 1 to enable all three accelerometer axes. The "initAccel()" function should take care of that. "setAccelODR" is the only other function that messes with CTRL_REG1_XM, maybe that's working incorrectly?

Let me know if that simplified sketch outputs correctly or not. Then we can go from there.

Re: LSM9DS0 IMU Breakout problems

Posted: Tue Mar 25, 2014 11:31 am
by kirash4
Nope, I made no modifications to the jumpers, only added a header. I will try your test when I get home later this evening.

Re: LSM9DS0 IMU Breakout problems

Posted: Tue Mar 25, 2014 7:59 pm
by kirash4
I give up, no matter what I did tonight, from changing all jumper wires, different breadboard, different controllers (Uno, Leonardo, Mega, Mini), none of them produced anything. First I tried the short code posted above and got nothing. Tried going back to the original code I had, nothing. Figured I did something wrong so I removed all wires and started from scratch. No matter what I did, I got nothing. And somewhere in there, my Leonardo also stopped responding. I can no longer upload anything to it. When I hit upload (and the compile finishes), it resets then simply returns back to what it had on it. I reloaded the bootloader in case that got corrupted. Nothing. 'L' LED just blinks at me now (and continues to blink when I attempt to upload, eventually the IDE fails.)

So yeah, I give up. I have other projects I need to work on, projects that are actually working, unlike this IMU. This is the second DOA product from SFE in less than 12 months. And somehow it also affected my Leonardo now unless I can figure out how the heck to revive it so it works properly again.

Jim, thanks for your help but I've now wasted too much time on this.

Re: LSM9DS0 IMU Breakout problems

Posted: Sat Apr 05, 2014 7:45 pm
by czechm8
Greetings,
I have a nearly identical issue. I'm getting these frozen accel raw numbers -24539 , -24539 , 24539 regardless of position. I tried the 2 example sketches for this LSM9DS0 and no luck. Then I tried the above simple sketch and still no luck. I am wondering if the hardware is faulty. Any insight that you can offer will be helpful.

Peter

Re: LSM9DS0 IMU Breakout problems

Posted: Sun Apr 06, 2014 3:36 pm
by kirash4
czechm8 wrote:Greetings,
I have a nearly identical issue. I'm getting these frozen accel raw numbers -24539 , -24539 , 24539 regardless of position. I tried the 2 example sketches for this LSM9DS0 and no luck. Then I tried the above simple sketch and still no luck. I am wondering if the hardware is faulty. Any insight that you can offer will be helpful.

Peter
You're the third person that I know saying this unit isn't working for them. After my post above, I managed to revive my Leonardo but I did not get a chance to go back to the sensor board. In fact, I doubt I will ever go back to it seeing as I'm not the only person with the identical problem. I'm going to look into something else, even if it's a different vendor altogether.

Re: LSM9DS0 IMU Breakout problems

Posted: Fri Apr 11, 2014 1:53 pm
by TS-John
Hey everyone.

There is a possibility that a few of these boards per batch went out that were defective in some way. Perhaps the sensor pins were not flowed properly and there may be cold joints or shorts present.

Anyone experiencing consistent values regardless of sensor orientation and acceleration should contact techsupport@sparkfun.com. We can asses the device and replace or refund the sensor accordingly.

Sorry for the inconvenience this has caused.
-John-

Re: LSM9DS0 IMU Breakout problems

Posted: Fri Apr 11, 2014 4:40 pm
by kirash4
Thanks John. I will give mine one more try before giving up. I might also try to heat it up again in case there is something loose.

Re: LSM9DS0 IMU Breakout problems

Posted: Mon Apr 14, 2014 10:57 am
by TS-John
Sounds good.

Sorry for the inconvenience.
-John-

Re: LSM9DS0 IMU Breakout problems

Posted: Sat May 24, 2014 5:36 pm
by PSYnergy
Hi,

I'm having similar issues.
Also using the simple example, and comms via I2C.

But, even during initialisation, there seems to be issues, as I get 0xFF back for each WHO_AM_I:
Code: Select all
LSM9DS0 WHO_AM_I's returned: 0xFFFF
Should be 0x49D4
and thereafter, the data is all the same:
Code: Select all
G: -65.02, -66.93, -68.85
A: -1.78, -1.80, -1.81
M: 1.39, 1.38, 1.36
Heading: 44.68
Pitch, Roll: -19.32, -19.53

G: -65.02, -66.93, -68.85
A: -1.78, -1.80, -1.81
M: 1.39, 1.38, 1.36
Heading: 44.68
Pitch, Roll: -19.32, -19.53

G: -65.02, -66.93, -68.85
A: -1.78, -1.80, -1.81
M: 1.39, 1.38, 1.36
Heading: 44.68
Pitch, Roll: -19.32, -19.53
I started scratching in the underlying libraries by adding some more debugging code etc, but it has not revealed anything useful.
Is there any other way to debug what is going on, or to know if the board is DOA?

Re: LSM9DS0 IMU Breakout problems

Posted: Sun Jun 01, 2014 1:01 am
by kirash4
FYI folks, I've ditched using one of the level shifting boards that SFE offers, and got a TXS0104 instead. The unit came up and worked flawlessly right of the bat. There is something to be said for using the proper hardware. That's not to say that using SFE's level shifter is wrong, it probably works just fine. I've just not been able to make it work with that. And since the TXS0104 is specifically designed for open-drain/push-pull applications, I choose that instead.

You can get free samples from TI if you just want to play with one.

Now, if I can only figure out how to get the single and double click feature working, I'd be set!