Product: SEN-13284, found here: https://www.sparkfun.com/products/13284
Hi all, I’m using the LSM9DS1 to prototype a small project that uses an Arduino Pro Mini (3.3V) and LED pixel strips.
The function of the LSM9DS1 is to simply detect motion based on changes in acceleration, wake up the Arduino via an interrupt pin (in this case D2). After the Arduino wakes up, it should pulse the LEDs for two minutes, after which it should then go back to sleep, but that’s not relevant to my issue here.
I have wired the LSM9DS1 exactly as described in the hookup guide, using the I2C interface as default. Using a multimeter, I confirmed there were no shorts or connection failures due to soldering. I am using the correct voltage for the part: powering the LSM9DS1 off of the Arduino’s 3.3V VCC pin, and as far as I can tell, there is no damage in the hardware (no jumpers cut, no inadvertent solder joints, etc.)
I built and flashed the example code from the official SparkFun library, with no modifications other than changing
INT2_PIN_DRDY = 2 // instead of pin 4
(see here: https://github.com/sparkfun/SparkFun_LS … rrupts.ino)
The interrupts fire constantly, even under the raw value that should be the threshold (multiplying 20 by 218 like the example says), and then seems to “stick”, and never stop:
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
A: 0, 0, 0
G: 0, 0, 0
M: 0, 0, 0
A: 0, 0, 0
G: 0, 0, 0
M: 0, 0, 0
A: 0, 0, 0
G: 0, 0, 0
M: 0, 0, 0
A: 0, 0, 0
G: 0, 0, 0
M: 0, 0, 0
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 5
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 2
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
INT1 Duration: 4
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 29
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 43
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 291
A: 0, 0, 0
G: 0, 0, 0
M: 0, 0, 0
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 25
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 178
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 47
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
INT1 Duration: 133
INT1 Active!
Gyro int: 0x2A
Accel int: 0x0
When I change the logic to ACTIVE_HIGH (change interrupts to ACTIVE_HIGH, change the conditionals to check for HIGH, change the pinmodes to INPUT instead of INPUT_PULLUP) the interrupt seems to trigger and never stop:
INT1 Active!
Gyro int: 0x0
Accel int: 0x2A
As far as I can tell, NOTHING changes after I change the imu object’s settings (accelerometer scale, threshold, even which axes generate interrupts).
For context, the IMU works perfectly when reading accel/gyro/mag values, giving me pretty accurate and consistent readings!
Can anyone tell me what I’m doing wrong? I feel like I’m either missing something totally obvious in the library, or my unit is defective.
Thanks!