Problems with a Waveshare Pico-10DOF-IMU

New to Pico… be gentle.
Purchased Rasberry Pi Pico 2020 with stackable headers and a Waveshare Pico-10DOF-IMU Rev2.1 (ICM20948 version).

Downloaded the MicroPython UF2 (rp2-pico-20230426-v1.20.0.uf2) to the board.

Ran a basic Blink test on the board – was OK.

Followed the Waveshare Wiki

Connected the Pico-10DOF-IMU.

Downloaded the Demo code.

Saved the icm20948.py to the Rasberry Pi Pico board as main.py.

Pointed the board North in a stationary position.

Ran the Pico

Received a “ZeroDivisionError: divide by zero” in line 309.

This line does a 1 / (axax + ayay +az*az)

Where ax,ay and az are read accelerometer values.

I place the following over the impacted code:

if not (ax == 0 and ay == 0 and az == 0):

At this point I’m surprised the basic test code fails, even though the board is stationary. I expected accelerometer values ~0 with -1 g in the z axis.

The code runs with the following:

Roll= 40.37, Pitch= 15.94, Yaw= -131.82 (floating with variation of about 20-30 each)

Acceleration XYZ: all zero

Gyroscope XYZ: all zero

Magnetic XYZ: 26372, -14580, -21567 (These appear to float between +/- 32000)

At this point I’m thinking the Pico-10DOF-IMU is stuffed.

The ICM20948 data sheet discusses Power Modes (pg 26)

I want 9-Axis Mode: Mode = 8

I would assume the test software is configured for this.

Code lines 132 & 134 (ICM20948.py) set PWR_MGMT_1 – Data Sheet (pg 32 & pg 37)

Line 132 seems to do a reset 0x80.

Line 134 seems to set 0x01

At this point I am out of my depth because the config looks wrong to me but am too much of a noob to get it going without working code to adapt.

Time to try a new approach so I load the Ips22hbtr.py to check the barometer and temp thinking this may be easier to validate.

Takes a few seconds for the barometer to stabilise but then provides solid output:

Pressure = 948.11 hPa , Temperature = 21.99 °C

When I check onlne, the local pressure is reportedly 1021.8 hPa. Room temp is about 16 degrees.

1 Like

Hi Greg, Welcome to the forum!

You’ve done everything right from what I can see, and the library clearly wasn’t expecting zeros, so maybe your chip is faulty. Could you share a photo of how you’ve got everything hooked up? It’s pretty self explanatory, but I just wanted to check.

In the meantime, I’ll grab one of these off the shelf and test the demo code here, and see if I have the same problem. If I don’t, I’ll let you know how best to get that part replaced.

Hi James,
Thanks for getting back to me.
Please find the attached photo,
Regards
Greg

Hi James,

Any updates?

Regards
Greg

Hi Greg,

Sorry it took me so long to get to this, it must’ve slipped through the cracks.

You’ve got everything hooked up correctly, and when I ran the demo code with everything hooked up just as you did, it ran just fine with no errors, so I think this is a hardware failure.

Reply to your order confirmation email with a link to this forum post, and we’ll start the RMA process for you and get your project back on track!