Smart Agriculture Using IoT Multi-Sensors: A Novel Watering Management System

: Advances in the Internet of Things (IoT) are helping to make water management smarter and optimizing consumption in the smart agriculture industry. This article proposes a new topology of sensor nodes based on the use of inexpensive and highly efﬁcient components, such as water level, soil moisture, temperature, humidity, and rain sensors. Additionally, to guarantee good performance of the system, the used transmission module is based on LoRa LPWAN technology. The design of the main circuit board of the system is optimized by combining two layers and implementing software optimization. The overall sensor network is developed and tested in the research lab, and real farms can be controlled by users manually or automatically using the mobile application. Experimental results are produced by testing sensor and communication link effectiveness, and are subsequently validated in the ﬁeld through a one-week measurement campaign


Introduction
Wireless sensor network (WSN) technology, which is known as the center of the Internet of Things (IoT), has continuously grown in recent years.An advantage of WSNs is their ability to easily define a network of devices that can be communicated with and gathered from a monitored field through communication links since the information is sent through multiple nodes with a gateway and connected to other networks like wireless Ethernet.Many researchers have applied WSNs to different research areas, such as environmental monitoring, forest fire detection, smart cities, smart education, healthcare, agricultural control, water quality monitoring, military uses, and asset management [1][2][3][4][5][6][7][8][9].Accordingly, WSNs are suitable for multiple applications.The long range (LoRa) LPWAN is one novel IoT communication technology with an excellent capacity for development that is applied in many fields.The benefits of this technology can be attributed to its capabilities of ultra-long-distance communication, low power consumption, and ease of deployment, among others.
In agriculture, environmental monitoring is required to control specific plant conditions.By collecting approximate values of available data and making more accurate estimates, a WSN can be used to achieve this task.In addition, many agriculture researchers apply WSNs to monitor environmental criteria [2][3][4][5][6].In addition to standard environmental conditions such as temperature, humidity, and precipitation, data such as the ability to control the water level or temperature level are the subject of research in an agricultural environment [10].
Water management and optimal water supply have become popular topics in the field of smart agriculture and are being studied and developed by many researchers.Over the years, prominent researchers in the field of smart agriculture have written many survey articles which introduce the research methodology for various communication technologies that control resources efficiently based on IoT technology [11][12][13].We summarize and compare our model with the existing literature in Table 1.In Vietnam, agricultural production has transformed the country's socioeconomic status by alleviating national food insecurity, reducing poverty, fostering agrarian exports, and providing livelihoods to nearly half of the labor force nationwide.These are just some examples, since WSN is actively applied to various functions such as smart cities, waste management, and waste collection with LoRaWan technology [14][15][16].

Model Advantages Disadvantages
Development of wireless sensor networks [8] -Reduce costs.
-Generates huge amounts of data.
Smartphone connectivity [11] -Reduced capacity for real-time data processing -Significant negative impact on battery life.
-Requires challenging storage of large amounts of data.
A life cycle framework of green IoT-based agriculture [12] -Recognizes the quality of agriculture ingredients.
-Improves yields as well as quality.
-Produces saleable agri-products for the market.
-Requires corresponding theory and methodology to address emerging finance, operations, and management issues in the digitization of agriculture using IoT techniques.
Our model -Reduces costs.
-Saves energy, increases efficiency, and enables excellent communication between farm and gateway.
-Improves yields as well as quality.
-Requires challenging storage of large amounts of data.
This article is organized as follows.Section 2 introduces the current work on WSN in smart agriculture, clarifications on issues of water management, and essential tasks to be completed.Section 3 presents details of the architecture of the IoT proposed system.Section 4 presents the operational tests composed of two different tasks, while Section 5 discusses the advantages and disadvantages of our policy.Finally, some concluding observations and a way forward are offered in Section 6.

Smart Agriculture and Related Works
As it possesses the advantage of critical natural resources, Vietnam is an agricultural country that is growing very quickly.Agriculture plays an essential role in the Vietnamese economy and contributes to the country's economic development currently and in the future.Agriculture is one of the critical industrial sectors of Vietnam, and economic growth depends heavily on agriculture.The population of Vietnam will rise to reach 100 million people by 2020, while the demand for agricultural products such as food crops (e.g., sweet potatoes, manioc, beans, and corn) rice, coffee, pepper, cashew nut, rubber, tea, fruit, and vegetables continues to increase dramatically.Combined with the effects of climate change, these demands place even more strain upon land, water, energy, and other resources that are already influenced.Several smart solutions can be co-optimized and scaled up to improve yields and meet growing food production demands while transporting power and water resources efficiently [17].
Many articles depict the close relationship between smart agriculture and IoT/WSN.Researchers focus on how this high-tech improvement can be employed to develop effective smart systems and data transmission [8,18].
The authors of [18] present a SmartFarmNet framework, based on the IoT platform that can automate the collection of environmental, fertilizer, soil, and irrigation data; automatically correlate that data and evaluate product performance; and calculate product estimates and suggest specific products for any particular farm.Importantly, IoT devices can be integrated into this platform as sensors, cameras, and weather stations.Produced data can then be saved in the cloud to enable performance analysis and and recommendations.
With the help of IEEE 802.15.4,which is a suite of high-level communication technology, artificial intelligence, and decision support technology, the authors of [19] have developed research on the agricultural application of IoT technology to monitor real-time moisture and nutrients of citrus, along with an analysis of the combination of fertilizer support systems and irrigation.However, this research has weaknesses, which include system complexity and high costs.The authors of [20] also present a narrow-band radio channel model whereby the communication link transfers under near-ground requirements for a smart agriculture platform.
The solution presented in [21] was developed by implementing machine learning applications on agriculture datasets for smart farm improvement.By employing and comparing numerous machine learning methods to recommend the best solution, this system enabled the investigation and deployment of useful jobs, varying from crop yield forecasting to missing or incorrect sensor data reconstruction.However, the only reasonable application for this scenario is smart agriculture, since three different resources are available: the CRN scientific dataset, Istat statistical dataset, and the IoT sensor manufacturing dataset.
Many researchers and developers have chosen microcontroller boards (e.g., Arduino boards) or Raspberry Pi for IoT applications.These allow real-time monitoring, collection, data management, security, and remote control functions using the mobile app because of the suitable platforms available for Internet-connected sensor buttons.This option is often challenging because it entails a trade-off between cost, performance, and functionality for each specific application project.Water management involves a valuable resource.If an attacker controlled the system, entire crops could be destroyed due to altered irrigation levels.A denial of service (DoS) attack on sensors, irrigation actuators, or distribution systems could affect system-wide operations.Changes to sensor settings may also issue a warning that could cause networks or decision producers to perform illegal actions and yield months of efforts and production aims.If an attacker gains control of the actuators, irrigation and water distribution may be compromised and result in the incorrect irrigation of certain products.Furthermore, eavesdropping may give criminals access to secret data about the farm.They could remove productivity information and even manipulate the commodity business, which represents an even more significant threat.Self-governing vehicles, drones, and engines utilized to collect images or control manufacturing must also be kept classified.An unauthorized node in the network can send incorrect information about a crop.However, the authors only present the challenges to security in smart agriculture, and do not discuss how to overcome challenges [22].
A smart agriculture system was constructed to use low-power Bluetooth and LPWAN communication technologies, including the wire-based communication technology used in the existing farm in [23].This was combined with microcontrollers such as an Arduino UNO board or Raspberry Pi board.The administrator receives data from sensor connections, and then stores the data, analyzes it, and provides a user interface to monitor it.A related study [24] explains how an approach to using IoT and cloud computing that incorporates development is helping to quickly modernize agriculture and to realize smart solutions for agriculture.Moreover, to solve problems regarding more practical issues related to farmers, sensors can be applied for use in the IoT system.Furthermore, 2G and 3G wireless broadband networks can be used for communication between other components in the IoT system.
Several enabling technologies are adapted to present smart platform projects, which are able to collect and manage data handling problems related to water management in smart agriculture.For example, the SWAMP project is a platform architecture that includes a scenario-based development process for the obtained systems in [25].Moreover, the platform develops and assesses smart water management for precision irrigation in agriculture with a practical method based on four pilots in Brazil, Italy, and Spain.The structure of SWAMP can be developed for different solutions to deal with the requirements of different contexts, countries, climates, soils, and crops.Indeed, considerable flexibility is required to adapt to a range of deployment configurations, including a diverse mix of technologies.Unfortunately, for this platform, it is not possible to use without the license and to do this.The different IoT smart platforms presented in [26] propose the use of cloud-based technology to manage the collection, analysis, and forecast of agricultural environmental information in one universal system.Besides the introduction of the platform, the author of the paper also presented LoRa communication and applied it to the studied network, and although details were not provided on the hardware used to do this.In summary, both studies presented interesting suggestions and suitable platforms for application to smart agriculture.
Other authors have focused on completing a systematic literature review of IoT research and deployments in protected agriculture over the past ten years, in which they evaluate the contributions made by various researchers and organizations.Moreover, the structure of IoT is also detailed in protected agriculture, including the used platforms, modern wireless technologies, cloud computing, machine learning, big data, animal farming, hardware, software challenges, and so on [27].
Another paper [28] proposes an IoT idea-based solution for smart farming, where the authors proposed stack and discuss the current improvements.They mainly focus on the IoT/M2M interaction and explain the design and development of a gateway that discusses the provided services.Notably, in [29], the Web of Things (WoT) was proposed as an idea to use environmental monitoring and enhance agricultural practices by supporting decision-making based on bio-data collection.The paper briefly presents the original design, which is a middleware platform for IoT that performs separation by understanding opportunistic networking and computing operations.Accordingly, it is able to detect and control environmental targets using web-based technologies.Meanwhile, the use of IoT for smart precision agriculture for rural areas is proposed in [30].In this paper, the authors focus on a scalable network architecture for real-time monitoring of agriculture in rural areas.A possible strategy is to optimize each element of the system to reduce system latency up to a particular area.A solution [31] was proposed by implementing a framework for managing, investigating, and sharing groundwater data, with the use of sensors to gather data on groundwater levels, pump sensors, and weather conditions.
In [32], electromagnetic field analysis is presented as an enhanced monitoring approach for subsurface radio wave propagation and underground sensing applications in the field of prediction agriculture.However, this technology is challenging to implement in complex real environments, which may delay system deployment.The prediction of the agriculture model presented by [33] offers solution management capabilities by monitoring soil conditions in real time using underground wireless sensors.Furthermore, the structure used two types of communication links, above-ground and underground, for the experiments.However, other challenges need to be solved, such as reducing energy loss and promoting energy efficiency.These nodes should be able to adapt to the soil moisture and temperature changes of the environment, among others.
More recently, the authors in [8] proposed an irrigation system that combines IoT and data analysis for the collection of environment data and control of the farm via web and mobile applications.However, this article faced challenges in controlling water in the farm.After analyzing state-of-the-art research on water management and smart agriculture that applies IoT and related technology, the following outcomes are drawn:

