19 July 2025

Solarometer & AQM conversion to Websockets

🔳Continuing with our plan to convert to 'Websockets' our 📶WiFi connected projects with web-page servers,  the🌞 'Solarometer' ( from 📅13.10.2024 & 23.03.2023 ) and😷 'Air Quality Monitor - AQM' ( from 📅15.03.2023 ) are the latest, and possibly the last, candidates for conversion; also getting redesigned webpages in the process.🔳
Webpage: solarometer5.html

Webpage: air-quality-monitor-v1.html

13 July 2025

Upgrades to the Greenhouse Gas Monitor

🔘Our "Greenhouse Gas Monitoring System" measures the concentrations ( in parts per million, ppm ) of two potent greenhouse gases present in the atmosphere, Carbon Dioxide and Methane. The last upgrade added a webserver and embedded webpage ( 📅see 01.12.2024 ). 
The upgrade described here has replaced the original AJAX/HTTP webserver with a 'Websockets' server also incorporating a redesigned webpage, having more features and an attractive appearance; ( image below, click to enlarge ).
Webpage: gas-sensors-v2.html
The new features include displaying the WiFi signal level 📶to assist in choosing the location of the sensors, time-stamp provided by an NTP server, and a bar-chart 📊showing the recent history of the gas concentration measurements, updated in real-time every 🕞15 seconds.
Extensive use of graphics and images has contributed to the modern appearance of the new page design. The page's background image shows the outdoor unit which contains the two sensors; seen exposed to the atmosphere along the lower edge. The 'emojis' * which were included in the page design show some of the causes and consequences of these gases.🔘

NTP = Network Time Protocol.
* Emojis appear similar to images and icons but are characters from the UTF-8 character set.

29 June 2025

New Webpage for the Remote Soil Moisture Meter

🔘A "Remote Soil Moisture Meter - RSMM" has been in operation during the summer 😎 months since before this blog began; prior to  📅December 2021.
RSMM deployed in a herb garden - note LoRa antenna & solar panel
The RSMM transmits a soil moisture🚰 measurement every 🕥 hour using "LoRa" * wireless 🗼data technology to a receiver 📻module located conveniently indoors, about 35 metres away.
Several variants of the 📻receiver module were made; in general having either 🛜WiFi or Bluetooth functionality, in addition to LoRa. One of the 🛜WiFi options hosts a webserver, with embedded webpage to display the moisture 📏 measurement. This is accessed from a 📱smart-phone, 💻pc etc, having a browser installed. The original, basic, webpage design from 📅2021 is shown in the image below.
Version 1 webpage displayed on a phone
Recently the webpage has been given an upgrade to v2. The much improved webpage was designed using HTML, CSS & Javascript and has been considerably enhanced compared with v1 with several new features, such as 🛜WiFi signal level 📶indicator, chart 📈of moisture measurements over 🕥12 hours updated in real-time, and a button to pop-up moisture level definitions. The appearance has been revised and modernised with graphics, especially with the background image of the RSMM itself, a browser page tab favicon, and the use of different coloured panels to separate elements. Version 2 ( June 2025 ) is shown for comparison in the image below.
V2 viewed on a pc browser
V2 will be uploaded to the receiver module next time the RSMM is deployed, and is operational.
The latest issue of the 'User Guide' can be downloaded 🔗here.
* 'LoRa' = 'Long Range' 🔲

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.

11 May 2025

Node-Red Dashboard for the PWM

🔘The "Node-Red " browser based visual programming environment has been used several times before. ( Use the search box to find out more about it and our previous related projects ). This time its dashboard feature is being used again in order to display in real-time the measurements being made by the "Plant Water Monitor - PWM" ( refer to last post 📅05.05.25).
A 'flow' was built-up by interconnecting nodes selected from the palette ( left sidebar ). The input to the flow is of course the measurements being sent by the PWM  'websockets' server. Fortunately the palette includes the node ( 'websocket in' ) to handle this ( highlighted in the image below ) ! 
PWM flow - nodes linking the websockets input to dashboard widgets
The entire websockets data payload is converted to JSON* string format, ( "{"name":"value" }" pairs ) and then output to the debug sidebar on the right. Basically, the other nodes separate out specific measurements from the string, ( battery voltage, battery charge state, time-stamp, moisture value, moisture level & version information ), which are then sent to the relevant widgets on the custom dashboard for viewing.
PWM dashboard displaying real-time data
Another flow & dashboard was also created consisting of just the battery voltage charge/discharge chart 📉widget and left running for 22 hours for the purpose of establishing the discharge characteristic of the 3.7V 1000mAh rechargeable Lithium-Ion-Polymer battery which powers the PWM.
3.7V 1000mAh Li-Po battery discharge characteristic
The value displayed on the primary dashboard for the 'percentage charge remaining' is based on the profile of that chart.🔲

* JSON = Java Script Object Notation.

05 May 2025

Plant Water Monitor - PWM

