How to test if a LIS3DSH is working?
-
Greetings!
So I ordered a cheap LIS3DSH from Aliexpress. I wanted to just test if it was working so I used basic Adafruit libraries with an Uno. I ordered the LIS3DSH , but it looked like they did a switcharoo for a LIS3DH.
I am more familiar with I2C, so I ran an I2C scanner to see what MCU I had. It gave me 0x1D. Couldn't really google to find out which version I had. I did find a library for the LIS3DSH that referenced 0x1D. So maybe they did send me the correct Mems.
Because Adafruit library was for the LIS3DH. I couldn't get it to work even when I changed the I2C address to 0x1D. It would give me:
On serial monitor:
Accelerometer:
X = 15.4039
Y = 15.4039
Z = 15.4039But it would not move.
I then hooked it up via SPI. same issue.
Does SPI use the same Hex address as I2C? I didn't see 0x1D defined.
So going to my main question. I will hook it up to the Duet. Is there any function to verify that it is transmitting data? Does duet automatically recognize both versions of the LIS3DSH /LIS3DH or do I need to specify which one.
I'm mostly sure it is the better LIS3DSH, but not sure. Nor have I confirmed it is working. I guess the fact that I can scan the address is good. And I'm guessing it was reading some serial data from the board. But weird that the data does not move.
Thanks!
Max
-
@westech, SPI doesn't use an I2C address because it uses the CS signal to tell the chip that it is being addressed.
The response to the M955 command to configure the accelerometer will say whether the chip was detected and responded correctly, and which type of chip it is.
-
@westech check the code on the chip.
3CH = LIS3DH
DSH = LIS3DSH -
@tekkydave Thanks, it does say DSH so it is the better version LIS3DSH. I'll try hooking it up and see if it is recognized.
-
I just hooked up a clone of the same board in your photo. On my first attempt, tI have a couple of cold solder joints at the board and I got a message that there was no accelerometer detected, so I can vouch that there is a check. After fixing the soldering, it ID'd the accelerometer correctly. I followed the guidance on this doc page: https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_Accelerometer.
I had a hard time identifying the orientation for the X axis at first because I had my max acceleration set to 500mm/sec^2 and the accel readings on bot X and Y looked about the same. After cranking the max accel up to 10,000 (sounds high, but it's just 1g), I could clearly see the difference in a 1 axis move.
Now I just need to figure out what all those squiggly lines mean...
-
@mikeabuilder Thanks Mike!
-
This post is deleted!