- The Plantower PMS5003 and PMS7003 Air Quality Sensor experiment
- Laboratory Evaluation of Low to Medium Cost Particle Sensors
- Field evaluation of low-cost particulate matter sensors in high- and low-concentration environments
The sensor is powered with 5V and has a 3.3V UART interface. A custom cable was made to breakout the sensor ribbon cable to a breadboard-friendly 0.1" spacing. Testing was done using a breadboard. Prototype photo is shown at the bottom of this log.
Google hunt for a MicroPython library
The next step is finding some interface code. I found a few MicroPython libraries for the PMS5003 device in Github. After evaluation, I decided that the PMS5003 implementation by Kevin Köck is the most promising for this project.
Here are the compelling reasons to use this library.
- uasyncio implementation. I was anticipating needing to rewrite a library to work with uasyncio. This library saves me that effort.
- all sensor functions are implemented
- example code
- good documentation
The LoBo ESP32 version of MicroPython that I am currently using does not include uasyncio as a built-in library. This uasyncio library and the PMS5003 library need to be copied into the MicroPython filesystem on the ESP32. The uasyncio library is found in micropython-lib. I used the Ampy command line tool to copy these MicroPython libraries into the filesystem. Here is the filesystem contents after copying.
boot.py pms5003.py lib | uasyncio __init__.py core.py
The PMS5003 library worked the first time using some example code. Here is the test output showing particulate readings, sent using the ESP32 serial port.
The device has two modes of operation: Active and Standby. Measurement with a multimeter showed these results.
- Active: current varies between 50mA and 80mA
- Standby: 7mA
Observation: the measured Standby current of 7mA is considerably more than the <200uA value listed in the manufacturer's datasheet. The measured Active current of 50mA-80mA agrees with the <100mA listed in the datasheet.