Simple soil moisture and ambient temperature monitoring system that sends its data to a remote web server
Using the Espruino WIFI chip to log soil moisture and ambient temperature.
There are only 2 sensors in this project, both share the ground rail. The temperature sensor takes its power from the 3.3v rail, but the soil moisture sensor takes its power from the B9 pin which is turned on for one second before taking the reading and then turned off. This is to conserve the sensor as keeping it on corrodes the sensor.
With the rounded side facing away from left to right:
Note: You need to put the 4.7K resistor between pins 1 & 2 (data and power)
The server endpoint details and token details are in a “module”. This is to allow any configuration updates (WiFi, or endpoint) to not be tracked by git. The configuration file is modules/projectConfig.js. Be sure to plug in your own details into there before running.
I’ve included a PHP example server application that takes this post data and saves it into a file - overwriting the file each time new data arrives.
The Espruino code sends a standard POST with form data so any server side software that can read this response can be used. The post data key value pairs are:
To read the information back send a get request with the following parameters:
The sample Alexa app in the “alexa_app” folder of this repository is pretty simple, it just queries the example PHP application and speaks the output whilst then running a second query to the PHP application for the raw JSON information which is then displayed on a card in the Alexa mobile app.