The blog of a dedicated radio amateur and electronics enthusiast

"Having fun on the air and in the workshop - communicating and creating"

23 January 2024

My low power LF radio signal is received in Germany

๐Ÿ”˜ Almost 11 years ๐Ÿ—“ have passed since I last used my low-power transmitter power amplifier ( see 08.05.2013 ) based on the TDA2030 class AB audio ๐Ÿ”‰ amplifier i.c. ( see 22.02.2013 ). Since then several data ๐Ÿ’พ transmission modes, e.g., FST4W,  have become popular among radio amateurs who are active transmitting on the LF 2190m/136KHz 〰 ( longwave ) ๐Ÿ“ป band. I also have high power transmitting equipment for that frequency band. However I wanted to conduct a simple test by transmitting a very low power beacon signal using FST4W to determine at what distance it might be received.
My setup for the test was the phasing exciter ( see 02.11.2017 ) as the signal source driving the low power amplifier. The antenna ๐Ÿ—ผ was my usual one for the 2190m band; a 47m  long x 13.5m tall base and end-loaded inverted 'L' ( ๊ž€ ) ;  see 19.02.2010 et al.  The transmit frequency ∿ was 136.13KHz, transmitter output power only 3.5 watts, ( similar to the power consumption of a small LED lamp ๐Ÿ’ก ), and beacon transmission, consisting of my callsign, location and power level, sent at 5 minute intervals.
Equipment used for the low power test on 2190m band
I began sending beacon transmissions during the evening of  21.01.2024. Previously, during the tests on 8 May 2013, ( albeit using a different mode ), the reception distance had been only 17 kms. I was doubtful if anyone beyond that range would receive my signal. So I was very surprised, when, at 2120 utc ๐Ÿ•ค, a reception report was posted ๐Ÿ“ฎ on wspr rocks  ☁ that my beacon signal had been received ๐Ÿ“ถ  near Chemnitz in Germany, at a distance of 582 kms. Incredible and amazing ๐Ÿ˜€ !
 
LF = Low Frequency.
135.7-137.8KHz ( 2190m band ) is the lowest frequency band allocated to radio amateurs.   

09 January 2024

3-D Printed Holders, Clips & Formers

๐Ÿ”˜I've designed and printed a selection of parts some of which are intended for use in the transmitter power amplifier I am currently building for the 472KHz∿/630m wavelength radio ๐Ÿ“ป band. So far I've made holders for some large foil capacitors, mounting clips for toroidal cores and coil formers ➿. Both PETG (grey) & PLA (blue or yellow) plastic filaments were used
Toroidal core clips, coil formers & capacitor holders
The toroidal core clip is for a T150-26 core which has an external diameter of 1.5". The coil fomers are ribbed for a close-spaced winding with 1.6mm diameter enameled copper wire. One side of the capacitor holder is open so that the value and voltage rating are visible. Where required, the parts can be panel-mounted using M2.5 nuts and bolts ๐Ÿ”ฉ.
One benefit is that all dimensions and the style can be customised for a 'tailor-made' solution. I am no longer restricted to using PVC tube or pipe fixings for example, in only a few sizes bought from the shop. 

  

08 October 2023

Remotely operated Antenna Tuner - in use

In my last post I described the system I have recently put together to remotely tune ➿ the antenna ๐Ÿ—ผ I use for the MF 630m ( medium wave) amateur band. The images below show the outdoor parts of the system now deployed and in operation with the antenna.
Base of antenna showing tuner, coil, element & support
A usb rechargeable power-bank ๐Ÿ”‹ provides power for the remote unit and motor. I made a protective cover ( yellow object ) for the stepper-motor to keep it dry.

Container cover removed to show remote unit & power-bank

While trying it all out for the first time when using my transmitter I was able to re-tune ๐Ÿ” the antenna as I changed transmission frequency, from the operating position indoors.  All parts of the system are performing well. I am very pleased with the results.

22 September 2023

Remotely operated Antenna Tuning

