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.
P.D.: Sorry for bad English
ISSUES WITH LSM9DS0
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
Please post some pictures of your wiring and soldering
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
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:
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:
Could be that the LSM is getting starved for current and resetting.TX Peak Current: 250mA
RX Current: 55 mA (@3.3 V)
- VictorAlbaT
- Posts: 7
- Joined: Wed Jul 19, 2017 6:00 pm
Re: ISSUES WITH LSM9DS0
I re-soldered the "floating pins"
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
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.
Then, I do a new test with "sensorapi" example form LSM library. The issue still thereAccel 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
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
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:
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:
- VictorAlbaT
- Posts: 7
- Joined: Wed Jul 19, 2017 6:00 pm
Re: ISSUES WITH LSM9DS0
Unfortunately is not working, the result is:
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
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:
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);
- VictorAlbaT
- Posts: 7
- Joined: Wed Jul 19, 2017 6:00 pm
Re: ISSUES WITH LSM9DS0
Ok, I changed it
There is an addressing error
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();
}
}
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
sigh. Alright - I'll order an LSM9DS0 and try to figure this out.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
OK! It's fixed! Please update to the latest version, either with Library Manager or from here:
https://github.com/adafruit/Adafruit_LSM9DS0_Library
https://github.com/adafruit/Adafruit_LSM9DS0_Library
- VictorAlbaT
- Posts: 7
- Joined: Wed Jul 19, 2017 6:00 pm
Re: ISSUES WITH LSM9DS0
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.
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.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
I'm not seeing that. I'm using library version 1.0.3. There are no references to SPCR in the library.
- VictorAlbaT
- Posts: 7
- Joined: Wed Jul 19, 2017 6:00 pm
Re: ISSUES WITH LSM9DS0
Let see, library manager just offer version 1.0.0 - 1.0.1, also we can see I'm using v1.0.3 too.
Uninstalling and re installing it from library manager shows the same
GitHub let us download version 1.0.3
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.- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: ISSUES WITH LSM9DS0
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.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.
Please be positive and constructive with your questions and comments.