Output 5
Output 5
REPORT
COMPUTER ENGINEERING PROJECT
We, the members of the implementation group, under the guidance of Dr.Le Trong
Nhan, hereby declare that:
• The Computer Engineering Project is a serious and honest scientific research work
of our team.
• All content presented in this Computer Engineering Project is our own work, except
for the parts stated in the footnotes, clearly citing sources in the reference section.
We take full responsibility if there is any fraud in the content of the group’s Project.
Implementation group
Nguyen Thai Thanh Binh
Le Gia Huy
Le Thanh Tuan
ACKNOWLEDGEMENT
Under the scientific direction of Dr. Le Trong Nhan of the Faculty of Computer Science
and Engineering, University of Science and Technology - Vietnam National University, Ho
Chi Minh City, the computer engineering-focused project was finished. The implementa-
tion team would like to express their profound gratitude to Dr. Le Trong Nhan for his
professional assistance, discussions, recommendations, and creation of favorable conditions
that allowed us to finish the project.
We also want to express our gratitude to the reviewers, who reviewed our work and
offered suggestions that enabled us to finish this specific project.
The implementation team would also like to express their deep gratitude to the teach-
ers of the Department of Computer Science and Engineering, University of Science and
Technology - Vietnam National University, Ho Chi Minh City, who have imparted spe-
cialized knowledge subject, has created conditions for us to study and develop during the
past time.
We wish all teachers good health, success and continued training of new generations
of students in the future.
We sincerely thank you.
Implementation group
Nguyen Thai Thanh Binh
Le Gia Huy
Le Thanh Tuan
ABSTRACT
A new era of precision agriculture has been ushered in by the merging of traditional
farming methods with technology in the modern agricultural environment. Among the
most significant developments in this field is the creation of Wireless Sensor Networks
(WSNs) specifically designed for agricultural applications. This innovative technology has
the potential to completely transform agricultural practices, maximize resource efficiency,
and reduce environmental impact.
This project at the nexus of technology and agriculture has the potential to completely
transform farming in the future and bring in a new age where efficiency and precision work
together to fulfill the demands of a growing global population.
In the current agricultural system architecture, the irrigation control system has been
implemented with the CM4 embedded computer. The system needs further develop-
ment to integrate sensors to measure information about the growing environment, related
to the soil and surrounding air environment. To be able to deploy a sensor measurement
system, it needs to be optimized in terms of connectivity. In this project, each sensor node
will act as a child node of the central control cabinet, and communicate wirelessly with
the central control cabinet. Sensor data will be synchronized and displayed in the central
cabinet (also known as IoT Gateway). This data will then be sent to the cloud for remote
monitoring.
Throughout phase 1, the goals set for the Computer Engineering project have
been mostly completed. The basic knowledge and system have initially been built on the
operating machine cluster.
In phase 2 - Capstone project, we will integrate the system and synchronize data
with the central cabinet. Some smart features related to data monitoring or sensor main-
tenance warnings can be proposed and integrated in the system. Then, apply the practical
problem with the data set from the server and test and evaluate the practicality of the
solution.
Contents
INTRODUCTION 0
1.1 Rationale of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0
1.1.1 Effects of Agriculture on the Industrial Revolution . . . . . . . . . 0
1.1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.3 Internet of Things (IoT) . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.4 MQTTBroker in Agriculture: Facilitating Intelligent Communication 3
1.2 Objectives of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Clarifying basic knowledge and some technologies . . . . . . . . . . 4
1.2.2 Implementing the satellite station system . . . . . . . . . . . . . . . 4
1.2.3 Evaluate and test system performance . . . . . . . . . . . . . . . . 5
1.3 Scope of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Structure of the Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
LITERATURE REVIEW 8
2.1 Overview of Agricultural System . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.1 Agricultural System Definition . . . . . . . . . . . . . . . . . . . . . 8
2.1.2 Smart Agricultural Systems: Components and their roles . . . . . . 9
2.2 Overview of Wired Sensor Networks . . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Definition of Wired Sensor Networks . . . . . . . . . . . . . . . . . 10
2.2.2 Advantages and Disadvantages of Wired Sensor Networks . . . . . . 10
2.2.3 Application of Wired Sensor Networks . . . . . . . . . . . . . . . . 11
2.2.4 Wired Sensor Networks protocol . . . . . . . . . . . . . . . . . . . . 13
2.3 Overview of Wireless Sensor Networks . . . . . . . . . . . . . . . . . . . . 14
2.3.1 Definition of Wireless Sensor Networks . . . . . . . . . . . . . . . . 14
2.3.2 Advantages and Disadvantages of Wireless Sensor Networks . . . . 16
2.3.3 Application of Wireless Sensor Networks . . . . . . . . . . . . . . . 17
2.3.4 Wireless Sensor Networks Protocol . . . . . . . . . . . . . . . . . . 19
2.4 ESP-NOW: The optimal choice for smart agriculture systems . . . . . . . . 21
2.4.1 ESP-NOW: Definition . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4.2 ESP-NOW: Data Frame Format . . . . . . . . . . . . . . . . . . . . 22
2.4.3 The reasons why ESP-NOW is the best choice for this project . . . 25
REFERENCES 64
List of Figures
1 Map of Agritech Technologies. . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Wired Sensor Networks Applications in Environment, Entertainment, In-
dustrial and Agriculture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Wireless Sensor Networks including 3 main module: Sensor Node, Base
Station (also known as IoT Gateway) and Communication module. . . . . 14
4 WSNs applications in Environment, Healthcare, Industrial and Agriculture 17
5 ESP-NOW: Data transmission without a central hub . . . . . . . . . . . . 22
6 OSI model: A standard framework for data communication . . . . . . . . . 23
7 The advantages of ESP-NOW over the OSI model . . . . . . . . . . . . . . 24
8 System architecture with five interchangeable parts. . . . . . . . . . . . . . 28
9 System implementation including Sensor Nodes, IoT Gateway and Server. . 30
10 Sensor Node Architecture including 4 main unit:Power unit, Sensing unit,
Processing unit and Communication unit . . . . . . . . . . . . . . . . . . . 31
11 Soil Sensor Device is capable of reading 7 parameters: Temperature, Hu-
midity, Electrical conductivity, pH, Nitrogen, Phosphorus, Potassium . . . 33
12 Air Sensor Device is capable of reading 7 parameters: Temperature, Hu-
midity, Noise, PM2.5, PM10, Atmospheric pressure and Luminosity . . . . 35
13 Water Sensor Device is capable of reading 5 parameters: Temperature, PH,
Electrical conductivity, ORP (Oxygen Reduction Potential) and Salinity . 36
14 M5 Atom Lite Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
15 M5 Atom Lite Schematic Diagram . . . . . . . . . . . . . . . . . . . . . . . 37
16 M5 Atom Lite PinMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
17 ATOMIC RS485 Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
18 ATOM RS485 Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
19 Flow-chart of Sensor Node . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
20 Gateway-server Communication . . . . . . . . . . . . . . . . . . . . . . . . 43
21 MQTT Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
22 Nestjs Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
23 The Raspberry Pi Compute Module 4 . . . . . . . . . . . . . . . . . . . . . 46
24 The implementation of IoT Gatway . . . . . . . . . . . . . . . . . . . . . . 47
25 Firebase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
26 MongoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
27 DynamoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
28 Supabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
29 Data relationship . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
30 Nodes table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
31 Sensors table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
32 Sensors output table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
33 Some applications for the python programming language. . . . . . . . . . . 53
34 The Implementation of IoT Gateway to Application. . . . . . . . . . . . . 54
35 Display air sensors node and chart for data retrieval. . . . . . . . . . . . . 56
36 Response time distribution from IoT Gateway to Sensor Node at a distance
of 5m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
37 Pareto Chart of time response from IoT Gateway to Sensor Node at a
distance of 5m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
38 Response time distribution from IoT Gateway to Sensor Node at a distance
of 170m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
39 Pareto Chart of time response from IoT Gateway to Sensor Node at a
distance of 170m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
40 Response time distribution from IoT Gateway to Sensor Node at a distance
of 200m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
41 Pareto Chart of time response from IoT Gateway to Sensor Node at a
distance of 200m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
List of Tables
1 Comparison of Sensor Node and Actuator Node . . . . . . . . . . . . . . . 15
2 Comparison of Wireless Sensor Network Protocols: Zigbee, LoRaWAN,
BLE, Wi-Fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Communication Basic Parameters . . . . . . . . . . . . . . . . . . . . . . . 33
4 Register address for soil parameters . . . . . . . . . . . . . . . . . . . . . . 34
5 Register address for air parameters . . . . . . . . . . . . . . . . . . . . . . 35
6 Register address for water parameters . . . . . . . . . . . . . . . . . . . . . 36
List of abbreviations
CHAPTER 1
INTRODUCTION
The content of chapter 1 briefly presents the topic, the current context and clarifies
the reason the topic was chosen. From there, determine the goals to be achieved when
implementing and the scope of the project.
the age of Precision Agriculture, or Agriculture 3.0. The use of sensors, GPS, and
data analytics became crucial for enhancing farm management techniques and max-
imizing resource use. This stage attempted to reduce the negative effects on the
environment, increase crop productivity, and bring data-driven decision-making to
the agricultural industry.
The World Government Summit in their report entitled "Agriculture 4.0 – The future
of farming technology" looks at three main trends that define agritech: new techniques,
increasing efficiencies and the use of cross-industry technologies.
Out of the different pillars, Tech is perhaps the easiest to grasp and in many ways is
the primary element that enables the newer techniques and helps farms develop efficien-
cies. From the technologies: Internet of Things and Data Analytics are two of the most
established.
A new age of efficiency and connection has been brought about by the Internet of
Things (IoT) across a number of industries, with agriculture being one of the more no-
table ones. Applications for the Internet of Things (IoT), a network of linked sensors and
gadgets that exchange data and interact online, are particularly interesting for the agri-
culture industry. The incorporation of IoT technology into farming methods is converting
conventional agriculture into an intelligent and data-driven field, providing a number of
advantages that tackle the intricacies of contemporary agricultural problems.
Benefits of IoT application in agriculture
• Precision Farming
• Resource Optimization
• Livestock Management
• Weather Monitoring
• Data-Driven Decision-Making
Due of the many benefits of IoT technology, the majority of individuals in the 5.0 Indus-
trial Revolition utilize it for agriculture.
• First, clarify the basic knowledge and some technologies about Internet of Thing ap-
plications in agriculture, read information from sensors and wireless communication
protocols.
• Third, clarify the synchronization of sensor data with the IoT Gateway and auto-
matically identify wireless sensor devices
During the Computer Engineering Project phase, the team works towards the first two of
the presented goals. The remaining two goals will be realized during the Capstone Project
phase.
To be able to design and deploy a satellite station system, the topic requires basic
knowledge around the core of the intended architecture such as:
This article will offer a method to IoT technology that simplifies the architecture for
gathering and organizing data over a vast region of land, both to install and use:
In order to fully assess the satellite station system’s performance, scenarios based on
each step must be planned:
• Test the solar panels’ capacity to store energy and their running duration.
• Test the signal transmission between the sensor cabinets and the IoT Gateway.
The scenarios will mostly center on obstacles to external influences, such as:
• Lack of sunshine.
• Capability to retain data across sensor cabinets in the event of a loss of connection
to the IoT Gateway.
• The server is receiving a large volume of data at a fast rate that is continuous and
parallel to demand. Analysis of users in real time.
• Test the system’s capacity to handle a huge amount of data transmitted to the
server by increasing the number of sensor cabinets for big tracts of land..
Regarding the target field, the topic focuses on researching and solving problems related
to wireless transmission, when the Internet is lost or there are problems related to energy.
• Chapter 1: Introduction.
Briefly present the context, challenges and practical problems, and provide goals
and scope of solution
• Chapter 5: Conclusion.
Present system assessments and determine plans for the Capstone Project phase.
1.5 Conclusion
As a result, enterprises are struggling to simultaneously address the demands for data
storage and connection distance. This issue can be resolved with servers and wireless con-
nections thanks to modern technologies. Nevertheless, there will be several issues with
infrastructure, data synchronization, energy consumption, and operations when two sys-
tems run simultaneously. On the other hand, if there is a problem, it will be hard to
transfer data to the server due to the weakness in each architecture’s power and connec-
tion. As a result, incorporating a local wireless sensor into the circuit that receives data
from the sensor and utilizing mutual connection without a network’s assistance is a crucial
component, appropriate for the given issue.
Extending the architecture to handle the requirement for system integration over a
sizable amount of land for agriculture is one of the project’s primary objectives. The
topic’s focus is on problems with sensors and wireless networks, as well as data that is
uploaded to the server and can react to power or network disruptions.
CHAPTER 2
LITERATURE REVIEW
The ideas and theoretical underpinnings of data retrieval, tasks, and generic struc-
tures and designs are covered in Chapter 2. Subsequently, examine workable technical
alternatives to select workable approaches for sensor cabinet and satellite cabinet design
in agricultural.
Agricultural systems can be described in many ways. Over the years, researchers and
farmers have used a variety of terms, such as farming system, cropping system, organic,
and ecological, to identify agricultural systems based on specific characteristics or defini-
tions. However, in general, an agricultural system is an assemblage of components united
by interaction and interdependence, operating within a prescribed boundary to achieve a
specified agricultural objective on behalf of the beneficiaries of the system. Agricultural
systems face several challenges, including the need for energy-efficient hardware and soft-
ware protocols, robust security and privacy measures, and the ability to scale the network
to accommodate a large number of nodes.
• Control system: manage sensor input, delivering remote information for supply
and decision support, in addition to the automation of machines and equipment for
various agricultural tasks.
• Automation system: are responsible for the remote activation of multiple pro-
cesses simultaneously, enhancing product quality and volume by better controlling
production processes.
• Information system: such as software platforms and data analytics tools, help
farmers make data-driven decisions based on the collected data from sensors and
other sources.
• Sensor system: collect valuable data on factors such as soil moisture, tempera-
ture, light, and humidity, helping farmers make informed decisions about irrigation,
fertilization, and crop rotation. Sensor systems today are implemented in two main
types: Wired Sensor Networks and Wireless Sensor Networks.
These components work together to create a more efficient, sustainable, and productive
agricultural environment. By collecting and analyzing data from various sensors, farmers
can make data-driven decisions to optimize crop growth, reduce resource consumption,
and minimize environmental impacts.
Wired Sensor Networks are a type of sensor network in which individual sensors are
physically connected to each other and to a central control system via cables, wires, or
other fixed communication channels. These sensors are often used in new construction or
renovation projects where infrastructure is already available. They provide a stable and
reliable connection, ensuring continuous data transmission without interference, signal
loss, or interruptions. Wired sensors can transmit large amounts of data over a wired
network, providing high data transfer speeds and a source of real-time analysis data
with low latency. They are suitable for organizations with fixed locations or large-scale
operations that require large amounts of data. Wired sensors are known for their accurate
and reliable data transmission, making them ideal for applications where data security
and reliability are top priorities.
• Stable and reliable connection: Wired sensors provide a stable and reliable
connection, ensuring consistent data transmission without interference, signal loss,
or interruption
• Accurate data transmission: Wired sensors provide precise and accurate data
transmission because they are not subject to weather conditions or physical obstruc-
tions
• Lower maintenance costs: Wired sensors are generally less expensive to maintain
over the long term compared to wireless sensors because they do not require batteries
or frequent updates
• Lower cost installation: There is an extra cost associated with a wireless sensor
installation, while wired sensors have a lower cost of installation
• Cost ineffective for short lease terms: Wired installations can sometimes
require infrastructure changes and may not make sense for short lease terms
• Complex installation: Wired systems require a large amount of space and are
much more complicated to install compared to wireless systems
• Limited flexibility: Wired systems are less flexible and scalable compared to wire-
less systems
• Higher installation costs: Wired sensor systems require drilling, wiring, and
structural building changes, leading to higher installation costs
Wired sensor networks are a type of network employing physical cables for linking
sensors to a central control system. This type of network is often used in applications
where security, reliability, and data integrity are critical.
– Air quality monitoring: Wired sensor network can be used to monitor air
pollutants such as particulate matter, ozone, and emissions from vehicles. This
data can be used to alert the public to air pollution and help policymakers
make decisions about air quality.
– Water quality monitoring: Wired sensor network can be used to monitor
water quality in lakes, rivers, and streams. This data can be used to detect
pollution and help protect water resources.
– Wildlife monitoring: Wired sensor network can be used to monitor wildlife
populations in the wild. This data can be used to study species and help con-
serve the environment.
– Theme Parks: Wired sensor networks can be used in theme parks to monitor
and control various aspects of the park, such as ride safety, lighting, and sound.
– Audio and Video Production: Wired sensor networks can be used in audio
and video production to monitor and control various aspects of the production
process, such as lighting, sound, and camera angles.
– Gaming: Wired sensor networks can be used in gaming to monitor and control
various aspects of the gaming experience, such as lighting, sound, and player
feedback.
• Industrial: Wired sensor networks have several applications in the industrial sec-
tor, including:
– Quality control: Wired sensor networks can be used to monitor quality pa-
rameters such as temperature, humidity, and pressure. This data can be used
to ensure that products meet quality standards.
– Asset management: Wired sensor networks can be used to track the location
and condition of industrial assets such as machinery and equipment. This can
help reduce maintenance and insurance costs.
– Security and safety : Wired sensor networks can be used to detect security
threats such as intrusion, fire, and explosions. This can help protect people and
property.
Wired sensor networks are used in various applications, such as industrial automa-
tion, environmental monitoring, and smart agriculture. These networks provide a stable
and reliable connection, ensuring consistent data transmission without interference, sig-
nal loss, or interruption. They offer high data transfer rates, making them suitable for
applications that require real-time data processing or control. Wired sensor networks are
also secure, with encryption protocols that protect data transmission from unauthorized
access. Their simplicity and straightforward implementation make them an attractive op-
tion for many applications, particularly in the fields of automation, control systems, and
consumer electronics
Here are some of the most popular wired communication protocols between sensor
nodes and the base station:
I2C’s support for both standard (100 kbit/s) and fast (400 kbit/s) modes, as well
as high-speed modes (3.4 Mbit/s and 5 Mbit/s), enhances its flexibility and appli-
cability in various scenarios.
Wireless sensor networks (WSNs) are systems designed to remotely monitor and con-
trol a specific phenomenon or event. They are a network of electronic, digital sensors
known as nodes that use wireless links (radio, infrared, or optical) to collect data from
the surrounding environment and transmit that data to a control center or another sen-
sor node. Sensors in a WSN can measure environmental conditions such as temperature,
humidity, sound, pollution levels, humidity, and wind.
Figure 3 – Wireless Sensor Networks including 3 main module: Sensor Node, Base Station (also
known as IoT Gateway) and Communication module.
A wireless sensor network (WSN) comprises nodes, routers, and a gateway that col-
laborate to monitor and control specific phenomena or events in various applications.
Nodes: Sensors are essential devices that measure environmental conditions and trans-
form them into electronic signals. They are crucial for gathering data within the network.
• Sensor nodes (SNs): the primary data-gathering devices in a WSN. They are
equipped with sensors to measure various environmental parameters, such as tem-
perature, humidity, pressure, light intensity, sound levels, and chemical concentra-
tions. The collected data is processed by the SN’s processor and transmitted to other
nodes or the gateway for further analysis and decision-making.
• Actuator nodes (ANs): on the other hand, are responsible for acting upon the
data collected by SNs. They receive control signals from the network and execute
specific actions, such as turning on or off a light, opening or closing a valve, or
triggering an alarm. ANs typically consist of a control unit, an actuator, and a
transceiver. The control unit interprets the received commands and activates the
actuator accordingly.
• The gateway serves as the crucial link between the WSN’s internal network and the
external world, enabling data exchange and communication with external systems.
• Acting as a data translator, the gateway converts the WSN’s data format into a lan-
guage that external systems can comprehend, facilitating data analysis and decision-
making.
Communication module:
• Communication modules collect and transmit data collected by the sensor nodes,
ensuring that the data is accurately and efficiently transmitted to the central hub
or other nodes.
• Low Cost: WSNs utilize small, inexpensive sensors that are easy to deploy, making
them a cost-effective solution for various applications.
• Wireless Communication: WSNs eliminate the need for wired connections, re-
ducing installation costs and enabling flexible network deployment and reconfigura-
tion.
• Limited Processing Power: WSNs rely on low-power devices that may have
limited processing power and memory, restricting their ability to perform complex
computations or support advanced applications.
• Data Security: WSNs are susceptible to security threats like eavesdropping, tam-
pering, and denial-of-service attacks, which can compromise data confidentiality,
integrity, and availability.
• Deployment Challenges: Deploying WSNs can be challenging due to the need for
proper sensor placement, power management, and network configuration, requiring
significant time and resources.
Wireless Sensor Networks (WSNs) have a wide range of applications across various
industries, including industrial, environmental, health, home, agriculture, and more.
– Air quality monitoring: WSNs can be used to measure air pollution levels,
such as particulate matter, ozone, and carbon monoxide, to track air quality
trends and identify areas that need improvement.
– Water quality monitoring: WSNs can be used to measure water quality pa-
rameters, such as the concentration of pollutants, pH, and turbidity, to protect
the environment and ensure safe water for human consumption.
– Forest fire detection: WSNs can be used to detect the early signs of for-
est fires, such as changes in temperature, humidity, and air quality, to help
firefighters quickly contain and extinguish fires.
• Agriculture: WSNs are being used in agriculture to improve crop yields and reduce
the use of resources.
– Soil condition monitoring: WSNs have the ability to monitor soil indica-
tors such as moisture, pH, and nutrient levels. This allows farmers to have a
more comprehensive overview of their cropland, and subsequently optimize the
amount of resources they need for their cropland.
– Crop growth monitoring: WSNs allow farmers to monitor crop growth,
including height, yield, and disease status. Thanks to WSNs, farmers can detect
crop diseases earlier, which helps to intervene early, thereby reducing losses and
increasing crop yields.
– Weather pattern monitoring: WSNs can monitor weather indicators such
as temperature, humidity, and rainfall, providing farmers with important in-
formation to prepare for and respond to weather events, thereby protecting
crops.
• Industrial: WSNs are being used in industry to improve efficiency, safety, and
productivity.
When multiple sensor nodes are deployed in a large area to cooperatively monitor the
environment, wireless communication between sensor nodes and between sensor nodes and
the base station (also known as the gateway) is a matter of concern. The choice of wire-
less communication protocol between sensor nodes and base station also depends on the
needs and factors such as transmission distance, transmission speed, power consumption,
scalability, and cost.
Here are some of the most popular wireless communication protocols between sensor
nodes and the base station:
• Bluetooth Low Energy (BLE): Introduced in 2010 as part of the Bluetooth 4.0
specification, BLE (Bluetooth Low Energy) is a wireless communication protocol
designed for applications requiring minimal power consumption and data trans-
mission. Unlike its predecessor, BLE operates independently, offering advantages
specifically tailored for low-power devices. Its key features include ultra-low power
consumption, short-range communication of up to 100 meters, and support for mesh
networks. These characteristics make it perfect for applications like environmental
monitoring, wearable tech, smart home automation, and asset tracking. Addition-
ally, BLE leverages the Generic Attribute Profile (GATT) for data exchange and
provides various profiles to cater to diverse applications and services.
Table 2 - Comparison of Wireless Sensor Network Protocols: Zigbee, LoRaWAN, BLE, Wi-Fi
The OSI model is a standardized model for data communication protocols in computer
networks. It divides the process of data communication into seven layers:
• Physical layer: Provides protocols for transmitting data in the form of bits over a
transmission medium.
• Data link layer: Provides protocols for controlling the flow of data and detecting
errors on the transmission medium.
• Presentation layer: Provides protocols for converting data between different for-
mats.
• Rapid Delivery: By passing the traffic jams of the upper layers, ESP-NOW delivers
data with lightning speed. No more waiting in line for processing at each level. This
makes it ideal for applications where every millisecond counts, like sensor networks
monitoring critical environments or industrial robots needing instant feedback.
• Efficient and Streamlined: ESP-NOW sheds the heavy headers and unpackers
that weigh down traditional protocols. This reduces processing overhead and frees
up resources, making it incredibly efficient.
• Real-Time Ready: ESP-NOW’s low latency ensures data reaches its destination
with minimal lag, making it perfect for real-time applications like video conferencing
or remote surgery.
————————————————————————————————————
| MAC Header | Category Code | Organization Identifier | Random Values | Vendor Specific Content | FCS |
————————————————————————————————————
24 bytes 1 byte 3 bytes 4 bytes 7-257 bytes 4 bytes
• Category Code: The Category Code field is set to the value (127) indicating the
vendor-specific category.
• Random Value: The Random Value filed is used to prevents relay attacks.
———————————————————————
| Element ID | Length | Organization Identifier | Type | Version | Body |
———————————————————————
1 byte 1 byte 3 byte 1 bytes 1 byte 0-250 bytes
• Element ID: The Element ID field is set to the value (221), indicating the vendor-
specific element.
• Length: The length is the total length of Organization Identifier, Type, Version
and Body.
• Type: The Type field is set to the value (4) indicating ESP-NOW.
Since ESP-NOW skips the whole connection setup, its MAC header doesn’t follow the
usual rules. Instead of marking the direction of data flow, it simply uses the first address
field to point to the receiving device. The second address tells who sent the information,
and the third address is always set to broadcast mode, reaching everyone within range.
2.4.3 The reasons why ESP-NOW is the best choice for this project
The ESP-NOW protocol offers several advantages in the context of smart agricultural
systems, including:
8. Supports large data packets: ESP-NOW can handle data packets up to 250
bytes, which is sufficient for most agricultural sensor data.
CHAPTER 3
Sensor cabinets and satellite cabinets will be made possible by the knowledge base and
technological combination described above to meet the most particular requirements in a
sizable agricultural area:
The design of a satellite station system for agriculture will be covered in this chapter, from
an overview to specifics of the system’s parts. After that, go on to the system infrastruc-
ture’s design and installation.
• Sensor Node module: in charge of obtaining data from several sensors that mea-
sure various parameters. This module collects measurements from the environment
in real time, acting as the first data source.
• Communication module: helps the data to be sent from various sensor nodes to
the IoT Gateway. By serving as a bridge, this module makes sure that sensor nodes
and the system’s core components communicate with each other seamlessly.
• IoT Gateway module: gathers data from sensor cabinets and sends it to the
server so that it may be stored. Enabling effective data flow, this gateway module is
a crucial link between the centralized data storage and the on-field data collecting.
• Data storage module: after obtaining data from sensor cabinets, IoT Gateway
store a significant amount of data. In order to facilitate historical analysis and future
reference, this module makes sure that data is persistently and securely preserved.
With the help of the architectural overview diagram, our team can finish implementing
the system. Figure 9 provides a summary of the system implementation.
The detailed architectural overview and system implementation diagrams provide a
solid foundation for our team’s development efforts. By focusing on the unique function-
ality of each module, our team can efficiently collaborate to bring this IoT-based wireless
network system to fruition.
The upcoming discussions in the following portion of this chapter will delve into specific
implemen-tation strategies and considerations for each module, ensuring a successful and
robust deployment.
Figure 9 – System implementation including Sensor Nodes, IoT Gateway and Server.
COMPUTER ENGINEERING PROJECT - Academic year 2023-2024 Page 30/66
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering
1. Power unit: The power unit provides power to the sensor node. It can be a battery,
a solar panel, or a power adapter.
2. Sensing unit: The sensing unit collects data from the environment. It can be a
temperature sensor, a humidity sensor, or a light sensor.
3. Processing unit: The processing unit processes the data collected by the sensing
unit. It can be a microcontroller, a microprocessor, or a computer.
Figure 10 – Sensor Node Architecture including 4 main unit:Power unit, Sensing unit, Processing
unit and Communication unit
Data from the environment is collected by a sensor, then processed by a controller. The
controller can perform simple or complex calculations to clean, convert, or analyze the
data. After processing, the data is transmitted to an IoT gateway using a communication
module. The communication module can use a wireless protocol, such as ESP-NOW.
Solar Panel: A solar panel is a device that converts sunlight into electricity by using
photovoltaic (PV) cells. PV cells are made of materials that produce excited electrons
when exposed to light. The electrons flow through a circuit and produce direct current
(DC) electricity, which can be used to power various devices or be stored in batteries.
Solar panels are also known as solar cell panels, solar electric panels, or PV modules.
Particularly for soil and water sensors — both of which must be left outside in the
elements and are mobile and long-lasting — using solar panels allows the sensor cabinet
to be placed more freely without being overly dependent on the 220V power source. Thus,
we have installed a solar panel with the following parameters:
• Charged Power: 10 W ± 3%
Anytime solar energy is utilized, a technique to store extra energy for cloudy, rainy,
or nighttime days must always be found. As a result, we gave batteries some thought.
However, this approach was dropped and lithium batteries were used in its stead since
it was excessively large, heavy, and had a limited lifespan.
Lithium Li-ion Battery: A lithium-ion or Li-ion battery is a type of rechargeable
battery that uses the reversible intercalation of Li+ ions into electronically conducting
solids to store energy. In comparison with other rechargeable batteries, Li-ion batteries
are characterized by higher specific energy, higher energy density, higher energy efficiency,
a longer cycle life, and a longer calendar life.
As the result, we have installed a 4-cell Lithium Li-ion battery pack with the following
parameters:
• Charger: 8.4V1A ∼ 2A
Soil satellite station: The ES-SOIL-7-IN-1 is a 7-in-1 integrated soil sensor that
measures various soil parameters, making it suitable for various agricultural applications.
The sensor measures conductivity, moisture, temperature, pH, nitrogen content, and other
soil properties, making it suitable for different soil qualities. It can be buried directly into
the soil, allowing for real-time monitoring of soil moisture, temperature, EC, pH, and
NPK levels.
The sensor is compatible with the Modbus communication protocol, which enables
seamless integration with various devices and systems. It can be used in smart agricultural
systems, greenhouses, and other environments where precise soil monitoring is essential
for optimal crop growth and yield. The sensor’s compact design and miniaturization make
it an ideal choice for space-constrained applications, such as small farms and greenhouses.
Parameter Content
Coding 8-bit binary
Data bit 8-bit
Parity bit No
Stop bit 1-bit
Error check CRC (Redundant Cyclic Code)
BAUD RATE 115200
• Address code = 1 byte : is the address of the transmitter, which is unique in the
communication network (factory default 0x01).
• Function code = 1 byte : The instruction function of the command sent by the
host. This transmitter only uses function code 0x03 (read register data).
• Data area = N bytes : The data area is the specific communication data.
Register address
Figure 12 – Air Sensor Device is capable of reading 7 parameters: Temperature, Humidity, Noise,
PM2.5, PM10, Atmospheric pressure and Luminosity
Register address
Water satellite station: The digital sensors that measure water quality parameters,
including conductivity, ORP (Oxygen Reduction Potential) , salinity,temperature and pH,
and utilize RS485 output for digital communication. These sensors are commonly used in
water quality monitoring, industrial environmental sensing, and agricultural applications.
The sensors are designed to provide accurate and reliable measurements of various water
quality parameters, enabling real-time monitoring and analysis. The RS485 output enables
the sensors to be integrated into larger monitoring systems, providing valuable data for
environmental and water quality analysis. The sensors are available in different models
and designs, including those with waterproof aviation connectors, hook-up wires, and
different output interfaces, making them versatile and suitable for various applications.
Figure 13 – Water Sensor Device is capable of reading 5 parameters: Temperature, PH, Electrical
conductivity, ORP (Oxygen Reduction Potential) and Salinity
Register address
M5 Atom Lite
The M5 Atom Lite is a compact development board in the M5Stack development kit
series. It is powered by the ESP32-PICO chip, which integrates Wi-Fi technologies and
includes a 4MB SPI flash memory, ensuring seamless connectivity and providing sufficient
storage capacity for applications. The board features a HY2.0 interface, buttons, RGB
LED, infrared LED. Additionally, Atom Lite can be easily connected to external sensors
and actuators through its 6 GPIOs. It also includes a USB-C port for both power and
programming purposes, and some versions may come with an integrated pin header for
mobile projects. Additionally, it may have a TF card slot for additional storage or data
logging capabilities. The operating temperature range of this ATOM board is 0°C to 40°C
with a 5V power supply. The development board measures 24 x 24 x 10 mm, and its small,
lightweight design makes it suitable for space-constrained applications and wearable device
projects. The M5 Atom Lite boasts a versatile development environment, supporting
both MicroPython and Arduino alongside various programming languages. Additionally,
M5Stack’s official documentation offers comprehensive resources such as pinout diagrams,
technical specifications, and example code, facilitating a smooth learning curve for users
of all skill levels.
Six GPIO pins (general-purpose input/output) line the board’s edge, granting access to
a world of external sensors and actuators. These can be used for diverse applications, from
monitoring environmental conditions to controlling motors and LEDs. Additionally, the
HY2.0 interface expands the board’s reach by enabling connection to specialized M5Stack
modules.
For peripheral communication, the Atom Lite boasts built-in support for popular
protocols like I2C and SPI. This allows for seamless integration with various sensors,
displays, and other peripherals, further enriching our project’s capabilities. Finally, the
Type-C USB port facilitates convenient power supply and program upload, streamlining
the development process.
The M5 Atom Lite is equipped with an ESP32-PICO chip that includes ESP-NOW,
which enables the M5 Atom Lite to communicate directly with other ESP32 or ESP32-
PICO devices without the need for an intermediary device.
ATOMIC RS485 Base
The Atomic RS485 Base is a versatile TTL-RS485 converter expressly crafted for
M5Atomic utilization. Its purpose is to act as an interface between TTL level and RS485
level, facilitating seamless communication among devices.
RS485 stands as a widely embraced communication protocol standard, delineating the
electrical characteristics of drivers and receivers in a serial communication system. No-
tably, it supports a multi-point system, making it a favored selection in diverse industrial
applications. When RS485 communication and control capabilities are requisite for our
equipment, the ATOM RS-485 emerges as a commendable solution.
Distinguishing itself, the Atomic RS485 Base incorporates an integrated DC/DC volt-
age regulator chip. This enables the direct conversion of RS485’s 12V voltage to 5V,
serving as a power supply for M5ATOM without the necessity of an additional power
source. This streamlined design mitigates the complexity associated with managing mul-
tiple power supplies, ensuring a simplified and efficient setup.
After connecting the M5 Atom Lite and ATOMIC RS485 Base, the G19 and G22 pins
of the M5 Atom Lite are connected to the corresponding pins 19 and 22 on the ATOMIC
RS485. This allows the M5 Atom Lite to communicate with RS-485 devices, such as the
sensor devices used in this project.
Arduino IDE is an open-source software that is primarily used to write and compile
code into the Arduino module. It can also be used to compile code into other modules
such as Esp32, Esp8266.
Arduino IDE is a completely free software that is widely used and appreciated by
programmers around the world. Users have the right to modify, improve, develop, and
upgrade it according to some general principles allowed by the publisher without the need
to ask for anyone’s permission, which they are not allowed to do for closed-source software.
3.2.3.2 C/C++
1. Select Parameter: The system first selects the desired parameter to read. This
parameter can be one of the following:
2. Send Read Command: The system then sends the corresponding read command
to the sensor via the Atomic RS485 device. The Atomic RS485 device is a serial
communication device that is used to connect the sensor to the system.
3. Process Sensor Response: If the system does not receive a response from the
sensor, it repeats step 2. This is to ensure that the sensor is properly connected and
functioning.
4. Decode Sensor Data: If the system receives a response from the sensor, it decodes
the data read from the sensor into a meaningful value. This is typically a decimal
number.
5. Send Decoded Data: The system then sends the decoded value to the IoT gate-
way via the ESP-NOW protocol. The ESP-NOW protocol is a low-power, wireless
communication protocol that is used to transmit data between devices.
6. Process IoT Gateway Response: If the system does not receive a response
from the IoT gateway, it returns to step 4. This is to ensure that the IoT gateway
is properly connected and functioning.
7. Continue with Next Parameter: If the system receives a response from the IoT
gateway, it returns to step 1 to continue with other parameters.
In the "Decode sensor data" step, each station will have a different algorithm, depend-
ing on the data returned from the sensors. For example, the data returned from soil and
air sensors is 2-byte signed numbers, so we can decode them into real numbers. The data
returned from water sensors is 32-bit, so we need to decode it into floating point numbers
using the 32-bit Single Precision IEEE 754 Floating Point algorithm.
The data exchange between the sensor node and the IoT gateway is implemented
using the ESP-NOW protocol. The reasons for this choice are clearly explained in section
2.4.3. The following are the steps involved in implementing the data exchange between
the sensor node and the IoT gateway:
1. Initialization:
2. Obtaining MAC Addresses: Use tools like M5Burner to retrieve the MAC
address of each sensor station (water and soil-air).
• Add both water and soil-air satellite stations as paired devices to the gateway
using esp_now_add_peer(). This allows direct communication between
each station and the gateway.
• Paired device channels range from 0 to 14. Channel 0 uses the local device’s
current channel. For other channels, set them explicitly to the local device’s
channel.
• Use esp_now_send() to send data from the sensor stations to the gateway.
In the realm of modern agricultural systems, the integration of wireless sensor net-
works (WSNs) has become paramount for efficient and data-driven farming practices. The
success of such systems relies heavily on robust communication mechanisms between the
deployed sensors and the central server. In this section, we delve into the communica-
tion architecture established between the Gateway and the Server, employing the MQTT
(Message Queuing Telemetry Transport) protocol. The server, powered by NestJS, serves
as the backbone orchestrator, managing and processing data from the agricultural sensor
network.
The "Users" module facilitates user registration through a RESTful API, allowing
users to create accounts by providing essential information. Passwords are securely
hashed and stored in the database, ensuring data integrity and user security. Addi-
tionally, the module incorporates JWT (JSON Web Token) authentication to verify
user identities during subsequent interactions with the server.
Within the "MQTT" module, a robust MQTT client is implemented to establish
connections with the MQTT broker. This client subscribes to relevant topics, allow-
ing the server to receive real-time updates from the agricultural field. The module
also manages the publication of commands to the Gateway, enabling bidirectional
communication. Incoming MQTT messages are processed within the "MQTT" mod-
ule, extracting sensor data and relevant information. The module orchestrates the
conversion of raw sensor data into a standardized format, ensuring consistency and
compatibility with the rest of the system.
The "Supabase" module integrates the Supabase platform into the NestJS server,
enabling efficient data storage and retrieval.
The integration of MQTT protocol for communication between the Gateway and Server
in our wireless sensor network for agricultural systems lays the foundation for a respon-
sive and adaptable data ecosystem. This architecture, complemented by the robustness of
NestJS, establishes a reliable communication channel that is crucial for the timely acqui-
sition and processing of sensor data, ultimately contributing to informed decision-making
in precision agriculture.
• The power of Raspberry Pi 4 in a compact form factor for deeply embedded applica-
tions. Raspberry Pi Compute Module 4 incorporates a quad-core ARM Cortex-A72
processor, dual video output, and a wide selection of other interfaces. Available in
32 variants, with a range of RAM and eMMC Flash options, and with or without
wireless connectivity.
• It serves as the primary processing unit in our design, and we have cleverly included
it there to take use of its computing capabilities for effective data management and
analysis. We’ve used the dependable serial communication protocol UART (Univer-
sal Asynchronous Receiver-Transmitter) capabilities to provide smooth communi-
cation and data transmission.
Figure (14) shows the ATOM LITE device that we use for data collecting. Data gath-
ered from sensor cabinets is sent to the CM4’s UART interface via this small but powerful
device. Information may go more efficiently from the sensors to the processing unit thanks
to the ATOM LITE’s bridge function.
Processing and maintaining the sensor data is the task of the CM4, which receives it
via UART. This design offers a scalable and flexible method for integrating various sensor
inputs in addition to guaranteeing the effective use of the CM4’s computing power.
Two primary approaches are provided by our system in situations when obtaining large
amounts of data from the server is necessary: data posting and data subscription.
• Data Publishing: When large datasets need to be distributed to the server, the
CM4, enabled by the MQTT protocol, broadcasts the pertinent information. This
guarantees that the server can store or analyze the incoming data effectively and
gets changes in real time.
• Data Subscription: On the other hand, the CM4 subscribes to the appropriate
data channels when it is necessary to retrieve substantial amounts of data from
the server. Our system’s bidirectional connectivity ensures a flexible and responsive
design by enabling our system to dynamically adjust to changing data needs.
This dual communication strategy, together with the MQTT’s scalability and the
UART interface’s durability, presents our system as an adaptable option for managing
a variety of data circumstances. By including the ATOM LITE as a data bridge, the
system’s flexibility is increased and a dependable connection is made between the CM4’s
computing power and the physical sensors.
This design not only meets the current data transmission demands of our system as
we go further into the era of Industry 4.0, but it also establishes the foundation for fur-
ther improvements and optimizations. Our dedication to developing a stable and flexible
system architecture that keeps up with the changing needs of sensor-based technologies
and data-driven applications is demonstrated by the use of UART and MQTT.
3.5.1 Supabase
Figure 25 – Firebase
Figure 26 – MongoDB
Figure 27 – DynamoDB
However, the decision to integrate Supabase into our system is driven by several key fac-
tors:
Supabase distinguishes itself by combining the advantages of a traditional relational
database with real-time capabilities, making it an ideal fit for our dynamic and evolving
sensor network. Supabase is built on top of PostgreSQL, a proven and reliable relational
database. This ensures data integrity and consistency, critical for the accurate repre-
sentation of sensor information. Supabase leverages PostgreSQL’s real-time capabilities,
providing instant updates to subscribed clients. This feature is invaluable for monitoring
and responding to changes in sensor data in near real-time. Supabase’s open-source na-
ture fosters a collaborative and extensible environment. It aligns with our commitment
to transparency and adaptability in the development of our agricultural sensor network.
Figure 28 – Supabase
The integration of Supabase as the storage backend for our agricultural wireless sensor
network establishes a robust foundation for data persistence and retrieval. The seamless
communication between NestJS and Supabase ensures that the data received from the
MQTT channel is not only securely stored but also organized in a structured manner,
facilitating efficient analysis and decision-making in the agricultural domain.
Upon receiving data from the MQTT channel, NestJS initiates a series of data trans-
formation and validation steps. This includes parsing the incoming data, ensuring its
integrity, and converting it into a format compatible with the Supabase schema.
• Nodes Table: The nodes table, representing the geographical locations of sensor
nodes, is populated with data such as id, name, and createdAt. The relationship
between the nodes and sensors tables is established through the nodeId foreign key,
enabling a many-to-one relationship.
Nodes table has been established to encapsulate the three distinct environmental
nodes denoted as water 0001, air 0001, and soil 0001. Each of these nodes is equipped
with multiple sensors, collectively constituting a sensors table.
• Sensors Table: The sensors table captures information related to individual sen-
sors, including id, name, nodeId, currentValue, and createdAt. The nodeId foreign
key establishes a connection to the nodes table, creating a hierarchical structure.
This allows for efficient organization and retrieval of sensor data based on their
associated nodes.
• Sensor output Table: The sensorOutput table records the output data from
sensors, including id, value, sensorId, and createdAt. The sensorId foreign key links
to the sensors table, creating a chain of relationships. This structure enables the
correlation of sensor output data to specific sensors and, subsequently, to their
associated nodes.
The integration of Supabase as the storage backend for our agricultural wireless sensor
network establishes a robust foundation for data persistence and retrieval. The seamless
communication between NestJS and Supabase ensures that the data received from the
MQTT channel is not only securely stored but also organized in a structured manner,
facilitating efficient analysis and decision-making in the agricultural domain.
3.6.1.1 Python
Python is now widely used in software development and data science fields because to
its versatility and dynamic interpretation. Python was developed by Guido van Rossum
and was initially made available in 1991. It places a strong emphasis on readability,
simplicity, and flexibility, making it a great language for novice programmers as well
as a useful tool for seasoned professionals. Python is widely used in many different sectors
because of its large standard library and active community.
Python is the preferred language for developing our software application because of
its extensive feature set and adaptability. Python was chosen because of its ease of use in
managing a number of activities, such as receiving UART data from the ATOM LITE,
publishing to the server, and synchronizing with it.
To sum up, Python’s vast range of features makes it an invaluable tool for developing
software applications. It enables us to effortlessly combine various functionality and satisfy
the intricate needs of our project. Because of the language’s versatility and broad support,
our software is not only able to satisfy present needs but also be prepared for future
improvements and optimizations.
3.6.1.2 Tkinter
Tkinter: Python comes with Tkinter, a common GUI (Graphical User Interface)
toolkit. It offers a collection of resources and tools for creating dynamic and aesthetically
pleasing desktop programs. Tkinter is an easy option for developers who want to construct
graphical interfaces without external dependencies because it is based on the Tk GUI
toolkit and has been a part of Python from its early releases.
Even if its design aesthetics may be viewed as a little boring, Tkinter is a dependable
and effective tool in the field of graphical user interface (GUI) development. Tkinter, in
spite of its simplicity, is essential to the process of displaying data from the Compute
Module 4 (CM4) on the screen when using HDMI. In the framework of the CM4, this
study examines the useful parts of Tkinter’s contribution to data display and visualization.
Tkinter turns out to be a useful tool for projecting data from the CM4 onto the screen
via HDMI, even if its design may seem a little repetitive at first. Its ease of use, com-
patibility with HDMI output, and effectiveness in data representation make it a sensible
option for tasks where effective information dissemination is essential. Tkinter’s contribu-
tion to effective and practical GUI design continues to be a significant feature of Python
application development, even as the development environment changes.
3.6.2 Implementation
• Active Sensor Nodes Frame: The app will dynamically display the active sensor
nodes in the first frame. The display will instantly erase any disconnected node,
allowing for real-time sight of the functional nodes. Users may instantly obtain an
overview of the current state of the network using this frame.
• Sensor Parameters Frame: The comprehensive sensor parameters that were gath-
ered from the active nodes will be displayed in the second frame. Real-time informa-
tion on temperature, humidity, pressure, and other pertinent variables is included
in this. The metrics are readily monitored and analyzed by users to provide insights
into the processes or environmental conditions being assessed.
• Data History Frame: The historical data that the sensor nodes have sent is pre-
sented in the third frame. The chronology of data points may be reviewed by users,
who can then see any trends or abnormalities. Before the data is sent to the server,
this frame also serves as a staging area, ensuring that only pertinent and thoroughly
examined material is sent.
• Data Graphic Frame: The fourth frame shows a data graphic that spans the
previous 12 hours, offering a thorough and aesthetically pleasing depiction of the
sensor data. Users may immediately understand trends, fluctuations, or important
occurrences within the given era thanks to this graphical depiction. The image
facilitates decision-making and improves the monitoring experience overall.
We hope that this application structure would simplify the user interface and make it
easier for users to monitor, evaluate, and interact with the sensor data. Every frame has
a defined function thanks to the well-organized layout, which enhances the coherence and
usability of the application design.
An illustration of the completed app’s appearance, including the frame organization
and information flow, may be found in the following figure:
Figure 35 – Display air sensors node and chart for data retrieval.
The goal of this user interface design is to improve the user’s ability to interact with
the program more easily, monitor nodes that are active, examine sensor characteristics in
depth, go over previous data, and extract insightful information from the graphical data
representation.
CHAPTER 4
In this chapter, we present an assessment of the response time from the IoT Gateway
to the Sensor Node and the proportion of data packets that failed to transmit successfully.
This analysis was conducted under three distinct scenarios with varying distances between
the Sensor Node and the IoT Gateway: 5 meters, 170 meters, and 200 meters.
Figure 36 – Response time distribution from IoT Gateway to Sensor Node at a distance of 5m.
The response time range is from about 2 millisecond to 35 millisecond. The most
common response time is about 2 millisecond, which accounts for about 37.73% of the total
samples. The standard deviation and the average response time is about 4.08 millisecond
and 5.08 millisecond respectively, indicating that the response time is quite stable.
Figure 37 – Pareto Chart of time response from IoT Gateway to Sensor Node at a distance of
5m.
Through statistics and from the Pareto chart, there are 4 types of data that account
for a high rate (total over 80%) of the total number of samples, which are 2,3,12 and
11 millisecond. It can be seen that the response time from IoT Gateway to Sensor Node
when the distance is 5m is efficient. The average response time and standard deviation
is low,indicating that the response time is quite stable and is less affected by external
factors.
4.2 Response time and packet loss analysis for 170m distance
After collecting approximately 1000 samples of feedback time from the IoT Gateway
to the Sensor Node at a distance of 170m, the number of unsuccessful data transmissions
was 40 which contribute to 4% of total data packets sent, suggesting a reliable connection
with minimal data loss.
Figure 38 – Response time distribution from IoT Gateway to Sensor Node at a distance of 170m.
The response time range is from about 2 millisecond to 97 millisecond. The most
common response time is about 3 millisecond, which accounts for about 17.08% of the
total samples. There are a few outliers with high response times, up to 97 milliseconds.
These outliers account for about 4% of the total samples. The standard deviation and
the average response time is about 8.68 millisecond and 9.32 millisecond respectively,
indicating that there is a significant spread in the individual response times, with some
being much faster or slower than the average.
Figure 39 – Pareto Chart of time response from IoT Gateway to Sensor Node at a distance of
170m.
Through statistics and from the Pareto chart, there are 12 types of data that account
for a high rate (total over 80%) of the total number of samples, which are 3, 2, 4, 5,
6, 1, 8, 9, 11, 12, 7 and 13 millisecond, indicating a reliable connection and efficient
communication.
4.3 Response time and packet loss analysis for 200m distance
The reason we measure the response time at a distance of 200 meters is because the
manufacturer of ESP-NOW states that it operates within a range of 200 meters or less.
Therefore, we collected 1000 samples and found that about 85 data packets were not
successfully transmitted, accounting for up to 8.5%.
Figure 40 – Response time distribution from IoT Gateway to Sensor Node at a distance of 200m.
• Packet loss rate The packet loss rate is 8.5%, which is equivalent to 85 packets
out of 1000 samples. This is a relatively high rate that can affect the performance
of the system. The cause of this failure rate can be due to a number of factors, such
as network interference, hardware or software errors.
• Response time The average response time of the system is 13.98 millisecond,
which is a very good response time for a wireless sensor network for agricultural
systems. However, the standard deviation of the response time is quite high, at
14.03 milliseconds. This shows that there is a fairly large dispersion in the response
time values.
Figure 41 – Pareto Chart of time response from IoT Gateway to Sensor Node at a distance of
200m.
Through statistics and from the Pareto chart, there are 12 types of data that account
for a high rate (total over 80%) of the total number of samples, which are 3, 2, 5, 7, 6,
4, 10, 9, 11, 8, 13 and 14 millisecond, The system exhibits a promising average response
time for agricultural sensor networks; however, it is hindered by a high packet loss rate
of 8.5% and a considerable standard deviation in the response time. Addressing these
shortcomings through the reduction of noise, optimization of the transmission protocol,
and hardware upgrades is imperative to ensure reliable data transmission and enhance the
network’s performance. By mitigating these issues, the system can achieve more consistent
and dependable communication, which is essential for the effective operation of sensor
networks in agricultural environments.
CHAPTER 5
1. Providing clarification on some basic information about the satellite station system:
• Sensor node: Completed in integrating soil and air sensors in 1 sensor cabinet,
separate water sensors in 1 sensor cabinet. The sensor cabinets are all connected
to 1 solar panel and 1 battery for storage.
3. Remaining errors:
• Examine and document the techniques used to confirm that sensor data is
accurate when compared to actual circumstances.
• Addressing immediately any discrepancies encountered with the values taken.
• Execution time: 2 weeks.
• Describe the methods used to automatically connect to the closest sensor node
cabinet in the case that there is a connection issue with IoT Gateway.
• Evaluate the system’s flexibility and continuity of data transfer.
• Execution time: 2 weeks.
• Describe the operational protocols used in the testing process, emphasizing the
system’s robustness and durability
• Evaluate the system’s resilience to changing circumstances and possible stres-
sors.
• Execution time: 4 weeks.
6. Report Writing:
The Capstone Project report will function as a thorough manual for the integration
and performance assessment stage, highlighting the precision of sensor data, the system’s
flexibility, and its general durability. Intelligent feature integration and a thorough eval-
uation of system performance will provide important new perspectives on the efficiency
and dependability of the system that has been designed. The report attempts to give a
detailed scenerio of the system’s capabilities and possible areas for improvement through
thorough analysis and reporting.
REFERENCES
[1] Akyildiz, I. F., W. Su, Y. Sankarasubramaniam, and E. Cayirci(2002). Wireless sensor
networks: a survey.<https://edis.ifas.ufl.edu/publication/AE521>
[6] Nguyen Thao Truong. 5 Giao thuc ket khong day cho thiet bi IoT, smart home quan
trong va cac ung dung tieu bieu<https://dienelectric.com/...>
[7] Nguyen Chi Nhan, Pham Ngoc Tuan, Nguyen Huy Hoang. Wireless Sensor Net-
works for Smart Agriculture in Vietnam.<https://stdjns.scienceandtechnology.
com.vn/index.php/stdjns/article/view/704/1137#figures>
[8] Janakiram MSV(2015). Tutorial: Prototyping a Sensor Node and IoT Gateway with
Arduino and Raspberry Pi (Part 1).<https://thenewstack.io>
[13] MDPI(2021). Design and Implementation of Wireless Sensor Network Based on ESP-
NOW Protocol. Applied Sciences, 11 (12), 5374.<https://www.mdpi.com/2076-3417/
11/12/5374>
[14] Food and Agriculture Organization of the United Nations. Wireless Sensor Networks
for Agriculture.<https://www.fao.org/3/w7365e/w7365e04.htm>
[15] National Center for Biotechnology Information(2017). Wireless Sensor Networks: Ap-
plications in Agriculture. Journal of Animal Science and Biotechnology, 8 (47).
[16] Sustainable Agriculture Research and Education(2013). Systems Research for Agri-
culture.
[17] Indian Institute of Technology Kharagpur. Wireless Sensor Networks for Agriculture:
A Review.