My inverted-'L' ( end-fed Marconi ) type antenna๐Ÿ—ผfor the 630m ๐Ÿ“ป amateur band uses a variometer tuned loading coil ➿ at its base, which has to be adjusted to maintain antenna resonance when the transmitter changes frequency. Manual adjustment has always been possible; but never convenient as the coil is situated 35m from the house. So I devised a method for 'tuning' the antenna remotely, building on my experience using  LoRa and BluetoothⓇ ๐Ÿ“ถ in some previous projects.
Indoor unit (display active), remote unit, stepper motor & coil
The setup comprises an indoor unit for the LoRa transceiver and BluetoothⓇ server and remote units consisting of  another LoRa transceiver and stepper motor. TTGO LoRa Esp32 micro-controller boards are used.
App "Step_Match" opened
My custom App "Step_Match" for a smart-phone๐Ÿ“ฑ connects to the server "Step_Tune" with BluetoothⓇ. Each time 'Step CW +' or 'Step CCW -' is tapped a command is sent to the indoor unit, then via LoRa to the remote receiver to drive the motor shaft clockwise or counter-clockwise by 5ͦ . Cumulative motor steps, number of clicks and degrees of rotation, ( relative to a half-way position at zero ), are updated. The motor actually makes 28 steps for each 5ͦ of shaft rotation, 2048 steps per revolution at a speed of 2rpm. 
The 3-D printed 3cm diameter toothed wheel  ( 24 teeth ) fitted to the motor shaft engages with a 4cm diameter toothed wheel ( 32 teeth ) on the variometer coil adjustment shaft; this gear ratio being 1/1.33. So the variometer shaft rotates 3.75ͦ per click. A initial check just holding the motor in position confirmed that it developed enough torque.
I temporarily placed the 'remote units' outdoors next to the antenna. The 868MHz LoRa link worked perfectly. Everything is now ready for use with the antenna. 
 
LoRa = Long Range ( a low bit rate, low power, long range digital wireless data technology ).
๐Ÿ—ผ An image showing the original antenna was posted on 11 September 2012.

10 August 2023

True RMS Voltmeter⚡

The digital multi-meter ( DMM ) in the electronics enthusiast's workshop may be specified as measuring the actual RMS voltage on its AC voltage ranges; but that may still only apply to sinusoidal voltage waveforms, or non-sinusoidal are displayed as if sinusoidal. Actually, my DMM only measures the less useful average value, which is not the same. *
Back in 2017 I designed a voltmeter capable of measuring the true RMS voltage of signals having complex waveforms, ( not just sinusoidal ), up to frequencies of several MHz, and even superimposed on a DC level. Central to my voltmeter's operation is a highly accurate RMS-to-DC converter chip. I had made several of them with different display back-lights; orange, green & white.
Measuring a 5V 100KHz square-wave, 12% duty cycle, CF 2.86
I decided to look again at the voltmeter to see if any improvements would be beneficial. Since 2017 I have changed the development tools I use for my embedded projects several times, which would rule out making alterations to the firmware. 
First I fitted a 3-D printed front panel; see image below.
Measuring the output voltage of a 3V DC precision source
I also carried out some comparative tests together with my DMM and oscilloscope using:
(1) a 400Hz sine-wave and (2) a 400Hz square-wave, having a 27% duty cycle.
The results suggested that my DMM is AC coupled and employs a full-wave rectifier circuit for sine-wave voltages. Surprisingly it is almost as accurate as the RMS voltmeter for measuring square-wave voltages. 

* Specification of my own 3½ digit DMM : average value of sine wave, frequency range 40Hz-400Hz
RMS = Root Mean Square ( the RMS value is a particularly useful quantity as it relates directly to the power ['heating effect'] of the signal )

   

16 July 2023

Mobile App User Interface for a DDS Module ๐Ÿ“ถ

I previously featured a DDS module based on the Analog Devices AD9850 32bit device on 4.1.2018. The method I used then to generate an output frequency from the DDS board involved an SPI-USB protocol converter dongle with pc terminal software.
Another method I recently devised uses a micro-controller and my custom "DDSTerm" App installed on a mobile phone๐Ÿ“ฑ. As before SPI protocol is still needed to upload the tuning word, phase and power control bytes to the DDS configuration register and this operation is now performed by the micro-controller. But instead of software running on a pc, the App is now used to generate the bytes required, which are then sent using BluetoothⓇ Low Energy ( BLE ) to the micro-controller. An ESP32 micro-controller has SPI peripherals and built-in BluetoothⓇ, and so was used.
App 'DDSTerm_v1.06' opened
The micro-controller functions as a BLE server 'AD9850_DDS'. The App on the client device scans for this server and connects to it. The desired frequency, phase and power mode are entered. Clicking "Generate" produces the required 5 bytes ( hex 004831C8C4 in the image example ), and clicking "Send to DDS" sends the bytes using BluetoothⓇ to the ESP32, which then uploads them to the DDS board on the SPI.  An output is generated on the selected frequency, e.g., 137.7KHz. Clicking 'PWR DWN' puts the DDS in 'sleep' mode. The two yellow LEDS ( see image below ) are toggled on/off with GPO1 & GPO2. The last uploaded frequency is saved and automatically recalled whenever the App connects.
The hardware setup during development & testing
The hardware ( image above ) consists of an AD9850 DDS module board bought very cheaply on-line and mounted on my test jig from 4.1.2018. Inside the 3D-printed blue and yellow enclosure is the ESP32 micro-controller development board which is a typical one having the ESP32-WROOM-32 processor. Both the DDS and ESP32 are 3.3v supply and logical level compatible. No level shifting is therefore required when interconnecting.
I also use DDS modules fitted with the AD9851 chip; see 2.11.2017. The only changes to the App, ( other than selecting the correct device ), would be a 'x6 Reference Clock Multiplier' checkbox, and extending the frequency range of the 'slider control'; both optional.

DDS = Direct Digital Synthesis.
GPO = General Purpose Output
SPI = Serial Peripheral Interface ( 3-wire bus ). 
 

09 March 2023

Multi-Sensor Air Quality Monitor

I have completed my project to modify a domestic air-quality monitor, ( AQM ), which retails for GBP15 in the UK, and turn it into a multi-sensor AQM. See also 5, 9 & 12 February.
The original AQM only has a Cubic PM1006 particulate matter sensor. The colour of an illuminated indicator changes, ( green, yellow or red ), with the PM2.5 ( 2.5 micron ) particle concentration in the air. I have retained this feature in my modified versions.
I fitted a 'D1 Mini ESP32' micro-controller board to read the sensors and send the measurements to a display for viewing. The display module is a 128x32 pixel OLED. The sensor types I chose are the CCS811 ( CO2 & TVOC ), (  see also 20 January ), and the AHT20 ( temperature C & relative humidity % ).

Internal view showing position of the main components

I have made two versions of the multi-sensor AQM, suited to my intended use based on which sensors I fitted and with a display to give a direct readout.. The image above shows the internal layout of the PM1006/CCS811 version.
The PM1006/CCS811 version displays data for PM1, PM2.5, PM10, CO2 & TVOC. I shall be using this version in my workshop where TVOC could occasionally be present.
The PM1006/AHT20 version displays data for PM1, PM2.5, PM10, temperature and relative humidity. I shall deploy this one in the kitchen primarily for the particulate matter measurements ( presence of smoke, flour etc ), and also the humidity.
So, in two places at least, I'll have some knowledge of how clean the air is that I'm inhaling.
I've also written software for a third version with just the PM1006, ( as in the original AQM ), only displaying data for PM1, PM2.5 and PM10. It would just be a simple matter of uploading the software to either of the other two versions.
Version PM1006/CCS811

The 'D1 Mini ESP32' micro-controller board has built-in wifi. 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 ).
 
 
 
 
  
  

12 February 2023

Displaying PM2.5 data from the PM1006 sensor