•
Many popular systems and platforms can be used for water management in smart agriculture, but may be too expensive for the average farmer [28][29][30][31].

•
The combination of multiple technologies in one system and the presence of limitations leads to complexity when combining proprietary technologies.Moreover, many factors affect the price (e.g., farm, hardware design, and guiding documentation), although a basic package costs a minimum of $500 in [28][29][30][31].

•
All IoT smart agriculture solutions on the market are Most IoT smart agriculture products are passive methods (i.e., manual).In some cases, they are connected to farm monitoring devices to act smartly.

•
Many researchers have presented solutions for smart agriculture systems.However, these methods are restricted by the design-embedded board and the inflexibility of devices, as it may be necessary to attach additional sensors or to control two or more farms with the same mobile application.
Therefore, we proposal a novel system to address the four above points: 1.The standard IoT water management system is explained and designed.It can connect to the Internet through LoRa communication both manually and automatically with all hardware designs.The IoT box is designed to manage the IoT devices and obtain data from the farms.2. A system is possible connected the agriculture from farming based on rural areas efficiency to IoT system.Additionally, the implemented system is a good alternative for analyzing the communication between the gateway and nodes 1 and 2. 3. Our smart watering system receives real-time data input from sensors embedded in a farm tunnel and other locations.The system then offers suggestions for watering schedules and capacity.An advantage provided by the sensors, used for two farms, are the transmission of an evaluation to the user's mobile application, from where users can prepare a watering plan for the farms.4. Finally, our smart watering system is scheduled to a date and time which guarantees that the water level falls below the threshold in the tunnel farm.The system notifies the user and switches on the water pump (manual or automatic) in time to water the plants.

