cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSO sensor + Arduino

gndLD
Associate II

Hello! 

First I would like to state my issue: 

1. My software cannot connect to the LSM6DSO IMU sensor.

 

A little background on my project is that I am trying to use the IMU sensor to provide accelerometer readings in x, y, and z directions. I purchased a breakout board from Sparkfun that uses the LSM6DSO to test the sensor first with my Arduino-compatible controller via SPI communication. This proved that it works. 

We then created our own design and referenced the way Sparkfun wired the LSM6DSO. Now when I run the program on the new board, the sensor doesn't work. 

I looked into the library that Sparkfun uses for programming in Arduino and I see that it cannot connect to the IMU sensor. In the library I can see where it fails and it fails when checking the part ID. I keep getting a part ID of 255 which is 0xFF. I should be getting a part ID of 108 or 0x6C.

Any ideas on what I can do to make it work?

 

 

 

uint8_t partID;
readRegister(&partID, WHO_AM_I_REG);
if( partID != 0x6C ){
    Serial.println(partID);
    return IMU_HW_ERROR;
}
else{
    Serial.println(partID);
    return IMU_SUCCESS;
}

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gndLD
Associate II

Solved. The wrong pin was assigned to MISO in the SPI config file. For me in Arduino that was in the pins_arduino.h file.

 

View solution in original post

2 REPLIES 2
gndLD
Associate II

I had a Bluetooth module that snapped into our PCB and thought it was a good idea to snap it off and only debug the IMU sensor. After I snapped it off, I am now getting a part ID of 0. Also the MISO line before didn't have a signal, now it does but still wrong part ID read. Therefore, I still get nothing for the accelerometer reading of the sensor.

gndLD
Associate II

Solved. The wrong pin was assigned to MISO in the SPI config file. For me in Arduino that was in the pins_arduino.h file.