PMS5003 air quality sensor - not showing readings!

Hi

I followed this guide to set up the below config but there is no reading output from the sensor. Please help!

esphome:
  name: bed-sensor

esp8266:
  board: esp01_1m

logger:

api:
  encryption:
    key: "XXX"

ota:
  password: "XXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


  ap:
    ssid: "Bed-Sensor Fallback Hotspot"
    password: "XXX"
  
uart:
  rx_pin: GPIO12
  tx_pin: GPIO13
  baud_rate: 9600

sensor:
  - platform: pmsx003
    type: PMSX003
    pm_1_0:
      name: "Particulate Matter <1.0µm Concentration"
    pm_2_5:
      name: "Particulate Matter <2.5µm Concentration"
    pm_10_0:
      name: "Particulate Matter <10.0µm Concentration"
    update_interval: 30s

LOGS:

INFO ESPHome 2023.12.3
INFO Reading configuration /config/esphome/bed-sensor.yaml…
INFO Starting log output from 192.168.1.117 using esphome API
INFO Successfully connected to bed-sensor @ 192.168.1.117 in 0.004s
INFO Successful handshake with bed-sensor @ 192.168.1.117 in 2.710s
[23:37:00][I][app:102]: ESPHome version 2023.12.3 compiled on Dec 22 2023, 23:33:33
[23:37:00][C][wifi:573]: WiFi:
[23:37:00][C][wifi:405]: Local MAC: 34:94:54:61:BE:26
[23:37:00][C][wifi:410]: SSID: ‘cipka’[redacted]
[23:37:00][C][wifi:411]: IP Address: 192.168.1.117
[23:37:00][C][wifi:412]: BSSID: 34:97:F6:02:92:30[redacted]
[23:37:00][C][wifi:414]: Hostname: ‘bed-sensor’
[23:37:00][C][wifi:416]: Signal strength: -26 dB ▂▄▆█
[23:37:00][C][wifi:420]: Channel: 9
[23:37:00][C][wifi:421]: Subnet: 255.255.255.0
[23:37:00][C][wifi:422]: Gateway: 192.168.1.1
[23:37:00][C][wifi:423]: DNS1: 192.168.1.2
[23:37:00][C][wifi:424]: DNS2: 192.168.1.1
[23:37:00][C][logger:443]: Logger:
[23:37:00][C][logger:444]: Level: DEBUG
[23:37:00][C][logger:445]: Log Baud Rate: 115200
[23:37:00][C][logger:447]: Hardware UART: UART0
[23:37:01][C][uart.arduino_esp8266:102]: UART Bus:
[23:37:01][C][uart.arduino_esp8266:103]: TX Pin: GPIO13
[23:37:01][C][uart.arduino_esp8266:104]: RX Pin: GPIO12
[23:37:01][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[23:37:01][C][uart.arduino_esp8266:108]: Baud Rate: 9600 baud
[23:37:01][C][uart.arduino_esp8266:109]: Data Bits: 8
[23:37:01][C][uart.arduino_esp8266:110]: Parity: NONE
[23:37:01][C][uart.arduino_esp8266:111]: Stop bits: 1
[23:37:01][C][uart.arduino_esp8266:115]: Using software serial
[23:37:01][C][pmsx003:334]: PMSX003:
[23:37:01][C][pmsx003:339]: PM1.0 ‘Particulate Matter <1.0µm Concentration’
[23:37:01][C][pmsx003:339]: State Class: ‘measurement’
[23:37:01][C][pmsx003:339]: Unit of Measurement: ‘µg/m³’
[23:37:01][C][pmsx003:339]: Accuracy Decimals: 0
[23:37:01][C][pmsx003:339]: Icon: ‘mdi:chemical-weapon’
[23:37:01][C][pmsx003:340]: PM2.5 ‘Particulate Matter <2.5µm Concentration’
[23:37:01][C][pmsx003:340]: State Class: ‘measurement’
[23:37:01][C][pmsx003:340]: Unit of Measurement: ‘µg/m³’
[23:37:01][C][pmsx003:340]: Accuracy Decimals: 0
[23:37:01][C][pmsx003:340]: Icon: ‘mdi:chemical-weapon’
[23:37:01][C][pmsx003:341]: PM10.0 ‘Particulate Matter <10.0µm Concentration’
[23:37:01][C][pmsx003:341]: State Class: ‘measurement’
[23:37:01][C][pmsx003:341]: Unit of Measurement: ‘µg/m³’
[23:37:01][C][pmsx003:341]: Accuracy Decimals: 0
[23:37:01][C][pmsx003:341]: Icon: ‘mdi:chemical-weapon’
[23:37:01][C][captive_portal:088]: Captive Portal:
[23:37:01][C][mdns:115]: mDNS:
[23:37:01][C][mdns:116]: Hostname: bed-sensor
[23:37:01][C][ota:097]: Over-The-Air Updates:
[23:37:01][C][ota:098]: Address: bed-sensor.local:8266
[23:37:01][C][ota:101]: Using Password.
[23:37:01][C][api:139]: API Server:
[23:37:01][C][api:140]: Address: bed-sensor.local:6053
[23:37:01][C][api:142]: Using noise encryption: YES

Hi and welcome. can you edit your post so that the yaml is enclosed in formatted text tags?

See item 11 of this post:

The first thing to check is that you have rx and tx. the right way around on the UART. Also that you have good supply of both 5V and 3.3V to the sensor.

1 Like

You mean that I connected the wires to the right pins for RX and TX? Yes, I did. Any other suggestions please?

YAML is formatted now

Is there a fan that you can see spinning?

Are you using a PMS5003 too?

I’m not sure if you did the same “solderless connections” as per the project, but that seems like a bad idea to me and could be a possible point of failure too.

1 Like

The fan is not spinning. Yes, I’m using the PMS5003. It is solderless for now - will solder it and let you know.

Thanks

1 Like

OK - fan is spinning now after I solder +5V and ground. Will solder other connections now - just checking which GPIO pins to use.

1 Like

Solved! Seems the connections were loose so I just needed to solder them. I now have soldered five connections:

+5V,
G,
D7/GPIO13,
D6/GPIO12, &
D5/GPIO14

Here is the YAML:

uart:
  rx_pin: GPIO13
  tx_pin: GPIO12
  baud_rate: 9600

sensor:
  - platform: pmsx003
    type: PMSX003
    pm_1_0:
      name: "Particulate Matter <1.0µm Concentration"
    pm_2_5:
      name: "Particulate Matter <2.5µm Concentration"
    pm_10_0:
      name: "Particulate Matter <10.0µm Concentration"
    update_interval: 120s

[14:57:44][D][pmsx003:234]: Got PM1.0 Concentration: 0 µg/m^3, PM2.5 Concentration 1 µg/m^3, PM10.0 Concentration: 1 µg/m^3
[14:57:44][D][sensor:093]: ‘Particulate Matter <1.0µm Concentration’: Sending state 0.00000 µg/m³ with 0 decimals of accuracy
[14:57:44][D][sensor:093]: ‘Particulate Matter <2.5µm Concentration’: Sending state 1.00000 µg/m³ with 0 decimals of accuracy
[14:57:44][D][sensor:093]: ‘Particulate Matter <10.0µm Concentration’: Sending state 1.00000 µg/m³ with 0 decimals of accuracy
[14:59:44][D][pmsx003:234]: Got PM1.0 Concentration: 3 µg/m^3, PM2.5 Concentration 4 µg/m^3, PM10.0 Concentration: 5 µg/m^3
[14:59:44][D][sensor:093]: ‘Particulate Matter <1.0µm Concentration’: Sending state 3.00000 µg/m³ with 0 decimals of accuracy
[14:59:44][D][sensor:093]: ‘Particulate Matter <2.5µm Concentration’: Sending state 4.00000 µg/m³ with 0 decimals of accuracy
[14:59:44][D][sensor:093]: ‘Particulate Matter <10.0µm Concentration’: Sending state 5.00000 µg/m³ with 0 decimals of accuracy
[15:00:44][I][ota:117]: Boot seems successful, resetting boot loop counter.

PM readings are now showing as zero although they were non-zero to start. They should be reading 7 & 4 based on the below data for my area. If anyone has experience with this device, please let me know if I am doing something wrong

Been a while since I set mine up, but I believe there’s a pin on the sensor that needs to be pulled high for it to operate? I know I setup a switch in my YAML so I could manually turn it on/off but the other option is just to permanently wire it so. I’m guessing you have it floating and it happened to be high at the beginning but has since floated low?