🔘The "Plant Water Monitor" ( PWM ) project has been completed. It's function is to measure the 💧moisture in the soil where a 🪴plant is growing. The PWM consists of a capacitive soil moisture sensor, µ-controller, rechargeable battery, 🔋battery charger, waterproof enclosure, 🛜Wifi and webserver serving a webpage. In use, the protruding moisture sensor is pushed into the soil near the 🪴plant's roots.
Plant Water Monitor
The ﹌moisture measurement is sent by the webserver using 🛜Wifi and 'Websockets' to the PWM webpage opened in a browser, running on a client computer💻 or phone🖁. Websockets and the preliminary webpage designs were the subjects of the last post, on 📅20 April 2025. 
Two PWM firmware versions have been made; each having a different 🛜Wifi configuration. Depending on the location of the 🪴plant of interest, either the version of the PWM configured as a 🛜Wifi 'Station (STA)' on an existing network or the version configured as a stand-alone 'Soft Access Point (SAP)' would be chosen. The former requires an existing 🛜Wifi network to be in range of both the PWM and phone etc; the latter does not have that restriction but does require the client device to be connected to SSID "SpacerLabs-Wifi-Sensors".

A different webpage has been designed for each version of the PWM, using HTML, CSS & JavaScript. The webpage ( IP:192.168.1.63 ) for the version supporting 'STA' is almost identical to V4 shown in the previous post, with the addition of the 🔋battery charge status.
Notice the 'favicon' in the browser page tab (click to enlarge)
The webpage for the PWM version supporting 'SAP' is shown in the image below, and is being displayed on a phone's browser, after connecting to 🛜Wifi network 'SpacerLabs-Wifi-Sensors' & then navigating to IP:192.168.4.1.
Page: plant-water-monitor-v2.html

Features supported include Wifi signal monitoring, 🕓time-stamp, battery🔋 charge state, soil moisture, serial number, chip model & revision, pop-ups for 💦moisture level categories and ⛿flagging recommended action.

The latest issue of the 'User Guide' can be downloaded 🔗 here 🔘

20 April 2025

Websockets Servers & Websockets Protocol

🔳A couple of our recent projects involving sensors & WiFi, ( 'Solarometer' 📅13.10.2024 & 'Greenhouse Gas Sensors'  📅01.12.2024 ), have an integrated webserver hosting a webpage so that the sensor readings can be displayed on a client device, e.g., phone 🖁or computer💻, running a browser. Either HTTP or AJAX protocol was employed for the server-client connection.

A🪴'Plant Water Monitor'  is a new project which will use a Websockets Server & Protocol instead. Websockets was briefly mentioned in the 'Solarometer' post. To recap, unlike HTTP or AJAX, Websockets provides real-time server/client communication over a continuously open full-duplex bidirectional connection 🔁, requiring no page refreshes or other requests; just the measurement data ( not the entire page ), are sent automatically, with minimal latency.

Testing Websockets has been successful. The Websockets server, ( programmed on the µ-controller in the 🪴Plant Water Monitor ), is assigned IP address 192.168.1.51 when it establishes a connection with our Wifi network router access point. Navigating to that address with a browser on a 🖁phone or 💻computer displays the page to see the data being updated.

Several variations of a webpage were designed, ( again using HTML, CSS & JavaScript ). One or more will eventually be selected as a basis for the design for the 🪴Plant Water Monitor. Each has the filename soil-moisture-sensor-vn.html. Websockets protocol is used to automatically update ( ⏱every hour or every minute ) the moisture﹌ readings, time stamp of the last reading, and Wifi signal level, in real time.⌚
V1 viewed on a phone
V1 is the basic page design having the essential features. Wifi signal level ( at the moisture sensors location ), moisture ﹌readings at two locations and time-stamp are updated automatically without any intervention required from the user.
V2 + WiFi signal level meter
V2 as V1, with the addition of an analogue bar-meter showing the WiFi signal level changing to assist in choosing a location for the remote sensor. 

V3 + popup notification
V3 as V1, with the addition of an alarm ⏰ condition pop-up advising that action should be taken on the basis of the reported moisture measurement. 🥀🏜

V4 + button & background image
V4 as V1, with the addition of a 'button' which when tapped will show or hide the moisture level descriptions, and with the addition of a background image of the 🪴'Plant Water Monitor' itself.

Note that the ⌂"home" icon in V2, V3 & V4 is continuously spinning.
🔲

09 March 2025

Web Page Viewer

🔘Our new html page 📄viewer software called "WebPageViewer" was developed by us using the 'Visual Basic' programming language ( part of the MicroSoftⓇ Visual Studio Community 2022 edition development suite ), and has just been finished. Although it is basically a browser, its main purpose is to facilitate the design of html pages 🗐 for our µ-controller projects which have embedded web-servers,  such as the Green-House Gas Sensors 🏭( 01.12.24 )  and Solarometer 🌞( 13.10.24 ), and not for online browsing.
Application window after navigating to this blog
The main window has an uncluttered appearance, free from sidebars and bookmarks, to maximise space; menu bar and tool strip comprising address box and buttons 🔲at the top, page display area underneath and a progress bar in the status strip at the bottom. The width of the page display area defaults to be the same as the horizontal screen resolution ( 1080 px ) of the smart-phone 📱that will be used to display the page, making it quick and easy to see the effect of design changes when arranging the elements on a page in order to suit the phone screen size.  
'About' window displayed after clicking the menu-bar item
As is typical, version information 🛈, copyright © notice and a brief description of the application are contained in the 'About' window, which is a common feature of all our in-house 🏠software running on the WindowsⓇ OS. 🔳
 

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 !