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 !

25 December 2024

DdsModTerm software for AD9850/51 modules

๐Ÿ”˜In the post ๐Ÿ“ฎdated ๐Ÿ“…27 July 2023, about how a ยต-controller and a smart phone๐Ÿ– App could be used to upload ๐Ÿ  configuration settings to  modules based on AD9850 and AD9851 DDS chips in order to generate a frequency, it was briefly mentioned that  a USB dongle and pc interface software was another method in use here. As that software has recently been updated it would now be a good time to give a description of that method also.

The SpacerLabs dedicated pc ๐Ÿ’ปsoftware called "DdsModTerm" is the user interface and was first released in about 2015. Since then there have been 15 revisions; the latest appearing this month.

'DdsModTerm' user interface
The clock ๐Ÿ•ฐfrequency and the required output frequency and phase are entered, either manually or by recall from memory. By clicking 'Confirm', the software generates the 5 configuration bytes required from the user input data. In the example in the image above the output frequency is 137700Hz & bytes hexadecimal 00C88AC604The pc ๐Ÿ’ปis connected to the serial data interface of the DDS module board via a COM port and the SpacerLabs USB-SPI dongle. Clicking 'Update DDS' then uploads the bytes using  SPI protocol to the registers of the DDS chip and the programmed frequency  ∿  is then present on the output. 
(L) USB-SPI dongle (R) AD9851 DDS chip evaluation board on adaptor
Other features of the software include up/down step ๐Ÿชœtuning, slider tuning control, eeprom view, 3 memories for storing frequency, saving custom clock๐Ÿ•“, alias frequencies calculated, and general purpose output ( GPO ) toggling on/off.
The dongle and software are available from us. Post a comment, contact us by email or use the form below to receive more information. Note that both AD9850AD9851 DDS devices are supported.๐Ÿ”˜
( Click on images to enlarge detail. )
SPI = Serial Peripheral Interface, 3-wire bus.
AD9850, AD9851 : ๐Ÿ”—Analog Devices Inc. parts, 32-bit CMOS Direct Digital Synthesiser (DDS) chips.

01 December 2024

Webserver for the Greenhouse Gas Sensors

๐Ÿ”˜ Carbon Dioxide, CO2, and Methane, CH4, are present in the atmosphere in part due to burning fossil fuels ๐Ÿญ, and farming ๐Ÿ‚( particularly livestock ). They are potent 'greenhouse' gases as they have a significant impact on global warming, which drives climate change.

A new WiFi version of the Greenhouse Gas Monitoring System, ( ๐Ÿ“…28.07.2022, 5.01.2023 & 18.02.2024 ) has been completed, incorporating a web ๐Ÿ•ธ server having an embedded webpage. The firmware and webpage were developed along very similar lines to that used recently with the "Solarometer" ๐Ÿ”…( ๐Ÿ“…13.10.2024 ); the latter using html and CSS *.
However, as the outdoor location of the gas sensors, ( type MQ-4 for CH4, type MQ-135 for CO2 ), will always be within the coverage area of an existing WiFi network access point, ( AP ), the system has been configured as a station ( STA ) on that network, and assigned the IP address 192.168.1.49.
Webpage opened in a smart phone's browser

The concentration ( parts per million, ppm ) measurements๐Ÿ“ are updated in real-time ๐Ÿ•”, and can be quickly viewed on a mobile device's๐Ÿ– browser, saving time over logging in to cloud ☁ based repositories, if historical data are not required.

Another way is to use the new SpacerLabs custom App "Greenhouse_Gas_Viewer v1.nn", for Android devices.

Displaying ppm measurements using the App
In this case the webpage itself ( /root directory ) is not displayed. Only the sub-directories ( /CH4ppm & /CO2ppm ), which are the place-holders for the CH4 and CO2 concentration data, are read by the App and the data held therein displayed.๐Ÿ”˜

* CSS = Cascading Style Sheets - used to add style attributes to an html document.

13 October 2024

Solarometer ๐Ÿ”†

๐Ÿ”˜The Ultra Violet Radiation Meter ๐†- UVRM, (๐Ÿ“… see 23-3-2023), has been improved with some new features and functionality, and also given a new name -  "Solarometer".

There is a new version of the BluetoothⓇ mobile ๐Ÿ“ฑApp, now called "Solar_Meter", ( as not only the UV index is being displayed ), having more on-screen notifications e.g., 'About' screen, as well as the new signal strength indicator and a different appearance.
Solar_Meter App user interface
The Wifi firmware has also been upgraded. The Solarometer hosts a webserver with a basic embedded web ๐Ÿ•ธ page, ( written in html, css & JavaScript ), and automatically configures itself as a WiFi soft access point, ( IP 192.168.4.1, SSID "SpacerLabs WiFi Sensors" ). This was originally developed for the UVRM in ๐Ÿ“… January 2021 as a prototype only. At that time "http" server-client communication protocol was adopted, which required a page refresh to initiate an http request to get a new UV measurement value. The Solarometer, however, uses "Asynchronous JavaScript & XML" ( 'AJAX' ) protocol for near real-time updating of the measured ๐Ÿ“light intensities on the webpage opened in the client's browser.
Webpage displayed on a phone's browser
Alternatively, the new SpacerLabs 'VISUVIR_Viewer' WiFi App can be used to get and display the sun-light ☼ intensities , but still employing the original http protocol.
VISUVIR_Viewer App user interface
The ๐Ÿ”—  Node-Red ๐ŸŸฅvisual programming tool contains an 'http request' node. A 'flow' ๐Ÿ”€was created to read data from 192.168.4.1 and update the readings ๐Ÿ“ˆ on a dashboard.
SpacerLabs Node-Red dashboard for the Solarometer
Orange, blue, grey, yellow, white and translucent have been added to the choice of colours ๐ŸŒˆfor the 3-D printed enclosure.

The Solarometer is intended for hand-held outdoor ⛅use; wireless version in range of client devices. It is powered by an internal 1000mAh 3.7V Li-Po rechargeable ๐Ÿ”‹battery.
Looking ahead ๐Ÿ“…,  the Solarometer, and/or new WiFi projects, will make use of websockets servers and protocol for even faster operation.
꩜ 
Note:  css = cascading style sheets.

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

06 August 2024

IoT Cloud Platforms☁

๐Ÿ”˜Several previous posts have mentioned the ๐Ÿ”—Ubidots and ๐Ÿ”—Thingspeak IoT cloud ☁ platforms, conveniently accessed from a web-browser, that have been used with some of our sensor based projects to capture, visualise and analyse ๐Ÿ’น the sensor measurements. Two others, 'Arduino IoT Cloud' and 'Thingsboard', have been found and tried out in conjunction with the PMS5003 Particle Concentration Sensor; ( see 8 April & 16 June ). Setting up was quick and straightforward, following the typical process for such platforms of creating an IoT 'thing', assigning 'variables', associating a 'device', programming & connecting the device, & designing a 'dashboard'; our device is a "D1 Mini Esp32" micro-controller board.

The ๐Ÿ”—Arduino IoT Cloud is an entirely cloud based platform, including an editor for writing and compiling the project firmware, which can then be downloaded from the cloud ( depending on the subscription plan ) to the device, from anywhere in the world ๐ŸŒ. Nothing is required to be installed locally on a pc ๐Ÿ’ปor connected to it other than a browser and internet connection. The dashboard shown in the image below is constrained by a maximum of  5 cloud variables under the no-time-limit free ๐Ÿ†“ plan. In general, the widgets to populate the dashboard tend to be the standard, classic ones.
Example of Arduino IoT Cloud dashboard - desktop version
An App "Arduino IoT Remote" on a mobile device ๐Ÿ“ฑprovides a mobile friendly version of the dashboard.

An account was opened for the 30 day free trial period of the ๐Ÿ”—Thingsboard cloud 'Maker' version. There is a large selection of attractive widgets for the dashboard, sorted by various categories. For example, under the "Air ๐Ÿœ Quality"  category there are numerous widget designs specifically for the measurement data relevant to air-quality. Some were chosen for the dashboard shown in the image below

Example of a Thingsboard dashboard

๐ŸŒ€IoT = Internet of Things.      

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
 
 

29 February 2024

PM2.5 data from AQM now on the cloud

๐Ÿ”˜Particulate Matter ㏘, PM2.5, data can now be uploaded ๐Ÿ–ง to the Ubidots cloud  ☁ from the Air Quality Monitor ( AQM ); see 15.03.2023. The Ubidots ลฎ platform provides visualisation / analysis of data from IoT sensors, also generating events, alerts, actions etc if required. We are already using this platform in conjunction with the Greenhouse Gas Monitoring system ( see 28.07.2022 ) and a soil moisture meter. On this occasion, with the AQM,  Node-Red is being used for alerts⏰.Two new widgets to display the PM2.5 concentration value have been added to an existing SpacerLabs Ubidots dashboard. The colours used for the air-quality levels ( good, OK, poor ) on the gauge widget match those used on the coloured LED indicator on the front of the AQM. 
Part of the dashboard showing the new widgets for PM2.5
Using the Node-Red ๐ŸŸฅ application, function 'nodes' are linked by connecting inputs to outputs and on-line services to create a 'flow' to perform task(s) using a browser based workspace. We have used it previously with the UVRM ( see 23.03.2023 ) and a soil moisture meter. The AQM flow ( image below ) starts by subscribing to the AQM PM2.5 data on Ubidots cloud using MQTT ( blue node ) and ends by triggering an email ๐Ÿ“ง to be sent when the PM2.5 level exceeds 85 ug/m3; classified as level 'high' and air ๐Ÿœ quality 'poor'.
Node-Red 'flow' to trigger an email warning of poor air quality
It can be seen under the 'Debug' tab that an email ๐Ÿ“งis indeed sent when PM2.5 >85; otherwise only the value ( if changed ) is reported. The email topic reads "SpacerLabs AQM - PM2.5 Alert " and the message reads "The SpacerLabs AQM has measured a PM2.5 level >85 (High) Air-Quality category - Poor. (Timestamp)". Even though the AQM may not be visible, an immediate audible notification is given by a smart phone when the email is received. ๐Ÿ”ฒ
PM2.5 = Particulate Matter size 2.5 micron
MQTT = Message Queued Telemetry Transport
IoT = Internet of Things

18 February 2024

๐ŸญGreenhouse Gas Monitor - Real Time Data

ThingSpeak Embedded Plot        ๐Ÿ”˜The SpacerLabs "Greenhouse Gas Monitoring System" ๐ŸŸฉ was described on 28.07.2022 & 05.01.2023 ๐Ÿ—“. Periodically since then it has been used to measure the outdoor concentrations of two potent green-house gases, Methane and Carbon Dioxide, in close proximity to "Spacerowa Laboratories" at 3m above ground level.  Methane ( CH4 ) and Carbon Dioxide ( CO2 ) concentration data in parts per million are now downloaded here every 15 minutes from the SpacerLabs Greenhouse Gas Monitor channel on ThingSpeak cloud ☁ for IoT sensor projects.

It has been noticed that increased concentration of methane coincides with wet weather conditions and vice-versa. According to NASA data, atmospheric concentration of CO2 was 416ppm in 2021, and CH4 was 1.8922ppm in 2020.
Lower left MQ-4 sensor, lower right MQ-135 sensor
The image above shows the outdoor part of the system with the two gas sensors, MQ-4 ( methane ) and MQ-135 ( carbon dioxide ), mounted in a weather-proof junction box,  ( cover removed ).
The blue trim-pot on each sensor breakout board can be used to set a concentration threshold level to trigger an alarm ⏰ and illuminate ๐Ÿ’ก a LED ( just visible in the image ). Although active, the alarm condition is currently not being extended back to the micro-controller situated indoors for processing. ๐Ÿ”ฒ