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 🔘