Skip to main content
Vote to win❗
Follow Us
Do you like it❓

Agriculture System

 

Imagine you are a farmer. You have many tasks to do especially ensuring that your plants are watered properly. However, the amount of water required varies by the temperature and humidity. Thus, the best way to resolve this would be to measure both these parameters and automatically open a water pump if they reach certain values. In addition, since this will be used at a farm in a rural area, power supply may be limited, so the system should have low power consumption as well.

Introduction

The Agriculture System is a combination of hardware and software components. The hardware component contains embedded systems (ESP32), while the software is developed by using the Arduino IDE and Node-RED. DHT11 model temperature and humidity sensors are employed.

 

 

The information gathered by the sensors is forwarded to the ESP32. The acquired data are then
uploaded via Wi-Fi to Node-RED and may be shown in a web page, which allows users keep up
with the newest weather change.

 

ESP-32 Circuit

As this system has the specific purpose of measuring temperature and humidity, the ESP-32 microcontroller unit is used. Some advantages of ESP-32 over other microcontroller models include its low power consumption as well as its ability to connect to Wi-Fi networks without needing external modules, like in the Arduino microcontrollers. As a result, the complete circuit is not only power-saving, but also space-saving, both of which adhere to the concept of Sustainable Technology.

 

 

 

From Figure 3, this circuit uses only a few components, including the DHT11 sensor. As this project is a prototype, the output water pump system is represented by an SG90 servo motor. In addition, a simple LED circuit is used to signify if there is output driven to the Servo. This schematic can then be transferred to a breadboard for testing, as shown in Figure 4. Breadboards are commonly used in testing circuits due to their many slots allowing components to be connected in various ways. Furthermore, components inserted onto a breadboard can still be removed, which contrasts with a Printed Circuit Board (PCB) in which the components cannot be removed. Figure 4 shows the connection of the circuit for the system. DHT11 sensor is connected to the digital pin 23 and a LED and resistor is connected to the digital pin 32. A servo motor is connected to the digital pin 5. As this project is a prototype, the design was not  transferred to a PCB.

 

 

Arduino Code

All the code shown below was written using the Arduino IDE. Some of the reasons we used this IDE is the easy management and usage of external libraries as well as a user-friendly interface.

 

 

From Figure 5, The first few lines import the DHT and Servo libraries that are to be used. Next, several important variables are declared. The DHT and Servo components are also declared so that the commands that come with the libraries can be used later. Finally, under void setup several things are initialized, such as the DHT, Servo and the ESP-32 pin that connects to the LED. All the above code are used to ‘start up’ something, thus the code only needs to be run once when the ESP-32 is powered on.

 

 

From Figure 6, all the code in this portion is enclosed under void loop, which denotes that this code will be run repeatedly. Some of the code is also enclosed in an infinite while(1) loop to ensure continuous data collection. Apart from that, the while loop contains several if statements which turn the servo in opposite directions, depending on the message received from the Node-RED flow.

 

Node-RED

In this system, Node-RED is used to serve as our online platform to communicate with the system. Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click. We could develop our own online system by using our browser and Node-RED. Also, we were able to develop a dashboard to control the system by just using any devices.

 

 

A palette provided in Node-RED named node-red-node-serialport, which allows us to communicate with our hardware through serial port. In this system, we used serial port – com4 as our platform to communicate by sending or reading the message from the serial port. As we can observe from the figure above, COM4 showed connected when the hardware (ESP32) is plugged into port.

In this system, the reading of the sensor will be sent to Node-RED through serial port COM4 then we have three nodes to display the data we want.

From Figure 8 the blue note with label Reading will display the string message received from the ESP32 in the dashboard. While for the Function note for temperature and humidity, we create a special function to extract the data we needed respectively which is temperature and humidity reading from a string message.

 

 

In this system, two buttons are provided in the dashboard to control the servo motor. When the button is pressed, a specific instruction which is a string type message will send to ESP32 through the serial port.

 

 

Figure 12 above shows the final look of the dashboard. The gauge meter will keep changing based on the reading obtained from the sensor, and the user can monitor through the dashboard and control the status of the servo motor to open the water pump.


About IEEE-HKN Mu Alpha Chapter UCSI University

IEEE-Eta Kappa Nu (IEEE - HKN) is the honor society of the Institute of Electrical and Electronics Engineers (IEEE). The UCSI University chapter, Mu Apha, is the third IEEE - HKN chapter in the Asia Pacific region, after Hong Kong University and the National University of Singapore. As the student honour society of IEEE, IEEE-HKN is committed to encouraging and recognising excellence in the IEEE-designated fields of interest

 

 

About UCSI University IET On Campus

We are the IET and we inspire, inform and influence the global engineering community to engineer a better world. As a diverse home across engineering and technology, we share knowledge that helps make better sense of the world in order to solve the challenges that matter. It’s why we are uniquely placed to champion engineering.

Their Members

This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.