Skip to main content
Visitor II
November 27, 2024
Solved

LSM6DSO sensor + Arduino

  • November 27, 2024
  • 2 replies
  • 1163 views

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;
}

 

 

 

 

    This topic has been closed for replies.
    Best answer by gndLD

    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.

     

    2 replies

    gndLDAuthor
    Visitor II
    November 27, 2024

    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.

    gndLDAuthorAnswer
    Visitor II
    December 6, 2024

    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.