Waveshare Pico 10-DOF IMU Sensor

The Waveshare Pico 10-DOF IMU Sensor [1] shield is a pico sized multi sensor module designed for the Raspberry Pi Pico and gives the ability to collect environmental data like temperature and air pressure. It can also be used to build a robot that can detect motion and orientation. It communicates with the Raspberry Pi Pico over I2C.

Board Overview

Hardware

There are two significantly different main revisions of this shield. Revision 1 uses the ICM-20948 as DOF sensor, revision 2.1 the MPU-9250. Both sensors are functionally compatible. The major difference between the two versions is the interface for the interrupt lines. These are connected to different GPIO pins.

Printed Circuit Board Rev2.1

Printed Circuit Board Rev1

Waveshare Pico 10-DOF IMU Sensor Rev2.1 Waveshare Pico 10-DOF IMU Sensor Rev1

Features and Resources

5V/~5㎃ 3.3V/~6㎃

TP : T P 9-DOF

4 1

  • TP: temperature, humidity and air pressure

  • 9-DOF: motion and acceleration

  • 1 I2C bus interface for sensors

  • 1 GPIO to the TP device interrupt

  • 1 GPIO to the 9-DOF device interrupt

  • 1 GPIO to the 9-DOF device synchronization

  • 1 GPIO to voltage regulator for optional VEN signal

Design Data

Positions

Waveshare Pico 10-DOF IMU Sensor Rev2.1 details Waveshare Pico 10-DOF IMU Sensor Rev1 details
Waveshare Pico 10-DOF IMU Sensor Rev2.1 – MPU-9250

Revision 2.1

  1. MPU-9250
    3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer
  2. LPS22HB
    air pressure and temperature (TP) sensor
  3. RT9193-33
    300㎃ low dropout, low noise, ultra-fast LDO (5V to 3.3V)
     
     
     
     
  4. Power indicator
  5. Raspberry Pi Pico header
    for attaching to Raspberry Pi Pico, stackable design
Waveshare Pico 10-DOF IMU Sensor Rev1 – ICM-20948

Revision 1

  1. ICM-20948
    3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer
  2. LPS22HB
    air pressure and temperature (TP) sensor
  3. RT9193-33
    300㎃ low dropout, low noise, ultra-fast LDO (5V to 3.3V)
  4. LSF0204
    4-bit bidirectional multi-voltage level translator (3.3V to/from 1.8V)
  5. RT9193-18
    300㎃ low dropout, low noise, ultra-fast LDO (3.3V to 1.8V)
  6. Power indicator
  7. Raspberry Pi Pico header
    for attaching to Raspberry Pi Pico, stackable design

Data Sheets

Pinouts

Revision 2.1

Pin Mapping Rev2.1

Pinout Rev2.1

on-edge(1-40):

4 1

on-shield:

2 SENSORS : T P 9-DOF

Default Zephyr Peripheral Mapping

 

  • 1 PIO/PWM : GP0 (PWM0)
  • 2 PIO/PWM : GP1 (PWM1)
  • 3 GND
  • 4 PIO/PWM : GP2 (PWM2)
    nc alt. interrupt request MPU.INT
  • 5 PIO/PWM : GP3 (PWM3)
    nc alt. interrupt request LPS.INT
  • 6 9-DOF : GP4 (PWM4)
    nc dfl. interrupt request MPU.INT
  • 7 TP : GP5 (PWM5)
    nc dfl. interrupt request LPS.INT
  • 8 GND
  • 9 I2C1_SDA : GP6 (PWM6)
    nc sensor i/f data SDA
  • 10 I2C1_SCL : GP7 (PWM7)
    nc sensor i/f clock SCL
  • 11 PIO/PWM : GP8 (PWM8)
  • 12 PIO/PWM : GP9 (PWM9)
  • 13 GND
  • 14 PIO/PWM : GP10 (PWM10)
  • 15 PIO/PWM : GP11 (PWM11)
  • 16 PIO/PWM : GP12 (PWM12)
  • 17 PIO/PWM : GP13 (PWM13)
  • 18 GND
  • 19 PIO/PWM : GP14 (PWM14)
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 20 PIO/PWM : GP15 (PWM15)
  • 21 PIO/PWM : GP16 (PWM0)
    nc alt. frame sync. to DOF MPU.FSYNC
  • 22 PIO/PWM : GP17 (PWM1)
  • 23 GND
  • 24 PIO/PWM : GP18 (PWM2)
  • 25 PIO/PWM : GP19 (PWM3)
  • 26 PIO/PWM : GP20 (PWM4)
  • 27 PIO/PWM : GP21 (PWM5)
  • 28 GND
  • 29 9-DOF : GP22 (PWM6)
    nc dfl. frame sync. to DOF MPU.FSYNC
  • 30 RUN (RESET)
  • nc PIO/PWM : GP23 (PWM7)
  • nc PIO/PWM : GP24 (PWM8)
  • nc PIO/PWM : GP25 (PWM9)
  • 31 ADC_CH0 : GP26 (PWM10)
  • 32 ADC_CH1 : GP27 (PWM11)
  • 33 GND
  • 34 ADC_CH2 : GP28 (PWM12)
  • nc ADC_CH3 : GP29 (PWM13)
  • 35 ADC_VREF
  • 36 3V3(OUT)
  • 37 3V3_EN
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 38 GND
  • 39 VSYS
    nc on-shield LDO power enable
    nc (default) VCC_EN
  • 40 VBUS

Devicetree compatible

Waveshare Pico 10-DOF IMU Sensor Rev2.1 edge pinout

Revision 1

Pin Mapping Rev1

Pinout Rev1

on-edge(1-40):

4 1

on-shield:

2 SENSORS : T P 9-DOF

Default Zephyr Peripheral Mapping

 

  • 1 PIO/PWM : GP0 (PWM0)
  • 2 PIO/PWM : GP1 (PWM1)
  • 3 GND
  • 4 9-DOF : GP2 (PWM2)
    nc interrupt request ICM.INT
  • 5 TP : GP3 (PWM3)
    nc interrupt request LPS.INT
  • 8 GND
  • 9 I2C1_SDA : GP6 (PWM6)
    nc sensor i/f data SDA
  • 10 I2C1_SCL : GP7 (PWM7)
    nc sensor i/f clock SCL
  • 11 PIO/PWM : GP8 (PWM8)
  • 12 PIO/PWM : GP9 (PWM9)
  • 13 GND
  • 14 PIO/PWM : GP10 (PWM10)
  • 15 PIO/PWM : GP11 (PWM11)
  • 16 PIO/PWM : GP12 (PWM12)
  • 17 PIO/PWM : GP13 (PWM13)
  • 18 GND
  • 19 PIO/PWM : GP14 (PWM14)
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 20 PIO/PWM : GP15 (PWM15)
  • 21 9-DOF : GP16 (PWM0)
    nc frame sync. to DOF ICM.FSYNC
  • 22 PIO/PWM : GP17 (PWM1)
  • 23 GND
  • 24 PIO/PWM : GP18 (PWM2)
  • 25 PIO/PWM : GP19 (PWM3)
  • 26 PIO/PWM : GP20 (PWM4)
  • 27 PIO/PWM : GP21 (PWM5)
  • 28 GND
  • 29 PIO/PWM : GP22 (PWM6)
  • 30 RUN (RESET)
  • nc PIO/PWM : GP23 (PWM7)
  • nc PIO/PWM : GP24 (PWM8)
  • nc PIO/PWM : GP25 (PWM9)
  • 31 ADC_CH0 : GP26 (PWM10)
  • 32 ADC_CH1 : GP27 (PWM11)
  • 33 GND
  • 34 ADC_CH2 : GP28 (PWM12)
  • nc ADC_CH3 : GP29 (PWM13)
  • 35 ADC_VREF
  • 36 3V3(OUT)
  • 37 3V3_EN
    nc on-shield LDO power enable
    nc (optional) VCC_EN
  • 38 GND
  • 39 VSYS
    nc on-shield LDO power enable
    nc (default) VCC_EN
  • 40 VBUS

