Showing posts with label PMS5003. Show all posts
Showing posts with label PMS5003. Show all posts

17 June 2025

PMD WiFi + Websockets, Webpage & Dashboard

🔘The 'PMD-Serial-UART', and 'PMD-Display' versions of our 'Particle Matter Detector' ( "PMD" ) were described in previous posts on 📅08.04.24, 16.06.24 & 01.01.25 *. A 🛜 'WiFi' version has now been added to the product range, which features an embedded 'Websockets Server' serving a webpage; ( enter websockets into the blog search bar to see examples of websockets servers & protocol ). Depending on the installed firmware the PMD can be configured as a Station on an existing 🛜WiFi network ( with or without a config web-portal ), or as a stand-alone Soft Access Point.

PMD - WiFi version: Note (L) air-intake & (R) micro-usb socket  
The webpage, ( designed using HTML, CSS, W3.CSS & JavaScript ), displays all the measurements made by the PMD's internal PMS5003 particle detector, ( particle density ug/m3, & particle number per deci-litre ppdl ), and additionally the 'Air Quality Index - AQI', and 'Air Quality Level - AQL', which are separately calculated from the concentration of 2.5 micron particles. All results are updated in real-time and displayed in tabular form on the webpage every second. There is also a bar meter showing the 🛜WiFi signal level, 🕓time/date stamp, and bar-chart 📊showing the recent history of the PM2.5 measurements. Tapping the 'show/hide levels' button opens a pop-up showing the AQL categories - 'Good, Moderate, Poor, Unhealthy, Very Unhealthy, Hazardous & Extreme '.
Webpage: particle-matter-detector-v3.html
The webpage in the image above was being displayed by a browser on a laptop, having navigated to IP:192.168.1.54
A dashboard for the PMD, ( designed with Node-Red ), is shown below. Not all the measurements have had a widget assigned in this example, which is simply for demonstration purposes.
PMD dashboard - reduced set of measurements displayed
The latest issue of the PMD User Guide can be downloaded 🔗 here. 🔲

* A Bluetooth version with Android App is also available.

01 January 2025

Stand for the PMD - display version

🔘 Until now the atmospheric "Particulate Matter Detector ( PMD )" project based on a 🪴Plantower 🗼PMS5003 particle concentration sensor and having a ⎚ display had been assembled on a solder-less 🍞 breadboard, ( see 📅16 June 2024 ), while awaiting further development.

A 'U ' cross-section 🖼frame, which functions as a stand, has been designed and produced on a 3-D printer 🖶 so that the PMD ( comprising PMS5003, colour display & µ-controller ) is now self-contained and can be easily moved to different locations.

Front view

Rear view

Being open construction the micro-usb connector for power and serial data, ( requiring the 'PMD_Serial'  software ), reset & boot buttons and SD card slot on the rear of the display are easily accessible. An SD card could perhaps be used to load an image when the PMD starts, or for data storage.
The stand is very stable. The addition of rubber feet provides extra non-slip adhesion on smooth surfaces, as well as protection from scratches. Overall dimensions are 122 x 70 x 64mm.
PMS5003 sensor is the blue module with fan air inlet.
Click on this 🔗link to view the frame in 3D and rotate it !

17 September 2024

Node-Red dashboard for the PMS5003

🔘The Node-Red 🟥browser based visual programming tool was first used at SpacerLabs in 📆March 2021 and then several times since then, usually to trigger actions and ⏰alerts, e.g., send an email 📧, when a sensor measurement 📏exceeds a threshold. If the measurement itself were needed it could be found under the debug tab in the sidebar on the right of the workspace ( see image below ). But 🔗 Node-Red also provides a 'dashboard' option for better visualisation of the measurement 📏data. 
A Node-Red 'flow' 〰, ( similar to the one from 📅29 February for the AQM ), was designed, but instead using measurements from the PMS5003 particulate matter sensor⛬ ( see 🗓 8 April & 16 June ). However, only the PM0.3 particles🏁 per deci-litre ( ppdl ) measurement has been extracted for this demonstration exercise.
Node-Red workspace, (L) node palette, flow, (R) debug sidebar
The node 🎨palette has been scrolled down to show all those relevant to the dashboard design. Each node represents a different widget either for displaying the sensor measurement 📏or for user input. Five have been selected and connected into the flow 🔀 as shown above. After deploying the flow, the dashboard can be opened in another browser tab by appending /ui to the address, ( see image below, click to enlarge ).
Node-Red dashboard
The widgets have been arranged vertically; starting from the top: text widget, gauge widget, compass 🧭widget, & chart 📈widget. The fifth widget is  a pop-up notification which only appears when a new measurement is received.🌀
Part of dashboard enlarged to show notification pop-up

16 June 2024

PMS5003, colour display, BluetoothⓇ & cloud

🔘The project involving the 🪴Plantower 🗼PMS5003 digital Particle Concentration Sensor, described in the previous post on 8 April, has progressed further with the addition of embedded firmware using an  ESP32 microcontroller development board, a colour display, and BluetoothⓇ or Wi-Fi options.
The display is a colour TFT touch sensitive display with resolution 240 x 320 pixels, ( see image below ), last used on 5 January 2023.
Version with display using prototyping board 
Particle number per 0.1 litre ( ppdl ) of air and density ( ug/m^3 ) for various particle diameters Ø in microns are displayed. The "Air Quality Index  - AQI" ( 0 to 500 ) is derived from the PM2.5 density figure.  The "Quality" label which is assigned ( GOOD, MODERATE etc ) depends on the AQI. This is the method in common use internationally to quantify air pollution 😷 due to particulates. The touch-sensitive 'buttons' near the lower edge of the display give full control of the various modes of operation of the PMS5003. Some modes are initiated by sending instructions to the PMS5003 by serial data, and some are hardwired.
The ESP32 has a built-in BluetoothⓇ Low Energy, ( BLE ), module. The particulate matter data and mode functions as described above are available using the BluetoothⓇ version and the SpacerLabs custom Android App, "SpacerLabs PMD_Viewer vn.nn", on a compatible mobile device 📱having BluetoothⓇ enabled.
App user interface opened
Ubidots is a cloud hosted repository for measurement data. It was featured in this blog before, on 29 February,  then being used with the AQM device. The ESP32 also has a built-in Wi-Fi module. So a version of the firmware including Wi-Fi functionality was written, enabling the PMS5003 measurement data to be uploaded to the cloud.
PMS5003 Ubidots dashboard - ( click to enlarge )
An 'Air Quality' device, i.e., the Plantower PMS5003 Particulate Matter Sensor', has been added to our Ubidots dashboard together with several new widgets for displaying the particle measurements. A similar exercise was carried out with Thingspeak cloud; see also 18 February 2024. Search for channels by user ID spacerlabs to see the result.

The serial communications interface ( see 8 April 2024 ) is still retained, and is a common feature of all versions. 

08 April 2024

PMS5003 Digital Particle Concentration Sensor

🔘The SpacerLabs domestic 'Air Quality Monitor' ( AQM ) 🏭 with multi-sensor support posted on 15.03.2023, ( updated 29.02.2024 ) is based on the Cubic PM1006 infra-red LED particle sensor module.  Another type of  particle sensor is the 🪴 Plantower 🗼PMS5003.  It uses a laser source, is capable of detecting particles down to ⌀0.3 microns in size, and measures some additional  values compared to the PM1006 as well as being approximately twice as accurate. One has been obtained as an individual item, ( not part of an AQM product, filtration or ventilation equipment etc ), and is being tried out.
The measurements made by the PMS5003 are sent periodically ⏲ as 32 bytes of data over a UART serial interface at a data rate of 9600 bits/sec. A UART to USB protocol converter dongle provides a virtual COM port on a computer allowing the data to be displayed on a pc if there is a usb cable connecting 🔗both and a serial terminal program is running. 
Left - PMS5003, Right - UART to USB dongle
We wrote a serial terminal application specifically for the PMS5003, called 'PMS5003_Serial' , in order to demonstrate the operation of the PMS5003, ( image below ).
PMS5003_Serial software receiving & displaying data
The received raw serial data are displayed in hexadecimal and decimal, then parsed in software to extract the bytes of interest containing data relating to particulate matter🦠  mass concentration ( ug/m^3 ) and particles per deci-litre, ppdl, ( 0.1 litre ) of air 🜁 , sorted according to size in microns. The AQI ( range 0-500 ) and air quality level are also given.
This project might be developed further by providing embedded control, a touch sensitive colour display, Bluetooth, App for a mobile device and a 3-D printed case.
 
UART = Universal Asynchronous Receiver Transmitter.
AQI = Air Quality Index