After I had received the raw data, ( see 9 February ), I then wanted to connect a display module to show the PM2.5 particulate matter concentration value, which would also be a very useful addition to the domestic air quality monitor.
The setup in use while I was developing the software is shown in the image below. The setup comprises an ESP32 microcontroller development board, 128x64 pixel blue OLED display, control board and PM1006. The serial data connection to a hardware UART peripheral on the ESP32 required a resistive level shifter because the PM1006 outputs 5 volt logic high level, whereas the ESP32 UART input is for 3.3 volt and is not 5 volt tolerant. 
PM2.5=47ug/m3, (top-left) note the resistive level shifter
Each time the PM1006 is polled the software filters those bytes received by the UART that I had previously identified as containing the PM2.5 information, does the conversion to ug/cubic metre and sends the result to the display module. The software also selects the header and checksum bytes and uses them to detect any data errors to prevent corrupted data being displayed.
Now it is time to think about re-assembling the air-quality monitor. I'll need to choose a smaller micro-controller board and a different OLED display module to fit in the available space. I'd also like to fit additional sensors for measuring air temperature, relative humidity, TVOC and CO2.
  

09 February 2023

Reading PM2.5 data from the Cubic PM1006

Continuing the topic of the last post I can now decode the PM2.5 concentration data from the PM1006 particulate matter sensor. 
I dis-assembled the air-quality monitor, ( AQM ). Inside is an electronic circuit board and the PM1006. To access the data I connected the 'REST' test-pad and 'GND' test-pad on the circuit board to the 'RX' and 'GROUND' respectively of a 'USB-UART' protocol converter dongle. The dongle connects to a pc via usb in order to display the data using a serial terminal program.
(L) USB-UART dongle, (R) AQM control board & PM1006
The PM1006 data sheet states that the serial data format is 8 data bits, 1 stop bit, no check bit and speed 9600bits/second. When I had configured a serial terminal program to match, I was able to view the data bytes. 
I have observed that the control board switches on the sensor's fan, then polls the sensor 7 times. Each time 20bytes of data are output on the 'REST' connection. This process takes about 15 seconds, after which the fan is switched off for 20 seconds before the cycle repeats.
7 x 20 bytes (columns) of data displayed in hexadecimal form
The PM1006 data sheet also states that after 3 bytes of header, ( always 16 11 OB ), there are 16 bytes of data ( data fields DF1-DF16 ) and a checksum byte at the end. DF3 and DF4 ( columns 6 & 7 counting from the left ) contain data relating to the PM2.5 concentration. The actual concentration is found first by converting the hex to decimal and then using the formula ( DF3 x 256 ) + DF4. So '00 26' gives 38ug/cubic metre and '00 25' gives 37ug/cubic metre. The front of the AQM was illuminated yellow at the time; 36-85 is medium concentration and air quality 'OK'.
I extinguished a burning match near the PM1006. DF3 and DF4 peaked at 02 & 81 corresponding to PM2.5 of 641ug/cubic metre. The front was illuminated red.
The next step will be to parse the raw data ( in the image above ) in software and fit a display module to display the actual PM2.5 concentration in a 'user-friendly' form. That's a task for a micro-controller and the topic of a future blog-post !
 
Notes: 2 hex digits = one byte, and UART = Universal Asynchronous Receiver Transmitter. 
 
  

05 February 2023

Particulate Matter Detector

I've recently been using several different gas sensors, some of which I have already mentioned. But I also wanted a 'Particulate Matter' ( PM ) sensor to detect microscopic solid particles in the air, particularly as I am frequently sneezing in my work-area ! Realising that such sensors are also used in home 'air-quality' monitors, I bought a very cheap one for about GBP15 to take apart. Refering to the image below, green indicates 'good' air quality; PM2.5 between 0 and 35 ugms/cubic metre.
The domestic air quality monitor I bought
I removed the sensor from inside and identified the type as PM1006 made by Cubic. Searching for a data-sheet for more information, it is described as a LED Particle Sensor for detecting particles ranging in size from 0.3 to 10 microns. Especially interesting was to read that it has a built-in micro-controller which directly outputs the particle mass concentration in digital form, ( units of micro-grams per cubic metre ), as a serial bit stream at 9600bits/s which I should be able to hack in order to decode the data and display the concentration value. In fact a permanent numerical display would be a useful addition to the air quality monitor to supplement the changing colour of the visual effect.
Next time I'll be describing how I hacked the data.

