In this video you can see an IoT soil moisture sensor built around the ESP8266 SoC and a soil moisture sensor with an analog output. Tho the device is small enough to fit inside any pot, to reduce the size further, one could use an ESP module like this instead of the devboard.
Server’s architecture is based on both HTTP and WebSocket protocols in order to ensure data flow to both directions. The idea behind it, is really simple; ESP sends POST request once an hour with a key – value (hour number – sensor value) in order to keep data up-to-date and thus informing us about the soil moisture. The server, after updating the DB, uses WebSocket to push the data to the clients in interest. Such an operation would be extremely tricky to achieve via the standard HTTP protocol.
To visualize the data at browser side I have used chart.js which is easy to handle and looks rad! Furthermore, I decided to dynamically change the value of CSS filter according to the data received, in order to reflect the plant’s drainage. To enhance user experience I have also developed an android app, where I’ ve used MPandroidChart.
Check live demo
Link to github