Waveshare Pico Environment Sensor
The Waveshare Pico Environment 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 & humidity, air pressure, ambient light intensity, VOC, UV rays, etc. 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
Features and Resources |
Printed Circuit Board |
5V/~8.5㎃ 3.3V/~10㎃ 1.8V/~5㎃ THP : T H P VOC ALS UVS 9-DOF 1 1
Design Data |
![]() |
Positions
Data Sheets
Pinouts
Components
Default Setup |
Devicetree / Kconfig |
|
|
|
BME280 in boards/rpipico_r3.dtsi
1wspes_sens_thp: bme280@76 {
2 status = "okay";
3 compatible = "bosch,bme280";
4 reg = <0x76>;
5};
|
Default Setup |
Devicetree / Kconfig |
|
|
|
SGP40 in boards/rpipico_r3.dtsi
1wspes_sens_voc: sgp40@59 {
2 status = "okay";
3 compatible = "sensirion,sgp40";
4 reg = <0x59>;
5 enable-selftest;
6};
|
Default Setup |
Devicetree / Kconfig |
|
|
|
NOT YET SUPPORTED, because of missing driver
|
Default Setup |
Devicetree / Kconfig |
|
|
|
NOT YET SUPPORTED, because of missing driver
|
ICM-20948 [10] with AK09916 [5] (MPU-9250 [14] with AK8963 [5]) |
Default Setup |
Devicetree / Kconfig |
|
|
INTERIME SUPPORT, because of obsolete component MPU-9250 in boards/rpipico_r3.dtsi
1wspes_sens_dof: mpu9250@68 {
2 status = "okay";
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};
MPU-9250 in waveshare_pico_environment_sensor.conf
1CONFIG_MPU9250_TRIGGER_NONE=y
NOT YET SUPPORTED, because of missing driver
|
Default Setup |
Devicetree / Kconfig |
|
Ultra-low noise, ultra-fast CMOS LDO regulator for 3.3V and 1.8V
|
|
|
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_environment_sensor.overlay
1/ {
2 wspes_sensing: wspes-sensing {
3 compatible = "zephyr,sensing";
4 status = "disabled";
5
6 wspes_accel: wspes-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 Environment Shield Accelerometer";
13 minimal-interval = <625>;
14 underlying-device = <&wspes_sens_dof>;
15 };
16 };
17};
|
|
Programming
Set -DSHIELD=waveshare_pico_environment_sensor
when you invoke
west build
or cmake
in your Zephyr application. For example:
Using west:
west build -b rpi_pico -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_environment_sensor-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_environment_sensor-helloshell -GNinja -DBOARD=rpi_pico -DSHIELD="waveshare_pico_environment_sensor" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_environment_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@40044000 (READY)
DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0
- vreg@40064000 (READY)
DT node labels: vreg
- rtc@4005c000 (READY)
DT node labels: rtc
- leds (READY)
- bme280@76 (READY)
DT node labels: wspes_sens_thp
- sgp40@59 (READY)
DT node labels: wspes_sens_voc
- mpu9250@68 (READY)
DT node labels: wspes_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
The Waveshare Pico Environment Sensor provides four on-shield sensors connected on I2C0.
uart:~$ i2c scan i2c@40044000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
5 devices found on i2c@40044000
The I2C address
0x29
is the ASM TSL25911 [20], an ambient IR and visible light sensor (ALS).The I2C address
0x53
is the LITEON LTR-390UV-01 [12], an ambient ultraviolet (UV) light sensor (UVS).The I2C address
0x59
is the Sensirion SGP40 [18], an air quality sensor, Volatile Organic Compounds (VOC).The I2C address
0x68
is the InvenSense ICM-20948 [10] with AK09916 [5] or in old hardware releases the MPU-9250 [14] with AK8963 [5], an motion and acceleration sensor (9-DOF) with 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer (compass).The I2C address
0x76
is the Bosch BME280 [8], an temperature, humidity and air pressure sensor (THP).
The “Who am I” register of the InvenSense MPU-9250 9-DOF sensor can read
from register 0x75
and must be 0x71
:
uart:~$ i2c read_byte i2c@40044000 68 75
Output: 0x71
The Chip-ID of the Bosch BME280 environmental sensor can read from
register 0xd0
and must be 0x60
:
uart:~$ i2c read_byte i2c@40044000 76 d0
Output: 0x60
uart:~$ sensor info
device name: bme280@76, vendor: Bosch Sensortec GmbH, model: bme280, friendly name: (null)
device name: mpu9250@68, vendor: InvenSense Inc., model: mpu9250, friendly name: (null)
device name: sgp40@59, vendor: Sensirion AG, model: sgp40, friendly name: (null)
BME280 (THP)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=40464800000ns (28.069999)
channel idx=14 press shift=7 num_samples=1 value=40464800000ns (100.944643)
channel idx=16 humidity shift=7 num_samples=1 value=40464800000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=44841400000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=44841400000ns (100.945768)
channel idx=16 humidity shift=7 num_samples=1 value=44841400000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=45757900000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=45757900000ns (100.945596)
channel idx=16 humidity shift=7 num_samples=1 value=45757900000ns (37.604491)
SGP40 (VOC)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=2 num_samples=1 value=7499000000ns (1.999999)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=8509500000ns (3553.196197)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=9527500000ns (4021.196197)
MPU-9250 (9-DOF)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=133465500000ns, (-0.152630, -0.034118, -9.957485)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=133465500000ns, (0.010923, -0.001465, 0.018784)
channel idx=11 magn_xyz shift=5 num_samples=1 value=133465500000ns, (0.021287, 0.918931, -0.960458)
channel idx=12 die_temp shift=5 num_samples=1 value=133465500000ns (30.772454)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=134743500000ns, (-0.150237, -0.036512, -9.961675)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=134743500000ns, (0.010790, -0.001732, 0.019184)
channel idx=11 magn_xyz shift=5 num_samples=1 value=134743500000ns, (0.010643, 0.940219, -0.957040)
channel idx=12 die_temp shift=5 num_samples=1 value=134743500000ns (30.769460)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=135771400000ns, (-0.148441, -0.035315, -9.968858)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=135771400000ns, (0.011723, -0.001732, 0.019450)
channel idx=11 magn_xyz shift=5 num_samples=1 value=135771400000ns, (0.015965, 0.938445, -0.938241)
channel idx=12 die_temp shift=5 num_samples=1 value=135771400000ns (30.781436)
Using west:
west build -b rpi_pico/rp2040/w -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_environment_sensor-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_environment_sensor-helloshell -GNinja -DBOARD=rpi_pico/rp2040/w -DSHIELD="waveshare_pico_environment_sensor" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_environment_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@40044000 (READY)
DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0
- vreg@40064000 (READY)
DT node labels: vreg
- rtc@4005c000 (READY)
DT node labels: rtc
- leds (READY)
- bme280@76 (READY)
DT node labels: wspes_sens_thp
- sgp40@59 (READY)
DT node labels: wspes_sens_voc
- mpu9250@68 (READY)
DT node labels: wspes_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
The Waveshare Pico Environment Sensor provides four on-shield sensors connected on I2C0.
uart:~$ i2c scan i2c@40044000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
5 devices found on i2c@40044000
The I2C address
0x29
is the ASM TSL25911 [20], an ambient IR and visible light sensor (ALS).The I2C address
0x53
is the LITEON LTR-390UV-01 [12], an ambient ultraviolet (UV) light sensor (UVS).The I2C address
0x59
is the Sensirion SGP40 [18], an air quality sensor, Volatile Organic Compounds (VOC).The I2C address
0x68
is the InvenSense ICM-20948 [10] with AK09916 [5] or in old hardware releases the MPU-9250 [14] with AK8963 [5], an motion and acceleration sensor (9-DOF) with 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer (compass).The I2C address
0x76
is the Bosch BME280 [8], an temperature, humidity and air pressure sensor (THP).
The “Who am I” register of the InvenSense MPU-9250 9-DOF sensor can read
from register 0x75
and must be 0x71
:
uart:~$ i2c read_byte i2c@40044000 68 75
Output: 0x71
The Chip-ID of the Bosch BME280 environmental sensor can read from
register 0xd0
and must be 0x60
:
uart:~$ i2c read_byte i2c@40044000 76 d0
Output: 0x60
uart:~$ sensor info
device name: bme280@76, vendor: Bosch Sensortec GmbH, model: bme280, friendly name: (null)
device name: mpu9250@68, vendor: InvenSense Inc., model: mpu9250, friendly name: (null)
device name: sgp40@59, vendor: Sensirion AG, model: sgp40, friendly name: (null)
BME280 (THP)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=40464800000ns (28.069999)
channel idx=14 press shift=7 num_samples=1 value=40464800000ns (100.944643)
channel idx=16 humidity shift=7 num_samples=1 value=40464800000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=44841400000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=44841400000ns (100.945768)
channel idx=16 humidity shift=7 num_samples=1 value=44841400000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=45757900000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=45757900000ns (100.945596)
channel idx=16 humidity shift=7 num_samples=1 value=45757900000ns (37.604491)
SGP40 (VOC)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=2 num_samples=1 value=7499000000ns (1.999999)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=8509500000ns (3553.196197)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=9527500000ns (4021.196197)
MPU-9250 (9-DOF)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=133465500000ns, (-0.152630, -0.034118, -9.957485)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=133465500000ns, (0.010923, -0.001465, 0.018784)
channel idx=11 magn_xyz shift=5 num_samples=1 value=133465500000ns, (0.021287, 0.918931, -0.960458)
channel idx=12 die_temp shift=5 num_samples=1 value=133465500000ns (30.772454)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=134743500000ns, (-0.150237, -0.036512, -9.961675)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=134743500000ns, (0.010790, -0.001732, 0.019184)
channel idx=11 magn_xyz shift=5 num_samples=1 value=134743500000ns, (0.010643, 0.940219, -0.957040)
channel idx=12 die_temp shift=5 num_samples=1 value=134743500000ns (30.769460)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=135771400000ns, (-0.148441, -0.035315, -9.968858)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=135771400000ns, (0.011723, -0.001732, 0.019450)
channel idx=11 magn_xyz shift=5 num_samples=1 value=135771400000ns, (0.015965, 0.938445, -0.938241)
channel idx=12 die_temp shift=5 num_samples=1 value=135771400000ns (30.781436)
Using west:
west build -b waveshare_rp2040_lcd_0_96 -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_environment_sensor-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_environment_sensor-helloshell -GNinja -DBOARD=waveshare_rp2040_lcd_0_96 -DSHIELD="waveshare_pico_environment_sensor" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_environment_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@40044000 (READY)
DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0
- vreg@40064000 (READY)
DT node labels: vreg
- rtc@4005c000 (READY)
DT node labels: rtc
- leds (READY)
- bme280@76 (READY)
DT node labels: wspes_sens_thp
- sgp40@59 (READY)
DT node labels: wspes_sens_voc
- mpu9250@68 (READY)
DT node labels: wspes_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
The Waveshare Pico Environment Sensor provides four on-shield sensors connected on I2C0.
uart:~$ i2c scan i2c@40044000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
5 devices found on i2c@40044000
The I2C address
0x29
is the ASM TSL25911 [20], an ambient IR and visible light sensor (ALS).The I2C address
0x53
is the LITEON LTR-390UV-01 [12], an ambient ultraviolet (UV) light sensor (UVS).The I2C address
0x59
is the Sensirion SGP40 [18], an air quality sensor, Volatile Organic Compounds (VOC).The I2C address
0x68
is the InvenSense ICM-20948 [10] with AK09916 [5] or in old hardware releases the MPU-9250 [14] with AK8963 [5], an motion and acceleration sensor (9-DOF) with 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer (compass).The I2C address
0x76
is the Bosch BME280 [8], an temperature, humidity and air pressure sensor (THP).
The “Who am I” register of the InvenSense MPU-9250 9-DOF sensor can read
from register 0x75
and must be 0x71
:
uart:~$ i2c read_byte i2c@40044000 68 75
Output: 0x71
The Chip-ID of the Bosch BME280 environmental sensor can read from
register 0xd0
and must be 0x60
:
uart:~$ i2c read_byte i2c@40044000 76 d0
Output: 0x60
uart:~$ sensor info
device name: bme280@76, vendor: Bosch Sensortec GmbH, model: bme280, friendly name: (null)
device name: mpu9250@68, vendor: InvenSense Inc., model: mpu9250, friendly name: (null)
device name: sgp40@59, vendor: Sensirion AG, model: sgp40, friendly name: (null)
BME280 (THP)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=40464800000ns (28.069999)
channel idx=14 press shift=7 num_samples=1 value=40464800000ns (100.944643)
channel idx=16 humidity shift=7 num_samples=1 value=40464800000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=44841400000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=44841400000ns (100.945768)
channel idx=16 humidity shift=7 num_samples=1 value=44841400000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=45757900000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=45757900000ns (100.945596)
channel idx=16 humidity shift=7 num_samples=1 value=45757900000ns (37.604491)
SGP40 (VOC)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=2 num_samples=1 value=7499000000ns (1.999999)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=8509500000ns (3553.196197)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=9527500000ns (4021.196197)
MPU-9250 (9-DOF)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=133465500000ns, (-0.152630, -0.034118, -9.957485)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=133465500000ns, (0.010923, -0.001465, 0.018784)
channel idx=11 magn_xyz shift=5 num_samples=1 value=133465500000ns, (0.021287, 0.918931, -0.960458)
channel idx=12 die_temp shift=5 num_samples=1 value=133465500000ns (30.772454)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=134743500000ns, (-0.150237, -0.036512, -9.961675)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=134743500000ns, (0.010790, -0.001732, 0.019184)
channel idx=11 magn_xyz shift=5 num_samples=1 value=134743500000ns, (0.010643, 0.940219, -0.957040)
channel idx=12 die_temp shift=5 num_samples=1 value=134743500000ns (30.769460)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=135771400000ns, (-0.148441, -0.035315, -9.968858)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=135771400000ns, (0.011723, -0.001732, 0.019450)
channel idx=11 magn_xyz shift=5 num_samples=1 value=135771400000ns, (0.015965, 0.938445, -0.938241)
channel idx=12 die_temp shift=5 num_samples=1 value=135771400000ns (30.781436)
on standard 4㎆
revision
Using west:
west build -b waveshare_rp2040_plus -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_environment_sensor-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_environment_sensor-helloshell -GNinja -DBOARD=waveshare_rp2040_plus -DSHIELD="waveshare_pico_environment_sensor" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_environment_sensor-helloshell flash
on extended 16㎆
revision
Using west:
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_environment_sensor-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_environment_sensor-helloshell -GNinja -DBOARD=waveshare_rp2040_plus@16mb -DSHIELD="waveshare_pico_environment_sensor" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_environment_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@40044000 (READY)
DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0
- vreg@40064000 (READY)
DT node labels: vreg
- rtc@4005c000 (READY)
DT node labels: rtc
- leds (READY)
- bme280@76 (READY)
DT node labels: wspes_sens_thp
- sgp40@59 (READY)
DT node labels: wspes_sens_voc
- mpu9250@68 (READY)
DT node labels: wspes_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
The Waveshare Pico Environment Sensor provides four on-shield sensors connected on I2C0.
uart:~$ i2c scan i2c@40044000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
5 devices found on i2c@40044000
The I2C address
0x29
is the ASM TSL25911 [20], an ambient IR and visible light sensor (ALS).The I2C address
0x53
is the LITEON LTR-390UV-01 [12], an ambient ultraviolet (UV) light sensor (UVS).The I2C address
0x59
is the Sensirion SGP40 [18], an air quality sensor, Volatile Organic Compounds (VOC).The I2C address
0x68
is the InvenSense ICM-20948 [10] with AK09916 [5] or in old hardware releases the MPU-9250 [14] with AK8963 [5], an motion and acceleration sensor (9-DOF) with 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer (compass).The I2C address
0x76
is the Bosch BME280 [8], an temperature, humidity and air pressure sensor (THP).
The “Who am I” register of the InvenSense MPU-9250 9-DOF sensor can read
from register 0x75
and must be 0x71
:
uart:~$ i2c read_byte i2c@40044000 68 75
Output: 0x71
The Chip-ID of the Bosch BME280 environmental sensor can read from
register 0xd0
and must be 0x60
:
uart:~$ i2c read_byte i2c@40044000 76 d0
Output: 0x60
uart:~$ sensor info
device name: bme280@76, vendor: Bosch Sensortec GmbH, model: bme280, friendly name: (null)
device name: mpu9250@68, vendor: InvenSense Inc., model: mpu9250, friendly name: (null)
device name: sgp40@59, vendor: Sensirion AG, model: sgp40, friendly name: (null)
BME280 (THP)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=40464800000ns (28.069999)
channel idx=14 press shift=7 num_samples=1 value=40464800000ns (100.944643)
channel idx=16 humidity shift=7 num_samples=1 value=40464800000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=44841400000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=44841400000ns (100.945768)
channel idx=16 humidity shift=7 num_samples=1 value=44841400000ns (37.618163)
uart:~$ sensor get bme280@76
channel idx=13 ambient_temp shift=7 num_samples=1 value=45757900000ns (28.079999)
channel idx=14 press shift=7 num_samples=1 value=45757900000ns (100.945596)
channel idx=16 humidity shift=7 num_samples=1 value=45757900000ns (37.604491)
SGP40 (VOC)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=2 num_samples=1 value=7499000000ns (1.999999)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=8509500000ns (3553.196197)
uart:~$ sensor get sgp40@59
channel idx=29 gas_resistance shift=15 num_samples=1 value=9527500000ns (4021.196197)
MPU-9250 (9-DOF)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=133465500000ns, (-0.152630, -0.034118, -9.957485)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=133465500000ns, (0.010923, -0.001465, 0.018784)
channel idx=11 magn_xyz shift=5 num_samples=1 value=133465500000ns, (0.021287, 0.918931, -0.960458)
channel idx=12 die_temp shift=5 num_samples=1 value=133465500000ns (30.772454)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=134743500000ns, (-0.150237, -0.036512, -9.961675)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=134743500000ns, (0.010790, -0.001732, 0.019184)
channel idx=11 magn_xyz shift=5 num_samples=1 value=134743500000ns, (0.010643, 0.940219, -0.957040)
channel idx=12 die_temp shift=5 num_samples=1 value=134743500000ns (30.769460)
uart:~$ sensor get mpu9250@68
channel idx=3 accel_xyz shift=5 num_samples=1 value=135771400000ns, (-0.148441, -0.035315, -9.968858)
channel idx=7 gyro_xyz shift=5 num_samples=1 value=135771400000ns, (0.011723, -0.001732, 0.019450)
channel idx=11 magn_xyz shift=5 num_samples=1 value=135771400000ns, (0.015965, 0.938445, -0.938241)
channel idx=12 die_temp shift=5 num_samples=1 value=135771400000ns (30.781436)
More Samples
BME280 Humidity and Pressure Sensor
This sample shows how to use the Sensors API driver for the Bosch BME280 environmental sensor. See also Zephyr sample: BME280 humidity and pressure sensor and BME280 Sensor Sample Tweaks (samples-sensor-bme280-tweaks).
west build -b rpi_pico -p -S usb-console -S samples-sensor-bme280-tweaks --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor-bme280 zephyr/samples/sensor/bme280
west flash -r uf2 -d build/waveshare_pico_environment_sensor-bme280
The Default Shield Sample
See also Waveshare Pico Environment Sensor Sample in Bridle.
west build -b rpi_pico -p -S usb-console --shield waveshare_pico_environment_sensor -d build/waveshare_pico_environment_sensor bridle/samples/waveshare_pico_environment_sensor
west flash -r uf2 -d build/waveshare_pico_environment_sensor