micron = one millionth of a metre.
PM2.5 = Particulate Matter 2.5 micron ( reference particle size adopted internationally in particle concentration definitions of air quality ).
 
 

 

20 January 2023

CCS811 VOC & CO2 Gas Sensor

Until just recently I was using analogue gas sensors, ( see previous post 16 January ). I have now turned my attention to digital gas sensors, from which the measurement data are already in digital form.
I am experimenting with the CCS811 sensor which has a I2C digital interface, ( 2-wire bus, clock and data only ). The CCS811 measures the concentration of CO2 ( carbon dioxide ) and TVOC ( total volatile organic compounds, which become a gas at room temperature ) in the air in ppm and ppb respectively which would be useful in giving an indication of air-quality in a closed workshop environment.
I connected an ESP32 micro-controller development board to the CCS811 circuit board and also to a I2C 128x64px blue OLED display in the corner of an already densely populated solderless breadboard.
( top-left) Mauve coloured CCS811 circuit board
The measurement results being displayed were obtained in my basement workshop. There is an established air-quality index called the 'TVOC Index' which is derived from the TVOC ppb concentration. Ppb between 0 & 220 corresponds to a TVOC Index of between 0 & 50 and an 'Index Category' of 'Good' air quality. I am pleased as I spend a lot of time in the basement.
 
I2C = Inter Integrated Circuit
ppm/ppb = parts per million/billion
  

16 January 2023

Multi Gas Detector

The 'MQ-' series of gas sensors comprises many different types, and each one is sensitive to one or more specific gases. They are analogue sensors meaning that a voltage is produced that varies with gas concentration. They are also cheap. I bought several MQ-135 and MQ-4 types for use in simple multi gas detectors.
The varying output voltage from the sensor was connected to a 12bit analogue to digital converter on an ESP32 micro-controller development board and the various gas concentrations in the air in the workshop were displayed in parts per million ( ppm ) on a 320x240px colour display.
The MQ-135 sensor is sensitive to the following gases: carbon dioxide, alcohol, carbon monoxide, toluene, ammonia & acetone.
The MQ-135 sensor is near the bottom-left corner
The MQ-4 sensor was used in another multi-gas detector to detect LPG, methane, carbon monoxide, alcohol & smoke.
LPG = Liquefied Petroleum Gas
 

06 January 2023

Touch Screen Displays

Nowadays it seems almost obligatory that electronic gadgets have a touch screen display user-interface.
The particular display type I have been trying out recently is a 2.8" 240x320 pixel TFT LCD 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.
The display and an ESP32 micro-controller development board, ( with my code uploaded to it ), were mounted on a prototyping board and connected up. The ESP32 micro-controller has two built-in sensors; a temperature sensor which measures the CPU temperature, and a Hall-Effect sensor which responds to magnetic fields. Either cpu temperature or magnetic field data can be displayed separately in real-time by tapping on a displayed 'button', which is then highlighted in green.
The CPU temperature measurement has been selected
Although both measurement values could easily have been displayed together, I now have my ready made code to import into future projects which really would benefit from a touch screen.
( SPI = Serial Peripheral Interface, 4-wire bus )

08 August 2022

Soil Moisture Meter - update

I recently discovered a supplier of 3D printed enclosures for TTGO LoRa32v2 microcontroller development boards, and bought a couple. I have used a red one to give a completely new appearance to the LoRa link indoor receiver module. These enclosures are also available in black and dark blue.
The slot (top) is for a supplied fixing clamp ( not shown )

Having also upgraded the firmware, I am now uploading moisture data both to the Ubidots cloud and, simultaneously, to Thingspeak (see a previous post) without the Node-RED server.
From my Ubidots dashboard I can remotely turn on/off a green LED ( see image above ).  This feature could be used instead to control a solenoid valve for an automatic watering system.
Part of my Ubidots dashboard for the 'Soil Moisture Meter'


 

19 September 2021

Soil Moisture Meter - real time data

I am posting here moisture readings in real-time using two of the widgets in my ThingSpeak channel; see 24 July. If the sensor, LoRa link and WiFi are all operational, an update is made automatically every hour when a moisture measurement is taken in the herb garden. Other changes I have implemented are two additional widgets in ThingSpeak to display LoRa link received signal level, and receiver module chip temperature. Also I have removed the previous dependency on Node-Red by modifying the firmware so that the receiver module sends measurement data directly to ThingSpeak. ThingSpeak Embedded Plot

24 July 2021

Sending soil moisture data to ThingSpeak

My post on 8 June mentioned how I am using Ubidots with the Soil Moisture Meter to save and display measurement data on the cloud.
ThingSpeak™ is another such platform and, like Ubidots, there is a function node available for it in Node-RED which I added to an existing flow, making sending data to ThingSpeak very easy. 
I created a ThingSpeak channel called 'Soil Moisture', to receive and display the data. I have opened the channel to the public. So anyone can view the data by visiting ThingSpeak , then 'Channels' from the navigation bar, search for User ID 'SpacerLabs', and open channel 'Soil Moisture'. I invite anyone to 'export recent data' or 'add a comment' ; a ThingSpeak account is required for the latter.

My ThingSpeak channel 'Soil Moisture' displaying moisture data
Each channel can have up to 8 fields in use to hold any kind of data related to the particular application. I am using only 'Field 1' and 'Field 2' at the moment to hold the moisture measurement numerical value, and packet number respectively.
There will be a break in the hourly updated data if I don't have Node-RED activated; also the situation when using Ubidots.
More 'SpacerLabs' channels and sensors could be added in future. 

06 July 2021

New development board for the soil moisture meter

I have been using TTGO LoRa32 V1 development boards for my soil moisture meter project based on a LoRa wireless data link, and posted images of them on 15 February and 16 March. I discovered that V2.1 boards are available. So I bought one for about $23 to compare.
TTGO LoRa board v2.1 - note the 16GB SD card
The LoRa chip is unchanged; still the same SX127x family ( newer chips do exist ), but now in a metal can. The screening could give it improved rejection of interference which can cause false data packets to be generated. I have solved this problem anyway in software by including a destination address in the packet header.
The antenna connects directly with a SMA connector on the board, so not requiring the use of the coax cable pigtail of V1 with its inherent signal attenuation. I am noticing at least a 10dB ( x10 ) improvement in received signal level with V2.1 when I use both V1 and V2.1 boards side by side. 
V2.1 has a micro SD card slot. While not very useful for my moisture meter which is connected to on-line services for data storage, it was fun to try out and does mean that I could save all soil moisture measurements even if I am not running my Node-RED server. I bought a 16GB card ( the smallest I could find ) which is enough capacity for the next 112 thousand years of soil moisture measurements !
Measurement & time-stamp saved every hour to file moisture.txt on SD card
The image above highlights two interesting features of the soil moisture meter. At the time it had been in continuous operation for 719 hours, and at night.
     

08 June 2021

Deploying the Remote Soil Moisture Meter

Since the posts on 15 February, 16 and 27 March I have completed the LoRa wireless based remote soil moisture meter and deployed it for use in a herb garden outdoors. To conclude and summarise this project, I have brought some of the previously posted information together with its new features in this post.
The remote module with the moisture sensor pushed into the soil transmits the moisture measurement every hour using a LoRa wireless data link. It is battery and solar powered. The moisture meter will not be required all year round. So the solar panel only has to keep the battery sufficiently charged for a few hours of operation each day during the summer. The solar panel is supported by a tablet stand fixed down with 'P' clips.
Remote module & solar panel deployed outdoors - notice the antenna
The LoRa link receiver module, located indoors, receives the measurement value and displays it on its OLED display. 
Remote module with antenna & sensor - inset top right the receiver module
If the receiver module is connected to a wifi LAN it can also send the measurement value to a web-page,  my dedicated Android app, and additionally publish the RSSI ( received signal strength indication ) and time on an MQTT broker* ( making the data accessible world-wide ! ). If I have my Node-RED local server up and running, the measurement value can also be sent by email, saved to a file, published on the HiveMQ MQTT broker*,
The various message types that are published on the MQTT broker*

and saved to the cloud database of the Ubidots data visualisation platform for presentation.
My custom dashboard for presentation of the moisture data on Ubidots
See the previous posts and some recent Tweets going back to 23rd March for details of MQTT, Node-RED, LoRa, the webpage server & Android app.
* Subscribe to the topics SpacerLabs/Status, SpacerLabs/Moisture & SpacerLabs/Moisture1
     

01 April 2021

Using Node-RED with the UV Radiation Meter

Continuing with the theme of Node-RED ( and MQTT ) from the last post ( 27.03.2021 ), I have also created a 'flow' for use with the UV Radiation Meter ( see 12.01.2021 ).
My Node-RED 'flow' for passing UV radiation data to the HiveMQ broker
The 'flow' ( see image above ) starts by periodically reading the UV Index which was measured by the meter, assigns the appropriate W.H.O. level, joins the data as a single message and publishes it to the topic "SpacerLabs/Uvindex" on the HiveMQ MQTT broker. But only if the index has changed.

My messages published to the topic SpacerLabs/Uvindex
Not surprisingly the status of the radiation meter was 'ONLINE' at the time the UV radiation measurements were being made in my backyard. When subscribing to a topic(s) the last message the broker has received from the publishing client, flagged as 'Retained', is displayed to confirm the connection straightaway, without the delay until the next message arrives. Quality of Service, QoS, ( 0, 1 or 2 with 2 being the highest ), is an important part of MQTT. QoS defines a level of guarantee of delivery of messages between broker and client. I selected QoS = 1.  

27 March 2021

Using Node-RED with the Soil Moisture Meter

Node-RED is a programming tool for event-driven applications. 'Flows' to connect inputs to outputs, hardware and online services via 'nodes' are created in a browser based editor in a similar way to 'MIT App Inventor' which I use for my Android apps. I thought of an application for Node-RED with my Soil Moisture Meter ( post 16.03.2021 ).
The events I wanted to handle were to trigger an email to be sent when the soil moisture level was low, save the moisture measurements to a text file and also publish them to an MQTT* broker. The image below shows how I 'wired' nodes together in Node-RED to achieve that.
My Node-RED flow - from input (blue) to outputs (mauve & light green)
Starting at the top left of the flow, every hour the most recent data packet containing the moisture value is read from the webpage ( /Moisturevalue ) hosted by the moisture meter receiver. Only if the text 'dry' or 'partched' is found in the packet string is an email sent. I have preset the body of the email to read "The SpacerLabs Soil Moisture Meter ( Sensor 1 ) has notified a 'low moisture level' alert".
My moisture meter data published on the HiveMQ broker
All packets ( unfiltered ) are published under the topic 'SpacerLabs/Moisture1' to an online MQTT broker. I chose the free public broker 'HiveMQ'. My topic is 'open'; so anyone can connect to www/hivemq.com/demos/websocket-client and subscribe to the above topic to read my hourly data packets under the messages tab. But only when my Node-RED server and the moisture meter are running. I also publish the status, ( ONLINE, OFFLINE or DISCONNECTED ), of the moisture meter to the separate topic 'SpacerLabs/Status'.
More information on Node-RED can be found at nodered.org.
* MQTT Message Queuing Telemetry Transport https://mqtt.org