Devicetree compatible

Waveshare Pico 10-DOF IMU Sensor Rev1 edge pinout

Components

LPS22HB [12]

Default Setup

Devicetree / Kconfig

Measuring:

absolute barometric air pressure with ambient temperature (TP).

Pressure resolution:

24-bit

Pressure range:

260~1260㍱ (resolution is 0.25㍱, error ±1㍱) @ 3.3V/~0.012㎃

Temperature resolution:

16-bit

Temperature range:

-40~+85℃ (resolution is 0.01°C, error ±1.5℃)

 

LPS22HB in boards/rpipico_r3.dtsi
1wsptdis_sens_tp: lps22hb@5c {
2	status = "disabled";
3	compatible = "st,lps22hb-press";
4	reg = <0x5c>;
5};

MPU-9250 [14] with AK8963 [7] (ICM-20948 [10] with AK09916 [7])

Default Setup

Devicetree / Kconfig

Measuring:

motion and acceleration (9-DOF) with 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer (compass). Also measuring the internal chip temperature.

Accelerometer resolution:

16-bit

Accelerometer range (configurable):

acceleration: ±2, ±4, ±8, ±16g @ 3.3V/~0.45㎃

Gyroscope resolution:

16-bit

Gyroscope range (configurable):

angular velocity: ±250, ±500, ±1000, ±2000°/ₛ @ 3.3V/~3.20㎃

Magnetometer resolution:

16-bit

Magnetometer range:

flux: ±4800µT (±4900µT) @ 3.3V/~0.28㎃

Temperature range:

-40~+85℃ (resolution is 0.05°C, error ±3%) @ 1.8V/~1.720㎃

Accelerometer:
  • full scale (range) set to ±2g

  • digital low pass filter set to fₘ=5.05㎐

  • 3㏈ with 32.48㎳ delay at sample rate fₛ=1㎑

Gyroscope:
  • full scale (range) set to ±250°/ₛ

  • digital low pass filter set to fₘ=5㎐

  • 3㏈ with 33.48㎳ delay at sample rate fₛ=1㎑

Magnetometer:
  • yielding factor on-chip is 0.14997558 (4912µT/32752µT⁻¹)

  • Zephyr unit is Gauss (10⁴T), so the sbsolute yielding factor for Zephyr sensor API is hard set to 1499

Sample rate:
  • fₛ=1㎑ scaled by 1/(1+9) and set to fₛₒ=100㎐

INTERIME SUPPORT, because of obsolete component

MPU-9250 in boards/rpipico_r3.dtsi
 1wsptdis_sens_dof: mpu9250@68 {
 2	status = "disabled";
 3	compatible = "invensense,mpu9250";
 4	reg = <0x68>;
 5	accel-fs = <2>;
 6	accel-dlpf = "5.05";
 7	gyro-fs = <250>;
 8	gyro-dlpf = <5>;
 9	gyro-sr-div = <9>;
10};

NOT YET SUPPORTED, because of missing driver

  • Devicetree compatible: invensense,icm20948

RT9193-33 [5] (and RT9193-18 [5])

Default Setup

Devicetree / Kconfig

Ultra-low noise, ultra-fast CMOS LDO regulator for 3.3V

  • Low Dropout of 220㎷ @ 300㎃

  • Standby current < 0.01μA when shutdown

  • Quick start-up (typically 50㎲)

  • Output voltage accuracy ±2%

  • Up to 300㎃ max output current

  • Output current limit protection at 360~400㎃

  • Thermal limit protection at 165°C

 

 

