Error connecting LIS3DH to Raspberry Pi Pico W

Hello,

I am trying to connecting PiicoDev 3-Axis Accelerometer LIS3DH to a Raspberry Pi Pico W. I have the latest UF2 file and am using the code from this repository:

I get the following error when I try to run any of the examples:

PiicoDev could not communicate with module at address 0x19, check wiring
Traceback (most recent call last):
File “”, line 14, in
File “PiicoDev_LIS3DH.py”, line 101, in init
File “PiicoDev_LIS3DH.py”, line 88, in init
File “PiicoDev_LIS3DH.py”, line 111, in deviceID
OSError: [Errno 5] EIO

When I print out results of i2c.scan() the device appears in the list:
Result of i2c scan: 0x19

And the green led on the board itself is on so I assume it’s not a connection issue. Any advice on how to proceed would be much appreciated. I’m at a bit of a loss of where the problem lies. Thank you!

1 Like

Hi Vanessa
I don’t know much about RPi devices or the PicoDev device but the bit I do note is that the common denominator here is the “PiicoDev_LIS3DH.py” statement
I first thought that it might have been the double “i” but is seems like I have been spelling “PicoDev” wrong all this time. Must be something else.
Just a thought.
Cheers Bob

1 Like

Hi Vanessa,

Welcome to the forum!!

Would it be possible to send through some photos of your setup?

I just fired up a test setup with the PiicoDev adapter, Pico W, and the Accelerometer and was able to get the tilt example to work.

Keen to get to the bottom of this one!
Liam

Hi Liam, thank you for the welcome! It’s all very perplexing. I’ve attached an image of the setup. I also tried the example with a different accelerometer and cable and I get the same result.

Hi Vanessa,

Thanks for sending that through. Its odd that you’re getting this result. If you flip the switch and change the address in the PiicoDev_LIS3DH.py file to 0x18 do you still get the issue? Do you have another Pico that you can try on?

Hi Jack,

It is weird. I re-uploaded the UF2 file to see if that would help anything and it’s working now! I have no idea what was causing the issue in the first place.

I’m going to wait and see if the problem comes up again.

1 Like

Hi Vanessa,

Glad to hear it’s working, sometimes starting from scratch just works. Hopefully you don’t run into that issue again but if you do we’re here to help.