System Architecture
The aim of this paper is to provide a solution for the real-time monitoring of water management that optimizes power consumption.An additional target is a cost-saving in smart agriculture.The critical element that affects energy dissipation in the sensor nodes is the transmitting module.As a design operation, it focuses on the structure of the sensor node and the meaning of the network sensor architecture.Finally, the determination of effective data transfer technology is geared towards implementing an energy-efficient sensor node.The details are discussed in Section 3.1.
However, most of the smart agriculture field if the data are the crucial importance in the node, where the users could be easily chosen by operating more comfortable components.Therefore, the micro-controller must be selected to guarantee a suitable trade-off between energy efficiency and complexity.Finally, elements must be selected to consider the optimal agreement between measured data accuracy, expected energy to carry out that task, and price, thus prioritizing the use of sensors.As a result, the power of the sensors becomes an important factor for energy consumption and longevity.The proposed IoT node in our system is constructed following these requirements.First, the choice made regarding essential elements is a single-chip micro-controller such as an ATmega328/P or ATmega2560.A reasonable choice is to provide simple open-source software to allow the user to observe and boost their confidence in the programming.Second, it uses a lower number of clock cycles to execute instructions than others-all of the sensors and the developed single-board microcontroller, where all of the devices are integrated.Third, after reviewing the start-of-the-art of the relevant technology, the best option is the LoRa technology, as it provides IoT connectivity over large areas by enabling data transmission across an extended range.It uses very little power, is robust in a rural area, and uses an overall network architecture that was developed in a smart agriculture situation.Finally, low-cost and low-power sensors were selected to provide an excellent balance between measurement accuracy and energy efficiency.
Our paper introduces a reliable, robust, cost-effective, and scalable smart agriculture solution based on IoT technology.The architecture system is presented in Figure 1, which presents three node prototypes: the gateway, node 1 and sensor node 1, and node 2. The flow diagram shown in Figure 2 demonstrates how to manage data transmission between the gateway, node 1, and node 2 of our system.

•
The gateway performs the core functions of data collection from the nodes via LoRa, and then sends data to the cloud, via the WiFi ESP82666 module, and to the mobile application.Moreover, users can also control the node throughout the gateway with the use of the mobile app.

•
Node 1 and sensor node 1 are designed for this case, as we assumed that the water pump machine is far from the sensor location.

•
Node 2 was designed for orchard conditioners, with a topographic condition suitable for installing pumps directly in the farm without separating the sensor block.Following the next sub-sections, the various essential features of the construction of such three nodes are going to describe below:

Power System
The power system for the Gateway, Node 1 and 2 issue an AC supply of 220V.Nevertheless, this power has to convert toward the expected form with normal voltage range for storing power supply to different kinds of devices in the IoT proposed node.Based on the requirement of the power IoT system that the microcontroller and the communication module need 5 V and 3.3 V for the powering system with receive node, respectively.It is necessary to include voltage regulators inside the node.For that reason, two voltage regulators employ a 5 V regulator that powers sensors of Figures 3-5 and a 3.3 V one which powers the powering system for the receiver node.It must also be noted that the power system is designed to provide enough capacity for the entire circuit board to operate if the selection of components without a scientific basis leads to several conditions such as pressure drop due to insufficient ability to supply the board or if the wrong voltage for the board is chosen, beginning to circuit fire and damage-broken components on the board.

Gateway
Even though the proposed IoT system architecture that it is possible to apply any microcontrollers or data transmission modules, in the implementation presented in this paper, the communication of a gateway is combined of a LoRa module and WiFi ESP8266 module, and ATmega2560. Figure 3 shows the Gateway node's block diagram, which presents the details regarding how all device elements are connected: the LoRa transmission module, WiFi ESP8266 module, ATmega2560, and power system for Gateway.Figures 6 and 7a show the Electronic schematic and Gateway's prototype, which includes the sub-section mentioned as below:

Transmitter Module
As mentioned previously, the transmitter module performs a vital concern in energy consumption optimization.Hence, it has to be precisely selected and prospered.The IoT proposed node is proposed to be used outside and spread over a rural area.Since radio communication link solutions must be explored, this needs to be taken into account.In fact, it is unthinkable for something like this to have a wirework connection (e.g., LAN) in large quantities at each node.An IoT application has many communication networks where the sensor system is proposed.These systems are working based on various radio technologies.Table 2 shows a measurement of the available technologies, along with their essential features.The vital functions such as area, consumption, and availability are accentuated in this table because they are crucial parts for developing the device.After reviewing the technical aspects as presented in this paper, the selection for data transmission technology is an E32 LoRa series module [34].The settings of this module work in the article shows in Table 3.  Considering all of these previous technologies, there are mean flexible options for the achievement of IoT nodes.The most significant selection has to be carefully studied as it is easy to change the hardware, implementation, and long-lasting quality over time.The one recommended in our article, which is a solution for the real-time monitoring of controlling the level of water and resulting hypothesis, shows as:

•
The IoT node system is expected to be deployed for two nodes with the distance between two nodes being a few km with complex terrain in rural areas.Therefore, the cost of the system needs to reduce to the lowest level possible, and the support services need to be optimized:

•
The coverage of our system to around tens of km 2 ;

•
The lower power consumption is composed possibly for an adaptive data rate and changes the output bit rate.Moreover, it depends on payload combined with chirp spread spectrum technology that effectively gives processing gain.In addition, LoRa Technology can easily plug into existing infrastructure and enables low-cost battery-operated IoT applications.
After reviewing these simple highlights, it can define the benefits and drawbacks of the leading four communication networks released for the previously outlined:

• Local Area Networks (LAN):
The ad hoc's area coverage is significantly more than other carrier network technologies.However, it still has some disadvantages.Applying the radio technology network for our system: for instance, WiFi or BLE technology set up, requires a significant number of nodes for the system.It will noticeably change the overall cost of the deployed infrastructure.
A different choice might be to implement a ZigBee network or BLE technology.Because the system is not energy efficient, and admits a significant decrease in the power consumption of the end device nodes, this means that, although their current absorption levels are relatively low (40 mA [35]), their life expectancy provided by batteries is in some order.

• Low Power Consumption (LPWAN):
The authors in [36] proposed characterizing great Area Networks LPWAN solutions as their more extensive transmission range allows for the establishment of a star or multi-star network with some APs.Allowing the sensor node to use the chief duty-cycling policies allows for turning off buttons for long periods.Finally, the price of this technology is meager when agreeing to use them in large quantities at no extra charge as in the situation of ISP co-operation.

• Global Area Networks (GAN):
The global network is the most simple solution to deploy because it does not need access points or specific infrastructure implementations.Unfortunately, it has many other essential features, the first being the price: 3G technologies; still, the lowest of different techniques is always more expensive than other solutions.Furthermore, SIM is used, so they need subscription payments when preparing to deploy many of nodes and become insignificant.Additionally, the energy consumption needs to take into consideration that the average modern consumption of the third-generation mobile cellular system is many times higher than that of the IEEE 802.15.4 [37].Alternatively, a low-power wide-area network module [38] may be considered; however, obtaining it is unsuitable for applications with low energy use.Finally, in the rural areas, some ISP cannot support the Internet service for the users.