Revision Distinction

LPS22HB

Revision 2.1

Revision 1

LPS22HB in boards/waveshare_pico_10dof_imu_sensor_r2/rpipico_r3.dtsi
1&wsptdis_sens_tp {
2	status = "okay";
3	/*
4	 * Interrupt request connected at
5	 * GP5 but not supported by driver:
6	 * irq-gpios = <&rpipico_header 5 GPIO_ACTIVE_HIGH>;
7	 */
8};
LPS22HB in boards/waveshare_pico_10dof_imu_sensor_r1/rpipico_r3.dtsi
1&wsptdis_sens_tp {
2	status = "okay";
3	/*
4	 * Interrupt request connected at
5	 * GP3 but not supported by driver:
6	 * irq-gpios = <&rpipico_header 3 GPIO_ACTIVE_HIGH>;
7	 */
8};

MPU-9250 (ICM-20948)

Revision 2.1

Revision 1

MPU-9250 in waveshare_pico_10dof_imu_sensor_r2.conf
1CONFIG_MPU9250_TRIGGER_NONE=n
MPU-9250 in boards/waveshare_pico_10dof_imu_sensor_r2/rpipico_r3.dtsi
1&wsptdis_sens_dof {
2	status = "okay";
3	irq-gpios = <&rpipico_header 4 GPIO_ACTIVE_HIGH>;	/* GP4 */
4	/*
5	 * Frame synchronize connected at
6	 * GP22 but not supported by driver:
7	 * fsync-gpios = <&rpipico_header 22 GPIO_ACTIVE_HIGH>;
8	 */
9};
MPU-9250 in waveshare_pico_10dof_imu_sensor_r1.conf
1CONFIG_MPU9250_TRIGGER_NONE=n
MPU-9250 in boards/waveshare_pico_10dof_imu_sensor_r1/rpipico_r3.dtsi
1&wsptdis_sens_dof {
2	status = "okay";
3	irq-gpios = <&rpipico_header 2 GPIO_ACTIVE_HIGH>;	/* GP2 */
4	/*
5	 * Frame synchronize connected at
6	 * GP16 but not supported by driver:
7	 * fsync-gpios = <&rpipico_header 16 GPIO_ACTIVE_HIGH>;
8	 */
9};

INTERIME SUPPORT, because of missing correct driver for ICM-20948.

Utilization

Sensing Subsystem

The shield is ready for using with the Zephyr Sensing Subsystem. The interface is disabled for default and can be enabled by an application overlay app.overlay (see Application Development).

Sensing Interface on Shield Level

Overlay Content on Application Level

Sensing Interface in waveshare_pico_10dof_imu_sensor.dtsi
 1/ {
 2    wsptdis_sensing: wsptdis-sensing {
 3        compatible = "zephyr,sensing";
 4        status = "disabled";
 5
 6        wsptdis_accel: wsptdis-accel {
 7            compatible = "zephyr,sensing-phy-3d-sensor";
 8            status = "disabled";
 9            sensor-types = <SENSING_SENSOR_TYPE_MOTION_ACCELEROMETER_3D
10                    SENSING_SENSOR_TYPE_MOTION_GYROMETER_3D
11                    SENSING_SENSOR_TYPE_MOTION_MOTION_DETECTOR>;
12            friendly-name = "WSP 10-DOF IMU Shield Accelerometer";
13            minimal-interval = <625>;
14            underlying-device = <&wsptdis_sens_dof>;
15        };
16    };
17};
  • for the interface:

    &wsptdis_sensing { status = "okay"; };

  • for the accelerometer sensor:

    &wsptdis_accel { status = "okay"; };

Programming

Set -DSHIELD=<shield_name_with_rev> to the right shield revision when you invoke west build or cmake in your Zephyr application. For example:

  • for Revision 2.1: -DSHIELD=waveshare_pico_10dof_imu_sensor_r2

  • for Revision 1: -DSHIELD=waveshare_pico_10dof_imu_sensor_r1

The following examples use the shield in revision 2.1. If these should be used for revision 1, the variable SHIELD must be adapted accordingly.

Startup logging output on target

***** delaying boot 4000ms (per build configuration) *****
[00:00:00.331,000] <wrn> udc_rpi: BUS RESET
[00:00:00.411,000] <wrn> udc_rpi: BUS RESET
*** Booting Zephyr OS build v4.1.0 (delayed boot 4000ms) ***
Hello World! I'm THE SHELL … … …
uart:~$ 

Using west:

west build -b rpi_pico -p -S usb-console --shield waveshare_pico_10dof_imu_sensor_r2 -d build/waveshare_pico_10dof_imu_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_10dof_imu_sensor-helloshell

Using CMake and ninja:

# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_10dof_imu_sensor-helloshell -GNinja -DBOARD=rpi_pico -DSHIELD="waveshare_pico_10dof_imu_sensor_r2" bridle/samples/helloshell

# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_10dof_imu_sensor-helloshell flash

Simple test execution on target

(text in bold is a command input)

uart:~$ hello -h
hello - say hello
uart:~$ hello
Hello from shell.
uart:~$ hwinfo devid
Length: 8
ID: 0x8c998be1de969148

uart:~$ kernel version
Zephyr version 4.1.0

uart:~$ bridle version
Bridle version 4.1.0

uart:~$ bridle version long
Bridle version 4.1.0.0

uart:~$ bridle info
Zephyr: 4.1.0
Bridle: 4.1.0
uart:~$ device list
devices:
- clock-controller@40008000 (READY)
  DT node labels: clocks
- reset-controller@4000c000 (READY)
  DT node labels: reset
- snippet_cdc_acm_console_uart (READY)
  DT node labels: snippet_cdc_acm_console_uart
- uart@40034000 (READY)
  DT node labels: uart0 pico_serial rpipico_serial
- timer@40054000 (READY)
  DT node labels: timer
- gpio@40014000 (READY)
  DT node labels: gpio0
- adc@4004c000 (READY)
  DT node labels: adc
- flash-controller@18000000 (READY)
  DT node labels: ssi
- i2c@40048000 (READY)
  DT node labels: i2c1 pico_i2c1 rpipico_i2c1
- vreg@40064000 (READY)
  DT node labels: vreg
- rtc@4005c000 (READY)
  DT node labels: rtc
- leds (READY)
- lps22hb@5c (READY)
  DT node labels: wsptdis_sens_tp
- mpu9250@68 (READY)
  DT node labels: wsptdis_sens_dof
uart:~$ history
[  0] history
[  1] device list
[  2] bridle info
[  3] bridle version long
[  4] bridle version
[  5] kernel version
[  6] hwinfo devid
[  7] hello
[  8] hello -h

More Samples

LPS22HB Pressure and Temperature Sensor

This sample shows how to use the Sensors API driver for the STM LPS22HB MEMS pressure sensor. See also Zephyr sample: LPS22HB Temperature and Pressure Sensor.

west build -b rpi_pico -p -S usb-console --shield waveshare_pico_10dof_imu_sensor_r2 -d build/waveshare_pico_10dof_imu_sensor-lps22hb zephyr/samples/sensor/lps22hb
west flash -r uf2 -d build/waveshare_pico_10dof_imu_sensor-lps22hb

The Default Shield Sample

See also Waveshare Pico 10-DOF IMU Sensor Sample in Bridle.

west build -b rpi_pico -p -S usb-console --shield waveshare_pico_10dof_imu_sensor_r2 -d build/waveshare_pico_10dof_imu_sensor bridle/samples/waveshare_pico_10dof_imu_sensor
west flash -r uf2 -d build/waveshare_pico_10dof_imu_sensor

References