PMS5003 air quality sensor library

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: PMS5003 air quality sensor library

Post by kevinkk525 » Tue Mar 23, 2021 7:55 pm

We solved this on github: https://github.com/kevinkk525/pms5003_m ... n/issues/4
Apparently the adafruit sensor he bought didn't respond well to the passive mode but works fine in active mode. Since I bought mine from Aliexpress, I can't comment/test any further.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

rockyrobin
Posts: 4
Joined: Fri May 14, 2021 2:07 pm

Re: PMS5003 air quality sensor library

Post by rockyrobin » Fri May 14, 2021 2:30 pm

Thank you to everyone posting in this thread. It has been very helpful.

I am having a problem with this sensor putting it to sleep using the SET pin to turn the sensor off.
Has anyone managed to get this to work with an ESP32 Devkit DOIT?

I have been using the following code but cannot get the sensor to sleep when toggling the pin on/off:

Code: Select all

from machine import Pin

p0 = Pin(14, Pin.OUT)

while 1:
	p0(0)
	time.sleep(5)
	p0(1)
	time.sleep(5)

rockyrobin
Posts: 4
Joined: Fri May 14, 2021 2:07 pm

Re: PMS5003 air quality sensor library

Post by rockyrobin » Sun May 16, 2021 8:55 am

(UPDATE) - Changed to pin 23 as previous pin I discovered is input only!

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: PMS5003 air quality sensor library

Post by kevinkk525 » Sun May 16, 2021 9:57 am

Glad you found the problem!
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply