I’m trying to use a SEN5x device (SEN55) with a Raspberry Pi Pico W and it isn’t working.
Would love some help figuring out what’s wrong!
In the logs, the I2C bus scan finds it, but then says communication failed:
[22:35:33][I][i2c.arduino:068]: Results from i2c bus scan:
[22:35:33][I][i2c.arduino:074]: Found i2c device at address 0x69
[22:35:33][C][sen5x:227]: sen5x:
[22:35:33][C][sen5x:228]: Address: 0x69
[22:35:33][W][sen5x:232]: Communication failed! Is the sensor connected?
I’ve tried the sensor with a regular Raspberry Pi 3 using the sample here:
…and it works fine, so I know the device works.
My wiring is:
VDD: SEN5x pin 1 to Pico pin 40 (5V from USB)
GND: SEN5x pin 2 to Pico pin 38
SDA: SEN5x pin 3 to Pico pin 26 (GPIO20)
SCL: SEN5x pin 4 to Pico pin 27 (GPIO21)
SEL: SEN5x pin 5 to Pico pin 38
Here’s my yaml:
esphome:
name: pico-w-2c16
rp2040:
board: rpipicow
framework:
# Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "[redacted]"
ota:
safe_mode: false
password: "[redacted]"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
substitutions:
name: Indoor
i2c:
sda: GPIO20
scl: GPIO21
scan: true
id: i2c_a
.defaultfilters:
- &moving_avg
sliding_window_moving_average:
window_size: 6
send_every: 3
sensor:
- platform: sen5x
id: sen55
pm_1_0:
name: "${name} PM <1µm Weight concentration"
id: pm_1_0
accuracy_decimals: 2
filters: [ *moving_avg ]
pm_2_5:
name: "${name} PM <2.5µm Weight concentration"
id: pm_2_5
accuracy_decimals: 2
filters: [ *moving_avg ]
pm_4_0:
name: "${name} PM <4µm Weight concentration"
id: pm_4_0
accuracy_decimals: 2
filters: [ *moving_avg ]
pm_10_0:
name: "${name} PM <10µm Weight concentration"
id: pm_10_0
accuracy_decimals: 2
filters: [ *moving_avg ]
temperature:
name: "${name} Temperature 2"
accuracy_decimals: 2
filters: [ *moving_avg ]
humidity:
name: "${name} Humidity 2"
accuracy_decimals: 2
filters: [ *moving_avg ]
voc:
name: "${name} VOC"
filters: [ *moving_avg ]
algorithm_tuning:
index_offset: 100
learning_time_offset_hours: 12
learning_time_gain_hours: 12
gating_max_duration_minutes: 180
std_initial: 50
gain_factor: 230
nox:
name: "${name} NOx"
id: nox
filters: [ *moving_avg ]
temperature_compensation:
offset: 0
normalized_offset_slope: 0
time_constant: 0
acceleration_mode: low
store_baseline: true
address: 0x69
update_interval: 10s