I took the breadboard out of the equation now – dupont wiring directly from the pins of the D1 mini directly to the pins on the PMS5003 breakout board. The sensor powers up, but again still reading 0s. Really hoping it’s not the breakout board …
I still had the backup sensor lying around so i tried that and same result. I think if it were a hardware problem, low chance that both are kaput? Definitely ‘user error’ on my part but not exactly sure what else could be wrong. Code i’m using is posted below for reference.
uart:
rx_pin: D7 # This pin on the esp goes to the tx pin on the sensor
baud_rate: 9600
sensor:
#Wiring
#PMS5003 >> esp8266 d1 mini
#VCC > VIN (5V)
#GND > GND
#TX > D07 (rx_pin above)
#SET > D06 (for Controlling sleep)
- platform: pmsx003
type: PMSX003
pm_1_0:
name: "PMS 1.0µm"
pm_2_5:
name: "PMS 2.5µm"
#force_update: true
id: pm_2_5 #add an id so you can use it below
pm_10_0:
name: "PMS 10.0µm"
switch:
#Turns PMS sleep on and off.
- platform: gpio
name: "PMS Awake"
pin:
number: D6 #Connect to the Set pin of the PMS air quality sensor
inverted: no
id: pms_set
interval:
#Controls Sleep Interval by turning on/off above switch
- interval: 180s
then:
- switch.turn_on: pms_set
- delay: 60s
- switch.turn_off: pms_set
#Take state from sleep/awake switch but adds 30sec lag, which is the 'warm-up period" we want to discard
binary_sensor:
- platform: template
name: "PMS Warm"
id: pms_warm
lambda: |-
if (id(pms_set).state) {
return true;
} else {
return false;
}
filters:
- delayed_on: 30s
- platform: template
name: "PMS <2.5µm Cleaned"
id: pm_2_5_cleaned
lambda: |-
if (id(pms_warm).state) {
return (id(pm_2_5).state);
} else {
return {};
}
# update_interval: 1s
# filters:
# force a value every second (only)
# - heartbeat: 1s
# Use last 10 values (seconds) in a moving average, and just push it out every 10 so we're not sending so much data.
# - sliding_window_moving_average:
# window_size: 10
# send_every: 10
# send_first_at: 10
[09:11:38][D][sensor:124]: 'PMS 1.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:38][D][sensor:124]: 'PMS 2.5µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:38][D][sensor:124]: 'PMS 10.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:39][D][pmsx003:173]: Got PM1.0 Concentration: 0 µg/m^3, PM2.5 Concentration 0 µg/m^3, PM10.0 Concentration: 0 µg/m^3
[09:11:39][D][sensor:124]: 'PMS 1.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:39][D][sensor:124]: 'PMS 2.5µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:39][D][sensor:124]: 'PMS 10.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:40][D][pmsx003:173]: Got PM1.0 Concentration: 0 µg/m^3, PM2.5 Concentration 0 µg/m^3, PM10.0 Concentration: 0 µg/m^3
[09:11:40][D][sensor:124]: 'PMS 1.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:40][D][sensor:124]: 'PMS 2.5µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:40][D][sensor:124]: 'PMS 10.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][pmsx003:173]: Got PM1.0 Concentration: 0 µg/m^3, PM2.5 Concentration 0 µg/m^3, PM10.0 Concentration: 0 µg/m^3
[09:11:41][D][sensor:124]: 'PMS 1.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][sensor:124]: 'PMS 2.5µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][sensor:124]: 'PMS 10.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][pmsx003:173]: Got PM1.0 Concentration: 0 µg/m^3, PM2.5 Concentration 0 µg/m^3, PM10.0 Concentration: 0 µg/m^3
[09:11:41][D][sensor:124]: 'PMS 1.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][sensor:124]: 'PMS 2.5µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[09:11:41][D][sensor:124]: 'PMS 10.0µm': Sending state 0.00000 µg/m³ with 0 decimals of accuracy