Difference between revisions of "PMSx003"
(Pins for VCC and GND were wrongly described refering to the datasheet and the scheme above!) |
|||
(10 intermediate revisions by one other user not shown) | |||
Line 5: | Line 5: | ||
= Introduction = | = 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. | + | The Plantower PMSx003 modules are laser based particle sensors. <br/> |
− | In opposition to the GP2Y10 this sensors have an own microprocessor that does reading and | + | Particles are measured by blowing air through the enclosure with a laser inside.<br/> |
− | differing into the PM1.0, PM2.5 and PM10 sizes. | + | By measuring diffusion of the laser beam, the amount of particles is counted. <br/> |
− | + | Measurement information is transmitted over a serial interface.<br/> | |
+ | In opposition to the GP2Y10 this sensors have an own microprocessor that does reading and<br/> | ||
+ | differing into the PM1.0, PM2.5 and PM10 sizes. The values can be read directly from the serial<br/> | ||
+ | interface. | ||
= Hardware = | = Hardware = | ||
Line 20: | Line 23: | ||
* PMS7003 | * PMS7003 | ||
[[File:Pms7003-front-view.png]] | [[File:Pms7003-front-view.png]] | ||
− | |||
− | |||
− | |||
= Precautions = | = Precautions = | ||
Line 32: | Line 32: | ||
Pins: | Pins: | ||
VCC - 5V (for fan and internal logic) | VCC - 5V (for fan and internal logic) | ||
− | GND - Ground (Note that chassis | + | GND - Ground (Note that chassis/case are ground also) |
RX/TX - 3V3 UART 9600 8N1 | 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. | 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 | RESET - Reset the module, similar to power-up, it takes ~30 seconds before data is received | ||
− | |||
= Hardware = | = Hardware = | ||
Line 52: | Line 51: | ||
PMS Pin PMS5003 Pin PMS7003 ESP | PMS Pin PMS5003 Pin PMS7003 ESP | ||
− | + | VCC 1 1,2 5V | |
− | + | GND 2 3,4 GND | |
− | Set 3 10 +3.3V | + | Set 3 10 D0(GPIO16) + Resistor to 3.3V |
Tx 4 9 D7(GPIO12) | Tx 4 9 D7(GPIO12) | ||
Rx 5 7 D6(GPIO13) | Rx 5 7 D6(GPIO13) | ||
− | Reset 6 5 D5(GPIO14) + | + | Reset 6 5 D5(GPIO14) + Resistor to 3.3V |
Spare 7,8 6,8 not connected | Spare 7,8 6,8 not connected | ||
Line 75: | Line 74: | ||
= ESP Easy = | = ESP Easy = | ||
− | The ESP Easy plugin uses the (default) active mode of the module. This | + | The ESP Easy plugin uses the (default) active mode of the module. This says the sensor <br/> |
+ | transmits data over the UART automatically towards the ESP. The update frequency of data depends <br/> | ||
+ | on the changes in measurement data. (i.e. when there are no changes, no data is transmitted).<br/><br/> | ||
− | Set up the ESPEasy task according to the screenshot. | + | Set up the ESPEasy task according to the screenshot.<br/> |
− | If you chose other GPIO's adapt settings accordingly. | + | If you chose other GPIO's adapt settings accordingly.<br/> |
− | |||
[[File:PMSx003 Settings.jpg|500px]] | [[File:PMSx003 Settings.jpg|500px]] | ||
Line 88: | Line 88: | ||
* Acquisition delay -> Determines how often data is send to controllers | * Acquisition delay -> Determines how often data is send to controllers | ||
− | Submit your settings and go back to the task list. | + | Submit your settings and go back to the task list.<br/> |
It should show some values already (refresh after a minute if values are zero). | 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. | + | Both hardware and software serial are supported. The RX/TX pins can be selected in the device configuration page.<br/> |
− | 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. | + | When a reset pin is configured, the module is reset when ESPEasy is started. TX is not functionally used, but a TX pin <br/> |
+ | should be configured because the software/hardware serial libraries require it. A free/dummy TX IO can be selected.<br/> | ||
=== Output === | === Output === | ||
The output of the plugin consists of 3 values: | The output of the plugin consists of 3 values: | ||
− | * PM1.0 - | + | * PM1.0 - Concentration of particles 1um/m3 |
− | * PM2.5 - | + | * PM2.5 - Concentration of particles 2.5um/m3 |
− | * PM10 - | + | * PM10 - Concentration of particles 10um/m3 |
+ | |||
+ | === Lifetime Helper === | ||
+ | The laser diode inside the PMSx003 has a lifetime of about 8000 h, nearly one year.<br/> | ||
+ | With the actual plugin the sensor is powered permanently so we have to take some care about this.<br/> | ||
+ | |||
+ | The D0 (GPIO16) is connected to the "SET" input of the PMSx003. if it is pulled low the sensor sleeps.<br/> | ||
+ | Some rules can be used to set the sensor up to sleep mostof the time: | ||
+ | |||
+ | on System#Boot do | ||
+ | gpio,16,0 | ||
+ | timerSet,1,20 | ||
+ | endon | ||
+ | |||
+ | On Rules#Timer=1 do | ||
+ | LongPulse,16,1,5 | ||
+ | timerSet,1,20 | ||
+ | endon | ||
+ | |||
+ | These rules use a "System#Boot" event to set GPIO16 to low (0) and start a 20 sec timer.<br/> | ||
+ | The "Rules#Timer=1" event is triggered by this timer an sends a 5 seconds "high" pulse to the sensor waking it up.<br/> | ||
+ | The timer then is is re-initialized so this works in a loop.<br/> | ||
+ | Set the delay inside the dustsensor task to 30 seconds for this. The ESPEasy plugin gets the data and stores it<br/> | ||
+ | when the sensor gets active. | ||
=Troubleshooting= | =Troubleshooting= |
Latest revision as of 21:19, 17 November 2018
Work in Progress
ATTENTION: This Plugin is still under testing! If you want to use it you have to use a "TESTING" Binary!
Contents
Introduction
The Plantower PMSx003 modules are laser based particle sensors.
Particles are measured by blowing air through the enclosure with a laser inside.
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. The values can be read directly from the serial
interface.
Hardware
The following modules have different construction and dimensions but share the same serial interface and protocol:
- PMS3003
TBD
- PMS5003
- PMS7003
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/case are ground also) 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 VCC 1 1,2 5V GND 2 3,4 GND Set 3 10 D0(GPIO16) + Resistor to 3.3V 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 says the sensor
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.
- 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 - Concentration of particles 1um/m3
- PM2.5 - Concentration of particles 2.5um/m3
- PM10 - Concentration of particles 10um/m3
Lifetime Helper
The laser diode inside the PMSx003 has a lifetime of about 8000 h, nearly one year.
With the actual plugin the sensor is powered permanently so we have to take some care about this.
The D0 (GPIO16) is connected to the "SET" input of the PMSx003. if it is pulled low the sensor sleeps.
Some rules can be used to set the sensor up to sleep mostof the time:
on System#Boot do gpio,16,0 timerSet,1,20 endon
On Rules#Timer=1 do LongPulse,16,1,5 timerSet,1,20 endon
These rules use a "System#Boot" event to set GPIO16 to low (0) and start a 20 sec timer.
The "Rules#Timer=1" event is triggered by this timer an sends a 5 seconds "high" pulse to the sensor waking it up.
The timer then is is re-initialized so this works in a loop.
Set the delay inside the dustsensor task to 30 seconds for this. The ESPEasy plugin gets the data and stores it
when the sensor gets active.
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: