PMSx003
Work in Progress
ATTENTION: This Plugin is still under testing! If you want to use it you have to use a "TESTING" Binary!
Introduction
The Plantower PMSx003 modules are laser particle sensors. Particles are measured by blowing air through the enclosure. By measuring diffusion of the laser beam, the amount of particles is counted. Measurement information is transmitted over a serial interface. In opposition to the GP2Y10 this sensors have an own microprocessor that does reading and differing into the PM1.0, PM2.5 and PM10 sizes. They give back the values with a serial interface directly.
Hardware
The following modules have different construction and dimensions but share the same serial interface and protocol:
- PMS3003
TBD
- PMS5003
- PMS7003
- PMSA003
Precautions
The PMSx003 run on 5V. All inputs and outputs are TTL 3.3V compatible so no level converter is needed.
The external circuitry is small, it needs just two resistors and a capacitor.
Pins:
VCC - 5V (for fan and internal logic) GND - Ground (Note that chassis is also ground) RX/TX - 3V3 UART 9600 8N1 SET - Standby function, when pulled down the module does not send information over serial and goes into a low power state. RESET - Reset the module, similar to power-up, it takes ~30 seconds before data is received
Hardware
The PMSx003 sensor is easy to connect. Just connect it as shown in the schematic:
The resistors are "pull-up" resistors to give a defined "high" level of 3.3V. The capacitor covers the high current consumption of the laser pulses avoiding influence to the power supply of the circuit.
Beware: Pin numbers shown in schematics refer to PMS5003
PMS Pin PMS5003 Pin PMS7003 ESP GND 1 1,2 GND VCC 2 3,4 5V Set 3 10 +3.3V via resistor Tx 4 9 D7(GPIO12) Rx 5 7 D6(GPIO13) Reset 6 5 D5(GPIO14) + resistor to 3,3V Spare 7,8 6,8 not connected
This setup uses "software serial" emulating a serial port on the ESP8266. It is possible to use the hardware serial for this purpose.
PMS Pin PMS5003 Pin pMS7003 ESP Tx 4 9 RX(GPIO3) Rx 5 7 TX(GPIO1)
The firmware plugin will detect automatically if soft- or hardware serial is used.
Please take care when using hardware serial: - Flash your firmware first before connecting! - Disable the serial port under Tools --> Advanced before connecting! Then set the GPIO pins in the Setting according to the table. This setting is usefull if you are short on free GPIO's or using an ESP-01.
ESP Easy
The ESP Easy plugin uses the (default) active mode of the module. This means that the module transmits data over the UART automatically towards the ESP. The update frequency of data depends on the changes in measurement data. (i.e. when there are no changes, no data is transmitted).
Set up the ESPEasy task according to the screenshot. If you chose other GPIO's adapt settings accordingly. [pics: Settings]
- 1st GPIO -> RX pin (IO3 for HW serial)
- 2nd GPIO -> TX pin (IO1 for HW serial)
- 3rd GPIO -> Reset (Optional)
- Acquisition delay -> Determines how often data is send to controllers
Submit your settings and go back to the task list. It should show some values already (refresh after a minute if values are zero).
Both hardware and software serial are supported. The RX/TX pins can be selected in the device configuration page. When a reset pin is configured, the module is reset when ESPEasy is started. TX is not functionally used, but a TX pin should be configured because the software/hardware serial libraries require it. A free/dummy TX IO can be selected.
Output
The output of the plugin consists of 3 values:
- PM1.0 - Particle count of particles up to 1,0µm size
- PM2.5 - Particle count of particles up to 2,5µm size
- PM10 - Particle count of particles up to 10µm size
Troubleshooting
If you don't see any values in the task list this failure usually results of cabling faults. Check all cablings according to the schematics. If you are testing on a breadboard, the breadboard contacts might be worn out or you got some faulty cables. A digital multimeter will help with this situations.
References: