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 built into an AQM product or instrument etc ) and is being tried out.

In use, 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 terminal application specifically for the PMS5003, called 'PMS5003_Serial', with only basic functionality just to demonstrate the operation of the PMS5003, ( image below ).
PMS5003_Serial software receiving & displaying data
The received raw serial data are displayed in hexadecimal or ascii, then parsed in software to extract the bytes of interest containing data relating to particulate matter🦠  mass concentration ( ug/m^3 ) and particle number per deci-litre, ppdl, ( 0.1 litre ) of air 🜁 , sorted according to size ( microns ) and converted to decimal values. 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. 🔲
 

11 August 2023

True RMS Voltmeter ⌁

⚡The Root Mean Square ( RMS ) voltage is a useful value to measure as it is related to the power  ( 'heating effect' ) of the voltage. The SpacerLabs "RMSDC-1" voltmeter described here is able to measure the true RMS value of complex periodic voltage waveforms, ( not just sinusoidal ∿ ), up to frequencies of  typically 8MHz, and even if a DC offset level is present.
Measuring the output voltage of a 3V DC precision source
Central to the operation of the RMSDC-1 is a highly accurate RMS to DC converter chip which produces a DC voltage equivalent to the RMS value of the input voltage. This DC voltage is sampled by a separate 10-bit analogue to digital converter ( ADC ) so that the voltage can be displayed. Also a dB output is available which has been calibrated to give the dB value of the input voltage being measured relative to 1V ( 1V = 0dBV ). For DC voltages the RMS value is the same as the DC value. So the RMSDC-1 can be used as a DC voltmeter. Both AC and DC input coupled signals can be measured; the latter allowing any DC offset to be retained. An active analogue filter of the Sallen-Key type can switched in to reduce any potential inaccuracy due to AC ripple at 2X input frequency.
An attractive 3-D printed front panel can be fitted
A front panel has been designed and printed to give the RMSDC-1 a very smart appearance. The front panel also serves to support the RMSDC-1 vertically. The display module is a 2X16 LCD with a white or yellow/green back-light. 


 

27 July 2023

AD9850 DDS Module with mobile App configurator

📶The Analog Devices Inc. AD9850 is a 32bit CMOS Direct Digital Synthesiser ( DDS ) device. Evaluation circuit boards with the device already mounted are widely available at low cost. However, in order to use the device ( perhaps only a quickly assembled frequency source is required ) a means still has to be provided of uploading to it 5 bytes of configuration settings, also a display to show the frequency and a rotary encoder for tuning. In the past at 'SpacerLabs' we have used a SPI-USB dongle and pc terminal software to acheive this.
📳A different and even more convenient method has recently been devised using an ESP32 micro-controller and our custom App for mobile devices📱called "DDSTerm". The App generates the 5 configuration bytes required from the user input frequency and phase data, then sends to the ESP32 using BluetoothⓇ. The ESP32 uploads the bytes using the SPI to the DDS board. The desired frequency [ ] is output. In the image example below frequency is 11.501MHz & bytes hexadecimal 178DD617C4.
App 'DDSTerm_v1.06' opened
The image below shows the hardware setup used during development, comprising a typical ESP32 micro-controller in a 3-D printed case connected to the AD9850 DDS evaluation board mounted on a test-jig. The test-jig is not essential as the DDS board has pin-strip headers.
(Left) AD9850 board on test-jig, (R) ESP32 micro-controller inside enclosure
𝌕The Android App "DDSTerm" and firmware for the ESP32 are available from us. Contact us by email or use the form below to receive more information. Note that AD9851 DDS boards are also supported.

SPI = Serial Peripheral Interface ( 3-wire bus )
 

26 May 2023

Cyclometer 🚵

The SpacerLabs "Cyclometer" is a cycle 'trip-computer' which provides a cyclist 🚴 with data on number of wheel revolutions (Revs), distance travelled (Kms), average speed (Av.Kph) and current speed (Kph). It comprises a display unit, magnetic switch and magnet. 3-D printed enclosures for these separate parts give the Cyclometer a smart appearance. The Cyclometer is powered by an internal 3.7V rechargeable Li-Ion polymer battery.
Cycle wheel revolutions are detected by the magnetic switch which is closed and opened by the magnet fixed to a wheel spoke as it passes by close to the switch. The switch is wired to the display unit which counts and displays the revolutions. The distance travelled is calculated from the number of wheel revolutions and the wheel outer circumference measurement. A free-running internal milli-second timer allows the cycle speed to be determined.
The Cyclometer display unit
The Cyclometer display unit is unusual as it also acts as a BluetoothⓇ server ( SPACERLABS_CS ) using the 'Bluetooth Low Energy'  ( BLE ) variant of BluetoothⓇ. Connecting to it with a paired BluetoothⓇ client device ( e.g., a smart phone 📱), having a suitable App installed enables the Cyclometer ready for use. The BLE features of the Cyclometer have been modelled on the standard service and characteristics of the BluetoothⓇ "Cycling Speed & Cadence Service", though no cadence, ( crank ), data are required by the current version of the Cyclometer. An additional characteristic has been provided to support the wheel outer circumference measurement.
The SpacerLabs 'Cyclometer' App
Many general purpose BLE client App's are available. However, here at SpacerLabs, we have built our own custom 'Cyclometer' App for Android devices to make the process of updating sensor location and wheel size quick and easy !

23 March 2023

Solar UV Radiation Meter🌤

Frequent or prolonged exposure to high levels of solar 🌞 ultra-violet ( UV ) radiation can damage the human skin.
The SpacerLabs solar 'UV Radiation Meter' ( abbreviated UVRM ) provides a way to measure the radiation and display the result as the UV Index and UV Level. Informed decisions about appropriate precautions can then be taken if necessary. 😎🤠
The UVRM is based on the Silicon Labs SI1145 'UV Index sensor', together with a 32bit micro-controller, blue 0.96" 128x64px OLED display module and power management system. The UVRM is powered by an internal 3.7V rechargeable Lithium battery, which can be charged in-situ via the micro USB connector. A custom 3-D printed blue & white hand-held enclosure gives the UVRM a smart appearance.
UV Index ( zero to 11+ with a resolution of 0.01 ), and UV Level are displayed according to the W.H.O definitions; Low, Moderate, High, Very High & Extreme. The SI1145 also derives a "Visible Light Index" ( VIS ) and an "Infra-Red Index" ( IR ). These indices are not displayed directly by the current versions of the UVRM.
UVRM displaying an indoor UV reading
Two main options have been developed allowing the UVRM to be used as a stand-alone device when extended battery life is important or the option of wireless connectivity using BluetoothⓇ.
SpacerLabs has developed a custom App called  "Light_Meter" to connect to the UVRM using BluetoothⓇ communications.
The SpacerLabs 'Light_Meter' App
Using one of the BluetoothⓇ versions of the UVRM with a paired and connected mobile device running the App makes it easier to view the data in some outdoor situations 🌞. The VIS and IR indices are also exposed.
 
( W.H.O = World Health Organisation )
 

15 March 2023

Multi Sensor Air Quality Monitor

An inexpensive domestic 'Air Quality Monitor'  ( abbreviated AQM ) has been modified with additional sensor support, display module and 32-bit micro-controller.
The original AQM, ( made in China ), uses a Cubic PM1006 Particulate Matter sensor to determine the PMx ( x =  microns ) particulate matter concentration in the air and changes the colour ( green, yellow or red ) of an illuminated indicator accordingly. This feature has been retained in the SpacerLabs modified versions.
The modified versions measure PM1, PM2.5 & PM10 and, optionally, have either a CCS811 sensor or AHT20 sensor also fitted to provide TVOC & CO2 or temperature & humidity data as well. The measurement data are displayed on a blue or white 128x32 pixel OLED display. Firmware which controls the sensors and the display is uploaded to the micro-controller via a micro USB connector.
AQM version PM1006/CCS/811
AQM version PM1006/AHT20 will be deployed in the kitchen where airborne particulate matter ( smoke ) and high humidity caused by cooking can be monitored.
AQM version PM1006/CCS811 is suitable for a workshop environment where CO2 & TVOC could be present, in addition to particulate matter.
A SpacerLabs App, called "Air_Quality", has been designed, so that the PM1, PM2.5 & PM10 measurements can be viewed on a mobile device, using BluetoothⓇ communication. The PM2.5 concentration value will change colour in the same way as the illuminated visual indicator on the original domestic AQM.
SpacerLabs 'Air_Quality' App
The AQM can be powered by a USB charger connected by a cable with a USB-C plug.
The micro-controller also has built-in wifi as well as BluetoothⓇ. This opens up the future possibility of integrating the multi-sensor AQM into a 'smart home' network.

TVOC  = Total Volatile Organic Compounds ( paint, solvents etc ).

05 January 2023

Touch Screen for the Greenhouse Gas Monitor

Nowadays it seems almost obligatory that electronic gadgets have a touch screen display user-interface. Such a display has now been incorporated in a Greenhouse Gas Monitor ( see 28 July 2022 ).
This particular display type is a 2.8" 240x320 pixel touch panel display with SPI and using the ILI9341 driver chip. On the back is an SD card slot. Cost when purchased was just under GBP11.
Either Methane ( CH4 ) or Carbon Dioxide ( CO2 ) concentration data can be displayed separately in real-time by tapping on a displayed 'button', without having to connect to the 'ThingSpeak' or 'Ubidots' cloud repositories as before in order to view the data; the cloud would still be required, however, for data storage ( unless SD card used ) and processing.
An experimental version comprising the display and an ESP32 micro-controller development board ( with new firmware ) mounted on a prototyping board was assembled and connected to the same pair of outdoor gas sensors ( MQ-4 & MQ-135 ) used previously.
The Methane CH4 concentration is selected
The Carbon Dioxide CO2 concentration is selected
( SPI = Serial Peripheral Interface )
   

18 December 2022

Meshtastic network using LoRa wireless modules

LoRa WAN ( see 16 March 2022 ) and a point to point LoRa wireless data link have been used previously. This post describes setting up a "Meshtastic" based secure private network comprising 2  nodes again using cheap, low power, LoRa wireless modules, operating on a frequency 868MHz.
Meshtastic allows encrypted text message type communication between nodes ( upto 80 ) in an "off-grid" mesh type network which requires no gateways, infrastructure or internet servers; the underlying technology used is LoRa.
A user-group called SpacerLabs, and 2 nodes named Webmaster ( Wbms ) and Laboratory ( Lbrt ) were created. Node 'Webmaster' uses a TTGO T-Beam board. Node 'Laboratory' uses the same TTGO LoRa32v2 board as on 16 March. Both boards support BlueTooth Low Energy ( BLE ) and have LoRa transceivers; the T-Beam has additionally a Ublox Neo-6M GPS receiver allowing tracking its position.
(L) Node Webmaster [T-Beam], (R) Node Laboratory [LoRa32v2]
The appropriate 'Meshtastic' firmware version was uploaded to each board. Both boards have to be paired with a BlueTooth enabled device, e.g. smartphone or tablet. The 'Meshtastic' app was downloaded and installed on a smartphone.
Although LoRa allows communication between nodes dispersed over a wide area and upto several kilometres apart depending on intervening terrain and antenna type and position, for demonstration purposes the two nodes were positioned just a few centimetres apart. Short text messages were sent from each node using the smartphone. In the above image note the message which was sent to the Laboratory from the Webmaster.
Viewing messages on the Meshtastic app
Currently there is no actual requirement for a Meshtastic based network for a SpacerLabs user-group. It was, however, an interesting exercise finding out about Meshtastic and getting a simple network up and running. Two spare LoRa modules are available and could easily be used to add more nodes to the group, perhaps on different floors or buildings e.g., 'Office' and 'Warehouse'. ( visit https://meshtastic.org for more information ).