ISSUES WITH LSM9DS0

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

ISSUES WITH LSM9DS0

Post by VictorAlbaT »

I am using an Arduino Due, motion sensor LSM9DS0 and xBee for develop a remote motion sensor. All is fine at start, I got all telemetry data at Rx Arduino but it stop working in some random point in the time.
So, I used the example code from LSM9DS0 library "lsm9doftest", that is the response:

Temp: 0
Accel X: -1083 Y: 56 Z: 15396
Mag X: -902 Y: 1319 Z: -585
Gyro X: 197 Y: 70 Z: -218

Temp: 14
Accel X: -1082 Y: 46 Z: 15512
Mag X: -895 Y: 1330 Z: -595
Gyro X: -17 Y: 42 Z: -158

All is good I got some data there. The program continue working and then...

Temp: -1
Accel X: -1 Y: -1 Z: -1
Mag X: -1 Y: -1 Z: -1
Gyro X: -1 Y: -1 Z: -1

Temp: -1
Accel X: -1 Y: -1 Z: -1
Mag X: -1 Y: -1 Z: -1
Gyro X: -1 Y: -1 Z: -1

...the motion sensor stop working until a power reset is done. It appear to enter in sleep mode.

It is a navigation system for a quadcopter, I attach the wiring.
Only Rx and TX pins are used on XBEE
Only Rx and TX pins are used on XBEE
Diagrama de conexion 2_bb.png (644.29 KiB) Viewed 1134 times
P.D.: Sorry for bad English

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

Please post some pictures of your wiring and soldering

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

Here, this is
WP_20170724_18_16_54_Pro_LI.jpg
WP_20170724_18_16_54_Pro_LI.jpg (409.2 KiB) Viewed 1072 times
WP_20170724_18_15_39_Pro_LI.jpg
WP_20170724_18_15_39_Pro_LI.jpg (418.04 KiB) Viewed 1072 times
WP_20170724_18_12_54_Pro_LI.jpg
WP_20170724_18_12_54_Pro_LI.jpg (338.16 KiB) Viewed 1072 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

Well, the solder on SCL doesn't look very good.

But I'm concerned that you're running everything off 3.3V. On the Mega, maximum current draw on 3.3V is 50mA. The XBee will use much more than that:
TX Peak Current: 250mA
RX Current: 55 mA (@3.3 V)
Could be that the LSM is getting starved for current and resetting.

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

I re-soldered the "floating pins"
WP_20170725_12_01_52_Pro_LI1.jpg
WP_20170725_12_01_52_Pro_LI1.jpg (903.51 KiB) Viewed 1055 times
Yes. I'm using all at 3.3V, but it is not Mega is Due, so 250mA Tx XBee current + 25mA GPS tracking + 6.45mA LSM normal mode is minor than 800mA provided by Due.
LSM.png
LSM.png (11 KiB) Viewed 1055 times
Then, I do a new test with "sensorapi" example form LSM library. The issue still there

Accel X: -0.35 Y: -0.12 Z: 9.50 m/s^2
Magn. X: -0.15 Y: 0.09 Z: -0.04 gauss
Gyro X: 0.92 Y: -0.61 Z: -0.88 dps
Temp: 25.37 *C
**********************

Accel X: -0.37 Y: -0.13 Z: 9.47 m/s^2
Magn. X: -0.15 Y: 0.09 Z: -0.04 gauss
Gyro X: 0.77 Y: -0.28 Z: -1.06 dps
Temp: 25.50 *C
**********************

Accel X: -0.36 Y: -0.12 Z: -0.00 m/s^2
Magn. X: -0.00 Y: -0.00 Z: -0.00 gauss
Gyro X: -0.01 Y: -0.01 Z: -0.01 dps
Temp: 20.87 *C
**********************

Accel X: -0.00 Y: -0.00 Z: -0.00 m/s^2
Magn. X: -0.00 Y: -0.00 Z: -0.00 gauss
Gyro X: -0.01 Y: -0.01 Z: -0.01 dps
Temp: 20.87 *C
**********************

Accel X: -0.00 Y: -0.00 Z: -0.00 m/s^2
Magn. X: -0.00 Y: -0.00 Z: -0.00 gauss
Gyro X: -0.01 Y: -0.01 Z: -0.01 dps

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

Ah, a Due! Sorry - I missed that.

There is a problem with I2C on the Due. See this thread:
http://forum.arduino.cc/index.php?topic ... msg2947227

However, the problem was apparently fixed. We actually didn't know about this, so the LSM9DS0 library hasn't incorporated the fix.

I don't happen to have a LSM9DS0 here, so I can't test this. However, I've updated the library with the apparent fix. Try it out and see if it works:
Adafruit_LSM9DS0.zip
(218.91 KiB) Downloaded 39 times

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

Unfortunately is not working, the result is:
2017-07-28_170118.png
2017-07-28_170118.png (5.83 KiB) Viewed 1012 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

Aha! OK - I got one of the arguments to requestFrom wrong. Just checked the datasheet for the processor...

In the Adafruit_LSM9DS0.cpp file, find line 408 and change the fourth argument to 0:

Code: Select all

    _wire->requestFrom(address, len, reg, 0, true);

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

Ok, I changed it

Code: Select all

  if (_i2c) {
//    _wire->beginTransmission(address);
//    _wire->write(reg);
//    _wire->endTransmission();
//    _wire->requestFrom(address, (byte)len);
      
    _wire->requestFrom(address, len, reg, 0, true);

    for (uint8_t i=0; i<len; i++) {
      buffer[i] = _wire->read();
    }
  }
There is an addressing error
2017-07-30_164021.png
2017-07-30_164021.png (4.24 KiB) Viewed 985 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

sigh. Alright - I'll order an LSM9DS0 and try to figure this out.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

OK! It's fixed! Please update to the latest version, either with Library Manager or from here:
https://github.com/adafruit/Adafruit_LSM9DS0_Library

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

Well, updating or downloading from library manager result in SPCR error described in this topic viewtopic.php?f=22&t=60789. So, I downloaded it from Github but it seems is not working, the issue is still there.
I changed board to Uno, it work fine all time, but I need to use the Due in this case.

P.D.: Sorry for late answer, I was so bussy.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

I'm not seeing that. I'm using library version 1.0.3. There are no references to SPCR in the library.

User avatar
VictorAlbaT
 
Posts: 7
Joined: Wed Jul 19, 2017 6:00 pm

Re: ISSUES WITH LSM9DS0

Post by VictorAlbaT »

Let see, library manager just offer version 1.0.0 - 1.0.1, also we can see I'm using v1.0.3 too.
libraryManager.png
libraryManager.png (20.1 KiB) Viewed 903 times
Uninstalling and re installing it from library manager shows the same
libraryManager1.png
libraryManager1.png (19.67 KiB) Viewed 903 times
GitHub let us download version 1.0.3
github.png
github.png (27.13 KiB) Viewed 903 times
Anyway I still getting "no response" from LSM at random time in version 1.0.3 using Due. Arduino Uno can run all day whitout trouble.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ISSUES WITH LSM9DS0

Post by adafruit_support_rick »

VictorAlbaT wrote:Anyway I still getting "no response" from LSM at random time in version 1.0.3 using Due. Arduino Uno can run all day whitout trouble.
So. it runs well for some time, then stops? I don't think there's anything I can do about that. It won't run at all without the fix. So, the fix must be working. Beyond that it's a problem with I2C on the Due that I can't control.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”