ESP32

Moisture Meter for Plants using SIM7600G-H 4G LTE, ESP32, and Blynk, IoT Project

Moisture Meter for Plants:

Moisture Meter for Plants using SIM7600G-H 4G LTE, ESP32, and Blynk, IoT Project- In today’s article, you will learn how to make an IoT based Soil Moisture Meter for Plants using a capacitive soil moisture sensor, SIM7600G-H 4G LTE Module, ESP32 WiFi + Bluetooth Module, a Relay module, and Blynk application.

If you have read my previous two articles on the SIM7600G-H then I am sure you guys would already have an idea of how powerful the Lilygo T-SIM7600G-H 4G LTE GSM module is.

SIM7600G-H Getting Started article

allpcb circuit

SIM7600G-H based GPS tracking System

Because, in previous videos and articles, I practically demonstrated how to control 220Vac bulbs and how to generate feedback messages each time a bulb is turned ON or turned OFF. Along with this, I also monitored a sensor “a potentiometer” through a text message via a simple request command.




After that, I used the SIM7600G-H 4G LTE module as a Car GPS Tracker. I would simply send a text message with the location command, and then the ESP32 would send me a Google Maps URL link using the SIM7600G-H module, including the longitude and latitude values. By clicking on the Google Maps link, I was able to track the location of my car.

Moisture Meter for Plants

The GPS is very accurate, and the interesting thing is that it can connect with GPS satellites even from inside a room. So far, I am fully satisfied with all the tests I have conducted on this module.

As you know SIM7600G-H is a 4G LTE module. So, using this module you can provide internet connectivity to the ESP32 module and this way you can remotely monitor your sensors and control your electrical loads in real-time from anywhere in the world and this is what we are going to cover in this article.

Moisture Meter for Plants

For the practical demonstration, I have made this Soil Moisture Meter for Plants using the Capacitive Soil Moisture Sensor, SIM7600G-H 4G LTE Module, ESP32 WiFi + Bluetooth, this IoT development board already has an ESP32, one-channel relay module, and Blynk application.

You can power up this project using a solar panel, you can also use a lithium Ion Battery exactly the same way as demonstrated in my Car GPS Tracking system. You can also use a 5V power supply just like me; I used my designed 5V and 3A power supply.

Anyway, for the initial experiments, you can also your laptop to power up this entire project.



Product Links:

 

Product Source Source
LILYGO® SIM7600G-H Official product page
SIM7600G-H Amazon AliExpress
Capacitive Soil Moisture Sensor Amazon AliExpress
5V SPDT relay Amazon AliExpress
5V Solid-State Relay Amazon AliExpress

*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.

Capacitive Soil Moisture Sensor:

The Capacitive Soil Moisture Sensor Module determines the amount of soil moisture by measuring changes in capacitance to determine the water content of soil.  This can be used in an automatic plant watering system or to signal an alert of some type when a plant needs watering.

Moisture Meter for Plants



KEY FEATURES OF CAPACITIVE SOIL MOISTURE SENSOR MODULE:

  • Analog output of moisture content
  • More corrosion resistant than resistive type of sensor
  • 3 or 5V operation.  Low power so may be driven from digital pin on MCU

This soil moisture sensor module uses capacitance rather than resistance to determine the water content of soil.  The main down-side to the common fork type resistance sensor is that the probes inserted into the soil must be conductive bare metal and the small electrical current that flows between them results in corrosion of the probes through electrolysis over time.

The capacitive probe improves that situation because the sensor metal inserted into the soil can be covered in solder resist to minimize corrosion and electrical current is not flowing through the soil to induce electrolysis.  The main weakness in the lifespan of the probe is the uncoated cut sides of the PCB which can absorb moisture over time as well as the exposed electronics at the top of the probe if they get splashed by water.  The customer can add further protective coating such as clear fingernail polish or similar coating if desired without seriously affecting the performance of the probe.

Theory of Operation

The module uses a TL555I CMOS timer to create a 1.5MHz clock.  The TL555I is similar to the ubiquitous NE555 but is newer CMOS technology with a higher frequency capability and other improvements.

A peak voltage detector converts the waveform from the TL555I into a DC voltage that can be read by the ADC input of a microcontroller.

When the probe is exposed to moisture, it affects the capacitance of the circuit which in turn affects the peak amplitude of the signal and therefore the DC voltage output that is being monitored by the MCU.  Higher moisture = lower DC voltage output.



Moisture Meter for Plants Wiring:

Moisture Meter for Plants

The wiring is very simple. Connect the VCC and GND wires of the Capacitive Soil Moisture sensor to the ESP32 3.3V and GND pins. Connect the output signal wire to the ESP32 GPIO 15.

Connect the VCC and GND of the 5V Relay module to the vBus and GND. Connect the relay input to the ESP32 GPIO 12.

The SIM7600G-H 4G LTE module and the ESP32 WiFi + Bluetooth Module are already wired up for you. I have explained this in the getting started video and article.

if you want to make your own 5V and 3A power supply then you can read my article on the 5V and 3A power supply. Now, let’s start with the Blynk Web Dashboard setup.

Blynk Web Dashboard Setup:

  • While you are logged-in into your Blynk account.
  • Click on the New Template.
  • Write the Template Name.
  • While ESP32 is selected as the Hardware type.
  • Select the connection type as GSM.

Moisture Meter for Plants

After this, all the steps are exactly the same. The only difference this time is that we selected GSM instead of WiFi in the connection type. Anyway, next click on the Datastreams.

Moisture Meter for Plants

Then click on the New Datastream and select the Virtual Pin

Moisture Meter for Plants




Then enter the required credentials and click on the create button.

Moisture Meter for Plants

Then again click on the New Datastream

Moisture Meter for Plants

Then enter the required credentials for relay virtual pin

Moisture Meter for Plants

Then click on the web dashboard and double click on the switch to add it in the dashboard

Moisture Meter for Plants

Click on the switch setting and in the Datastream select the Relay and click on the save button

Moisture Meter for Plants

Double click on the gauge it will be added on the web dashboard and click on the setting

Moisture Meter for Plants



Now select the soil moisture and click on the save button

Moisture Meter for Plants

The switch and gauge are added to the Web Dashboard

Moisture Meter for Plants

Now click on the devices

Moisture Meter for Plants

Now click on new device and click on From template

Moisture Meter for Plants

Now select the template “Soil Moisture Monitoring”

Moisture Meter for Plants

After selecting the template click on the create button

Moisture Meter for Plants

Then copy the credentials

Moisture Meter for Plants

Paste these credentials in the code

Moisture Meter for Plants



Moisture Meter for Plants, ESP32 Programming:

Don’t forget to change the GPRS Credentials.



If this is your first time using the ESP32 WiFi + Bluetooth module then you will also need to install the ESP32 board in the Arduino IDE. For this, you can read my Getting Started article on the ESP32 WiFi + Bluetooth Module.

Next, you will also need to install the entire Blynk library package. For this simply go to the Sketch Menu, then to Include Library, and click on the Manage Libraries. Type Blynk in the search box.

Moisture Meter for Plants

You can see I have also installed this library. It works with over 400 boards.  Finally, you can upload the program, in my case I have already uploaded this program. Next, you can start with the Blynk IoT Application setup on your smartphone.




Blynk IoT App setup on Smartphone:

Open the blynk App on your smartphone and click on the soil moisture monitoring.

Moisture Meter for Plants

Then click on the setting button to enter to the developer mode

Moisture Meter for Plants

Now, simply add the widgets and assign the virtual variables or datastreams we created.

Moisture Meter for Plants

If you face any issues then you can watch video tutorial given at the end of this article.

Moisture Meter for Plants

Anyway, our application is also ready, now let’s start the practical demonstration.



Moisture Meter for Plants, Demonstration:

Moisture Meter for Plants

I have powered up the project using a 12V adaptor. I have connected this 12V adaptor to a 5V and 3A power supply which is then connected through a USB Type C cable to the ESP32 IoT development board. “I highly recommend, you should watch the video for practical demonstration”.

Right now, you can see it’s connected to the GSM network. In my area, the 4G network is fully functional; so, as soon as I power up this project, the SIM7600G-H immediately connects to the network. However, if the 4G network weren’t functional in my area, I could still use it because it’s also fully compatible with 3G and 2G networks.

For now, I have not connected any load to the relay, however, as you can see, there’s an LED that will turn ON or OFF when the relay is activated or deactivated. This relay can be used to control a water pump or any other device.

My Blynk application is also connected to the Internet. So, let’s add some water.

Moisture Meter for Plants

I can monitor the soil moisture in real-time, by the way, how much soil moisture should be maintained for which plants; I have already explained this in my previous soil moisture monitoring projects. So, with this soil moisture meter, now I can monitor the soil moisture and control the water pump from any part of the world. So, that’s all for you.



Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button