•
Narrowband-Internet of Things: NB-IoT is the novel technology with a short form of Narrowband-Internet of Things and specified in LTE Release-13 [39].It is developed to meet the requirements of LPWA (Low-Power Wide-Area) networks.NB-IoT has a wide variety of applications for many fields such as personal, technology and industrial.The applications are wearables, smart bicycles, event detectors, smart garbage bins, smart metering, smart agriculture, and logistics tracking.Mainly, low power and long-range are the absolute essentials for IoT (Internet of Things), which is a significant concern with mainstream cellular technologies.The other advantages of the NB-IoT are scalability, quality of service and safety related to unlicensed LPWA networks and design, including the secure connections between small energy devices and a gateway.In this research, the nodes communicate with each other via the UART interface.At the gateway, it is necessary to use two UARTs (the first one communicates with the ESP8266 module, and the other one is used to communicate with two nodes.In Node 1, it is also necessary for two UART interfaces to collect data from the nodes and the gateway, since the ATmega2560 is a reasonable choice [40].

WiFi ESP8266 Module
The WiFi ESP8266 module from [41][42][43] is the best choice because the ESP8266 is very flexible in data transfer between devices and mobile applications, easy to integrate into advanced projects, and adaptable within the Arduino embedded development environment.

Node 1 and Sensor Node 1
The same as in gateway, in this node, an AC supply has to be converted towards the demanded form with the required voltage range for storing power supply to various types of devices.We are suggesting that the micro-controller and the transmission module need 5 V for the powering system with a receive node each, and it is necessary to incorporate voltage regulators inside the node.Therefore, two voltage regulators use 5 V and 3.3 V regulators, which power the sensors in Figure 4 and the powering system for the receiver node.
Figure 4 shows the block diagram of Node 1, which designs the case.It assumes that the water pump is placed far away from the sensor location since there is a sensor node to collect the data for Node 1. Node 1 receives the data from sensor Node 1.Based on the sensor values, we can define the value from the application and the sensors located at Node 1.Moreover, in this node, there are two primary sensors, which are the pump temperature sensor and water level sensor.LoRa module on Node 1 communicates to the Gateway.We also use RF HC12, a short-range wireless data transmission module whose primary function is to receive data from sensor Node 1 transmitted to Node 1. RFID performs the central feature of controlling the pump directly at Node 1 to increase the security of the system, and LCD is designed to display the data of Node 1. Sensor Node 1 in Figure 5 shows the flowchart of details as the node power is an external AC-DC converter with 7 V that gives sufficient current to power all the components.Section 3.3.1 illustrates the details of the ATmega328 microcontroller and the sensors connected in Figure 8 for Node 2.

ATmega328 Microcontroller
All of those sensors require the involvement of a micro-controller system to perform: this component must be implemented to trade off the price, power consumption, and performance energy results.According to most elements of low power, modern micro-controllers use for a several mA, the effects of this element for the typical power consumption of the node can be negligible, thus providing a higher level of independence [43].
Based on the principle diagram of Gateway and Node 1, it seems that both have many common points, which can be seen in Figures 3 and 4. The best selection in this study for the integrated design for both Gateway and Node 1 is significant.Because they save on the costs of printed circuitry, achieve faster circuit machining, and quickly fix hardware errors.Figure 6 shows the schematic of an actuator Gateway and Node 1, which contains: an AC-DC converter, ATmega2560, LoRa transmission, RFID, LCD, and all the sensors.Note that, for the sake of simplicity, we proposed all of the integrated circuits depicted in the schematic.After that, the printed circuit boards Gateway and Node 1 are designed with two layers of wires to make wiring more convenient and help optimize the circuit as much as possible.The components are arranged in blocks with separate functions, making it easier and more convenient to check for errors.
The printed circuit of Gateway and Node 1 is designed with: • 62 components in which there are 59 glued components and three pin components.

•
The total number of different lines is 49 lines.

•
There are three different line sizes of 80 mils, 25, and 10 mils following different wiring requirements.

•
Line rules: do not cut wires, report faulty components and the minimum distance between wires is 10 mm.• Size: 74.193 × 87.503 mm.
Figure 7b shows the overall prototype of Node 1. Node 1 powers with a 5V AC-DC converter that stores full current energy to control all the components and the relay module.Furthermore, the LoRa module is not put close to the converter because it generated the electrical noise and the interference of communication links.
With the various parameters to be observed in our system, in most cases, temperature, temperature-humidity, soil moisture, rain, and water level are measured.

•
Temperature sensor: DS18B20, [44], the popular solution for temperature control in smart agriculture systems is the application of standard digital sensors, for instance, DS18B20 integrated circuits in this research.

•
Temperature-humidity sensor: DHT22 [45] is a current sensor, which combines the temperature and humidity sensor; it provides a wider temperature range and better accuracy.In particular, it has low consumption and is better for most smart farming systems.

•
Soil moisture sensor: SKU:SEN0193 [46], this soil moisture sensor measures soil moisture levels by capacitive sensing rather than resistive sensing like other sensors on the market.It is made of corrosion-resistant material, which provides a good solution for the user.Moreover, the sensor is simple to use-an analog sensor that works at a low voltage.

•
Rain sensor: LM393, this is an analog sensor that operates at a low voltage, and the current sensor is for easily detecting rain [47].

•
Water level and temperature pump: LM393 [48]; this is an analog sensor when the water level reaches below the threshold in the tunnel farm and checks the sensors.Our system communicates to the user and establishes a water pump to its switch on the state for sufficient watering of plants throughout a mobile application.
Figure 9 shows the sensor Node 1 electronic schematic, and how total hardware elements are attached: microcontroller, power, and IC circuit.DS 1307 is used to read the real-time with the high accuracy, LoRa module transfer data via a serial connection, and the module connection is used to connect RF HC12, RFID RC522, LCD, sensors, pump, and ATmega2560. Figure 10a shows an actual model of sensor Node 1.
Besides the hardware, before being discussed, sensor Node 1 needs an additional device to operate.The general important thing is the power subsystem.In the case of the nodes, it was selected to power the nodes.Note that, in this situation, we also can be used by the power supply unit, which is based on a 12 W solar panel.The solar panel is linked to the solar charge controller, where a solar charge controller manages the power going into the battery.4. Node 2 is designed for orchards with conditional topographic groves suitable for pumps directly at Node 2 without separating the sensor like Node 1.Other components of this node are also like nodes from LoRa module, RFID, and LCD.Based on the principle diagram and schematic of sensor Node 1 and Node 2, we see both control circuits with the general design of sensor blocks, microcontrollers, power blocks, and communication blocks with the computer.Thus, the design of printed circuits integrates two circuits.It also helps to reduce circuit design time, reduce costs, and process components faster.Sensor Node 1 and Node 2 are designed with two layers of wires to make wiring more convenient and help optimize the circuit as possible.The components are arranged in blocks with separate functions, making it more comfortable and more convenient to check for errors.Sensor Node 1 and Node 2 in Figure 10 designed with: • 54 components in which there are 51 glued components and three pin components.

•
The total number of different lines is 44 lines.

Operational Tests
The proposed smart agriculture system is evaluated using two different scenarios in Vietnam: demonstrating the effectiveness of the sensors for the analysis of temperature, solid humidity in a research lab; and confirming data transmission by using the LoRa channel over a large area and distance.

Tests on the Sensors of the IoT
The first scenario was set up in the Department of Electronics and Telecommunications Engineering of Ton Duc Thang University, Vietnam, where the sensing infrastructure was evaluated.The performance of the system was tested using a subset of nodes with the Arduino.These sensors were used because the presence of other components would not affect the accuracy of the measurement.In addition, since the circuit board was furnished with the equivalent microcontroller used in the node, this circuit board was chosen for specific tests due to its ease of use, as fast prototyping is required and because it can exploit the equivalent microprogramming of an IoT button.Experiments were performed using the gate, button 1, and sensor button 1 and button 2 with LoRa integrated with embedded sensors.An easy-to-read LCD screen was added to the mainboard, where it displayed the temperature and humidity measured by the sensor as shown in Figures 11 and 12. Furthermore, the accuracy of sensor measurements was displayed and confirmed on the LCD screen.Finally, sensors were calibrated before the test to guarantee the accuracy of data, and to help users to eliminate difficulties during the setup process the system.

Test on Data Transmission through the LoRa Channel
In the second scenario, the effectiveness of the LoRa technology for the placement of a farm monitoring infrastructure was investigated by examining data transmission distances in two real farms as shown in Figure 13.For this purpose, a model system infrastructure was set up in the Cho Lach district, Ben Tre province, Vietnam, to demonstrate the usability of an individual star topology network covering an entirely rural area.The model infrastructure was composed using a gateway node produced by a LoRa E32-TTL-1W module connected to a mobile application, and by two sensor nodes.The transmission modules were set up with three critical measures: the symbol rate of information, the bandwidth of the channel, and the information rate were set according to the datasheet provided by the manufacturer in order to obtain the highest sensitivity.
Based on the sensor network structure presented in the previous sections, the transmission ranges were checked by placing the gateway in the farm.The nodes were located in various areas: node 1 covered 2000 m 2 at a distance of 700 m from the gateway, while node 2 covered 1000 m 2 at a distance of 500 m from the gateway.These positions were fixed and it was verified that the actual data was correctly received.Subsequently, data were collected from nodes 1 and 2 and sent to the gateway during the following seven days of the same month, during which 24-h measurements were made.In this way, the performance of the system was tested.Figures 14 and 15 show the results of the two nodes, which present the soil moisture, humidity, and temperature.It can be observed that, based on the threshold of these values, the system could automatically switch on the water for the farm.The experimental results indicate that the application of a quick procedure for effective resolution building certainly helps to enhance the outcomes of a sensor-based system.Not only does a smart strategy improve the performance of IoT-based and sensor-based systems, but the efficiency of these systems can be increased with the smarter and more accurate choices made by such intelligent systems.Our experimental results highlight the procedure used by the smart irrigation system to save water in tunnel farming, thus achieving higher productivity and the ability to flexibly manage the farm.Data transmission is also a crucial issue in the IoT smart system in checking the effect of packet loss.Data transmission is tested by exploiting a model created by internal sensors.Node 1, Node 2, and the gateway are connected through a LoRa module in the prototype as described in Section 4.1.Packages are lost from all test nodes during transmission.Although packet loss was observed whenever the model moved between a test place, this is not a problem because the nodes are expected to remain at the growing farms in the studied area.Therefore, LoRa technology is proven to be effective when deployed in rural areas, without having to turn on acceleration mode on the transfer module shown in Figure 13.

Discussion
The smart agriculture system based on an IoT application has the following advantages compared to the previous approaches:

•
The system can be used to manage two or more independent farms on the same mobile application, which may have different growth schedules.The aim of this research was to use devices of the IoT system with lower prices that are easy to obtain.

•
Removing the need for WiFi on the farm with the application of LoRa technology helps to save energy, lower costs, improve efficiency, and facilitate excellent communication between the farm and gateway.

•
Control data are saved to the system memory to prevent power outages that result in data loss.Furthermore, the multitude of control modes makes it easier for users to manipulate the farm.

•
Real-time updates are available directly from the Internet in order to enable the system to run more accurately.

•
A lost WiFi connection can be detected and communicated to users for timely processing.

•
Many different sensors are integrated to collect information related to tree care in order to improve crop productivity.Our strategy studies five parameters: temperature, temperature-humidity, soil moisture, rain, and water level.

•
None of the previously mentioned approaches discuss and investigate the effect of energy consumption in smart irrigation systems.Furthermore, other methods frequently rely on soil moisture to determine the water needs of plants.

•
The results of the test and the measurement of our smart watering system approach the standard watering procedure as a product of high-tech application.It has an economic efficiency that is at least 30% higher than the used technology.
In addition to the advantages presented above, our research also has disadvantages, which need to be overcome before widespread application.For instance, the ESP8266 module is a mid-range module without a high stability, while the system can lose an Internet connection and depends on the Blynk application.

Conclusions
This paper presents a solution using LoRa module transmission for a low-cost and effective smart agriculture system for use in Vietnam, which is designed and implemented to control environmental factors in agriculture.It is less expensive than other solutions with a similar accuracy.The system can continuously observe the measured values and communicate them to users via a network and mobile application.Furthermore, the system can send alarms to users and activate reduction devices.The IoT node was tested in two separate cases in Cho Lach district, Ben Tre province, Vietnam, and was used to measure distinct values such as moisture, humidity, and temperature.Finally, experiments were performed to determine if the embedded electronics and the wireless communication module might influence the collected values; there were no signs of interference.In summary, the results confirm that the system provides the optimal solution to users of smart agricultural control for farmers in Vietnam.The availability of real-time data enables quick use and management at all times from all places.However, when IoT nodes are placed in various places, they generate huge quantities of data.In this case, our system requires time to store and analyze data before finding the best solution.

Figure 1 .
Figure 1.Block diagram of the proposed IoT framework.

Figure 2 .
Figure 2. Flow diagram of the exchange data between two nodes with Gateway.

Figure 3 .
Figure 3. Block diagram of the proposed gateway.

Figure 6 .
Figure 6.Electronic schematic of the Gateway and Node 1.

Figure 7 .
Prototype of the gateway and Node 1.

Figure 10 .
Prototype of sensor Node 1 and Node 2.

3. 4 . Node 2 Figure 8
Figure 8 shows the block diagram of Node 2, where ATmega328 used five different sensors of the Node 2 provided: temperature, temperature-humidity, soil moisture, rain, and water level.The settings of these sensors work in the article shows inTable 4. Node 2 is designed for orchards

Figure 11 .Figure 12 .
The prototype of the two boxes: gateway on the left and circuitry with all sensors of Node 1 on the right.(a) Sensor node 1 (b) Node 2 The prototype of the two boxes: sensor Node 1 on the left and circuitry of Node 2 with all sensors on the right.

Figure 13 .
Figure 13.Map of the area covered by the LoRa module.

Figure 14 .
Figure 14.Collected soil moisture, humidity, and temperature during the data acquisition campaign carried out on Node 1 of Cho Lach district, Ben Tre province, Vietnam.

Figure 15 .
Figure 15.Collected soil moisture, humidity, and temperature during the data acquisition campaign carried out on Node 2 of Cho Lach district, Ben Tre province, Vietnam.

Table 1 .
A comparisons of our model with existing literature.

Table 2 .
The comparison of the main characteristics of Wireless Sensor Networks.

Table 3 .
Technical specifications of Module LoRa E32.

Table 4 .
Sensors used by our systems.