top of page

ESP8266 & ThingSpeak IoT Cloud: Empowering Smart Irrigation

Updated: May 16

The agricultural practices can be made efficient with the inclusion of smart irrigation systems. The moisture level in the soil is monitored and the plants are automatically irrigated according to the moisture level. Smart irrigation System reduces the chances of over-watering the soil and waterlogging in the fields. Thus water conservation is possible due to smart irrigation systems. In this project, you will learn to design a #smartirrigationsystem using ESP8266 Wi-Fi module and ThingSpeak IoT cloud.

Hardware Components - ESP8266 & ThingSpeak IoT Cloud |

1. Soil moisture sensor:

The soil moisture sensor estimates the volumetric water content in the soil. The sensor has two parts: the sensor probe and the electronic module. The sensor probe is a fork-shaped conductor and is placed in the soil. The sensor probe data is picked up by the electronic module which has an LM323 comparator that converts the analog output into digital output.| ESP8266 & ThingSpeak IoT Cloud |

Soil Moisture Sensor
Soil Moisture Sensor

2. ESP8266 Wi-Fi Module:

ESP8266 Wi-Fi module was produced by Espressif Systems. It has a full Transmission commission protocol and Internet protocol (TCP/IP) stack and enables any microcontroller to connect with the available Wi-Fi network. ESP8266 module operates in a wide temperature range and encompasses standard digital peripheral interfaces, power amplifiers, antenna switches, etc. This module has 17 GPIO pins, some of which are UART dedicated.

Circuit Diagram:

Circuit Diagram
Circuit Diagram

  1. Connect the Vcc pin of the sensor module to the D0 of the ESP8266.

  2. Connect the ground pin of the sensor module to the ground of the ESP8266.

  3. Connect the analog pin(A0) of the sensor module to A0 of the ESP8266.

Moisture Sensor Calibration:

Different soil types have varying moisture-holding capacities. Hence, it is recommended to calibrate the soil moisture sensor for the specific type of soil that you want to monitor.

ThingSpeak Channel Setup: -> Create an Account -> Channels -> My Channels -> New Channel-> Provide a channel name, a description for the channel and a field label -> Save Channel.

Smart Irrigation System Code:


Calibrate the moisture sensor by placing the sensor probe in extreme soil conditions for your soil. The sensor probes are made of conductors that act as variable resistors. The resistance of these conductors is inversely proportional to the moisture level of the soil. An output voltage obtained from the sensor following the resistance is processed by the code and the status of the soil is determined. The soil status is obtained on the serial monitor as well as on the ThingSpeak channel.

Circuit for the Smart irrigation system
Circuit for the Smart irrigation system

Video by- Rishita Nagpal

Written by-

Name- Nagashree R Nadig

See also-

Follow us -

Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes, and contests.

Want us to help you with the projects, write your inquiry here - Order Projects

Check out our Free Arduino Projects Playlist - Arduino Projects

Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects

Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects

Check out our Free IoT Projects Playlist - IoT Projects

Check out our Free Home Automation Projects Playlist - Home Automation Projects

Check out our Free NodeMCu Projects Playlist - NodeMCu Projects

1,444 views2 comments

Related Posts

See All


Informative and concise! LearnElectronics India always delivers quality content.


Anushka Gupta
Anushka Gupta
Jul 19, 2023

I stumbled upon this blog while searching for information on ESP8266 and ThingSpeak, and I must say it exceeded my expectations. The author did a fantastic job of explaining how these technologies can revolutionize smart irrigation. The examples and diagrams used were incredibly helpful in visualizing the concepts. Kudos to Learn Electronics India for providing such valuable content.

bottom of page