Soil Moisture Sensor Automation Project

I wanted to test out some sensors to see if I can do some automation with growing plants. I found this tutorial IoT Soil Moisture Monitor with Raspberry Pi Pico W & Blynk

One of the automation’s was receiving data on soil moisture, and I wanted to be able to receive this information via wifi either as a Smart Home setup or remotely outside the house, so remote viewing. When you have the information you can then look at another automation to take action (if required) to add more water to the plant with a pump of some description.

failed to load image

Project Setup

I used the setup shown for the project , apart from using a different Soil Moisture Sensor (bought from Jaycar in Wellington $$NZ- Could collect quickly for the project). The probe is cheap and will easily corrode, there are better ones online that I can get, but the delivery will be slow.

I used a Raspberry Pi Pico W with Hat so I could use the breadboard, andf used Thonney for coding python after flashing the Raspberry Pi Pico W with the pico/python setup file

I followed the process for setting up Blynk and with the dashboard:

I did want to show steaming numbers but that is for paid Blynk accounts, so tried to use chart instead- The image above is from Blynk dashboard but the device is offline at the moment.

There is also a Blynk mobile app and I started to setup the same dashboard as I had on the browser. Below a screenshot showing Guage only on mobile phone that has wifi turned off and is using mobile data only.

failed to load image

Calibration

The data I got out was junk, as all the readings were over 100% (inferring that the soil was saturated, and even when I took the probe out it still showed readings over 100%.

It does have Calibration settings for Max & Min and I need to adjust these so that it calibrates well. I just need to find a method for getting solid settings for calibration. I was thinking of using a different probe to do this, maybe a cheap rod probe from Bunnings.

This video seems a good way to look at calibration:

I was looking at using a different sensor, the same as in the main project, and came across this video about unreliability of these Capasitive Soil sensors and what to look out for:

Sensor information sent to remote place

Although the calibration and results were poor, from the point of connecting the Raspberry Pi Pico W to wifi and then to blynk to have the information displayed remotely was a success.

I think Blynk is using the MQTT protocol so this is a PUBLISH result. So only part of story, I need to try another project to do a SUBSCRIBE result where I can send a command of some description to the Raspberry Pi Pico W for it to act on -eg turning the sensor on/off.

Possible development of project

I did look at some wifi enabled soil sensors, a pack of 5 with wifi hub cost about 180$NZ. So each probe about 36$NZ. This only connects to local Wifi so I’m not how you could monitor them outside of the wifi network.

I looked at the pricing for this setup and it would be as follows

  • I looked online for other probes, and there are ones for about 2$NZ
  • Raspberry Pi Pico W in NZ about $12
  • I would need some sort of Power supply- assume battery for about $4
  • ancillary wiring/soldering etc & casing for Raspberry Pi Pico W in a humid environment (eg polythene ziplock bag) , say 2$NZ
  • Then total sum for components would add up to around 18-20$NZ and would individually connect to the wifi & can be monitored remotely from off-site

End comment

Although I got garbage out the project was a partial success allowing me to work with an instance of Blynk for Publishing information.

This is the 2nd MQTT provider that I’ve tried, the other being Adafruit.io and there is also another HiveQT that I have yet to try.

The Raspberry Pi Pico W is a cheap wifi connected device and will work well in this scenario, so in a greenhouse with lots of plants this could be a good way of monitoring soil moisture content all around the greenhouse, as long as I can get the calibration right first.

The price difference from online probes connected to only wifi to homebuilt probes that can connect to offsite remote locations makes this a viable option. There would need to be factored in the cost of the MQTT service, which will vary as per use case.