Chapter 4
Design Methodology
4.1 Introduction
Any report's most important section is the project summary. Block diagrams, flowcharts, and circuit
diagrams will all be used to illustrate the design process for this project, along with succinct explanations
of their respective functions.
Block Diagram
In order to better understand this project, we created a block diagram. The following is the block diagram
for this project:
DISPLAY
Fig. 4.1.1 Block Diagram of the Project
The proposed diagram is shown here in Fig. 4.1. The system is made up of a total of four primary
elements: ESP32, Soil Moisture Sensor, NPK Sensor, Display, Power Unit.
In our project's block diagram, the system architecture revolves around four primary elements: the ESP32
microcontroller, Soil Moisture Sensor, NPK Sensor, Display, and the Power Unit. At the heart of the
system lies the ESP32 microcontroller, serving as the central processing unit responsible for orchestrating
the interactions between different components. It acts as the decision-making center, processing data
acquired from the sensors and executing algorithms tailored to monitor and manage soil conditions
effectively.
The Soil Moisture Sensor plays a crucial role in assessing the moisture content within the soil. Through
its electrodes, it measures the soil's resistance, providing real-time feedback on moisture levels. Similarly,
the NPK Sensor is integral for evaluating the soil's nutrient composition, measuring levels of nitrogen,
phosphorus, and potassium, essential for plant growth. Both sensors communicate their findings to the
ESP32, enabling comprehensive analysis and decision-making.
The Display unit serves as the interface between the system and the user, presenting analyzed data in a
visually comprehensible format. Whether through an LCD screen, the Display showcases vital
information such as soil moisture levels and nutrient content, empowering users to make informed
decisions regarding agricultural management.
Ensuring seamless operation, the Power Unit provides electrical power to all components of the system.
With its stable power supply and voltage regulation circuitry, it sustains the functionality of the ESP32,
sensors, and display, guaranteeing continuous monitoring and management of soil conditions.
Together, these elements form an interconnected ecosystem, where data flows from sensors to the ESP32
for processing, and then to the Display for user interaction, all powered by the reliable Power Unit. This
block diagram encapsulates the synergy between hardware components, illustrating their collective
endeavor to create an intelligent and efficient system for soil monitoring and management.
Flowchart
Start: The flowchart begins with the start point, indicating the initiation of the process.
Initialize ESP8266: The process starts by initializing the ESP8266 module, which is a Wi-Fi
module used for connecting the system to the Internet and IoT platforms.
Initialize NPK Sensor: Next, the flowchart initializes the NPK sensor, ensuring that it's ready to
measure the levels of nitrogen, phosphorus, and potassium in the soil.
Initialize Soil Moisture Sensor: Simultaneously, the flowchart initializes the soil moisture sensor,
preparing it to measure the moisture content in the soil.
Initialize Modbus Module: Additionally, the flowchart initializes the Modbus module, which is
responsible for communication between different devices and systems.
Read NPK Sensor Data: After initialization, the flowchart proceeds to read the data from the NPK
sensor, capturing the levels of nitrogen, phosphorus, and potassium in the soil.
Read Soil Moisture Sensor Data: Concurrently, the flowchart reads the data from the soil
moisture sensor, obtaining information about the moisture content in the soil.
Write Data to Display: Once the sensor data is obtained, the flowchart moves to the step where it
writes the data onto the display unit. This data could include NPK levels, soil moisture levels, or
any other relevant information.
Send Data to IoT Cloud: After displaying the data, the flowchart progresses to the step where it
sends the collected data to an IoT cloud platform. This allows for remote monitoring and analysis
of soil conditions.
Stop: Finally, the flowchart reaches the stop point, indicating the end of the process.
Fig. 4.1.2 Flowchart of the Project
In summary, the flowchart outlines the sequential steps involved in initializing sensors, reading data from
them, displaying the data, sending it to an IoT cloud platform, and ultimately concluding the process.
4.2 Circuit Diagram
In the course of working on this project, the Proteus software was used to construct the circuit diagram as
shown in Fig. 4.2.
Fig. 4.3 Circuit Diagram of the Project
In our circuit diagram, the ESP8266 microcontroller assumes the central role as the main
processing unit. This versatile microcontroller offers Wi-Fi capabilities, making it ideal for IoT
applications. The connection setup involves several key components. First, the ESP8266's SDA
(Serial Data) and SCL (Serial Clock) pins establish communication with the I2C (Inter-
Integrated Circuit) module, facilitating communication with devices such as the display unit.
Additionally, the ESP8266's TX (Transmit) and RX (Receive) pins interface with pins D6 and
D5, respectively, of the Modbus module. This connection enables bidirectional communication
between the ESP8266 and the Modbus module, crucial for data exchange and control.
Moving on to the peripherals, the Soil Moisture Sensor plays a pivotal role in monitoring soil
conditions. Its analog output, indicative of soil moisture levels, is connected to pin A0 of the
ESP8266. By interfacing directly with the microcontroller, the sensor provides real-time data on
soil moisture, enabling timely irrigation and plant care decisions. Furthermore, the Soil Moisture
Sensor requires a stable power supply for operation. Thus, its VCC (Voltage Common
Collector)zand GND (Ground) terminals are connected to the corresponding power and ground
pins of the power supply unit, ensuring consistent performance.
Another essential component in our circuit is the display unit, which enhances user interaction
and data visualization. The display unit is typically connected to the microcontroller via an I2C
module to minimize wiring complexity and facilitate easy communication. In our setup, the I2C
module's SDA and SCL pins are linked to the corresponding pins of the ESP8266, enabling
seamless data transfer between the microcontroller and the display unit. This connection allows
for the presentation of sensor data, system status, and other relevant information in a user-
friendly format, enhancing the overall user experience.
Lastly, the Modbus module serves as a communication interface between the ESP8266 and
external devices. Its SC (Signal Common), B-, and A+ terminals are connected to the
corresponding terminals of the NPK sensor, enabling data exchange. Additionally, the Modbus
module's TX and RX pins establish a serial communication link with the ESP8266, facilitating
the transmission and reception of data packets between the microcontroller and the Modbus
network.
In summary, our circuit diagram illustrates the intricate interconnection of components, each
serving a distinct yet complementary role in the functioning of the system. From sensor data
acquisition to display output and communication with external devices, every aspect is
meticulously integrated to create a robust and efficient IoT solution for soil monitoring and
management.