Abstract

A wireless sensor network is a large sensor hub with a confined power supply that performs limited calculations. Due to the degree of restricted correspondence and the large size of the sensor hub, packets sent through the sensor network are based primarily on multihop data transmission. Current wireless sensor networks are widely used in a range of applications, such as precision agriculture, healthcare, and smart cities. The network covers a wide domain and addresses multiple aspects in agriculture, such as soil moisture, temperature, and humidity. Therefore, issues of precision agriculture at the output of the network are analyzed using a star and mesh topology with TCP as the transmission protocol. The system is equipped with two sensors: Arduino DFRobot for soil moisture and DHT11 for relative temperature and humidity. The experiments are performed using the NS2 simulator, which provides an improved interface to analyze the results. The results showed that the proposed mechanism has good performance and output.

1. Introduction

Movement types (like satellite trajectories), sensor systems, network preparedness, pervasive figuring, and the associated selection support improve the outline and important association limits [1]. Wireless sensor networks in Figure 1 are a collection of specific transducers with an exchange base to monitor and record the conditions at nodes, which routinely include the parameters of temperature, stickiness, weight, wind headings, and pace. This information helps motivate and drive prerequisites, key body limits, sound power voltage, undermining level, vibration power, and compound obsessions.

A wireless sensor network (WSN) is also called a wireless sensor or wireless sensor advance network (WSAN) and is a collection of free sensors that screen physical or steady conditions, such as temperature, sound, and weight. This information is transmitted through the network to a focal area. Current networks are bi-directional and enable sensor control. Advanced WSNs have been used for military applications as battle zone affirmation. Such networks are also used in various mechanical and customer applications for event monitoring, network status assessment, machine accomplishment sensing, etc.

Sensors are used to gather information about common physical quantities; however, actuators are used to react to and control the reported circumstances. The sensors collect information that describes the object or environment and are used to provide information on people, areas, objects, and their states. Association securing shows the conditions of spaces that have social events at the time of collection, including for agribusiness. Creating space addresses some necessities, including (1) air collected, harvest, and soil data, (2) monitoring of coursed zones, (3) various yields on an area bundle, (4) distinctive compost and water that are central to different uneven zones, (5) diverse necessities of harvests for various air and soil conditions, and (6) proactive strategies instead of responsive blueprints. A simple structure of sensor is given in Figure 2.

There are several applications of sensor networks. These include frustration encouraging operations, drop sensor focus from a plane over a quickly spreading fire where every point measures the temperature to derive a “temperature map.” In addition, these sensors can generate biodiversity maps or watch wildlife. Intelligent networks (or expansions) can help reduce centrality waste based on the formed stickiness, ventilation, and cooling control. This allows estimating room inhabitance, temperature, and wind streams. Such networks can screen mechanical issues after earthquakes and machine acknowledgment for preventive upkeep. Embedded sensing/control distinguishes changes in systems, such as tire weight checking or accurately determining the status of compost/pesticides/watering systems. In the health industry, such applications include long-term perception of continually handicapped patients or the elderly.

Sensors have been used for a long time in various networks. The rule indoor controller was established in 1883, and many consider this as the basic, present-day, assembled sensor. Infrared sensors have been around since the late 1940s and have recently become standard devices. Progression markers have been utilized for many years. The sink node assembles data in wireless sensor systems, which means that data gathering may skip samples or perform multibounce where all sensors store data that is sent to the base station, which is called the sink focus. Every middle point in the sensor network contains three subsystems. The first senses the environment, the second readies the subsystem to perform neighborhood estimation on the perceived data, and the third handles message exchange.

A static sink focus is typically used for data gathering for a wireless sensor system using multiricochet sending, indicating that it is more critical to be utilized near base points on the base station and transferring data from other sites. An adaptable sink focus is generally used to collect all the data from sensor focus points and send it to the base station. A WSN routinely incorporates expansive totals of focuses performing nearby to wirelessly shape networks. Each middle point is self-overseeing and has a short total range, indicating they are valuable and viable over a large zone. The typical sections of a network are as follows:(i)Sensors: reaped or set away from power hotspots for party and transmitting data about the environment(ii)Access network: sink focus gathering data from a collection of sensors and engaging correspondence with a control focus or outer segments(iii)Middleware: software to gather and process the information(iv)Application platform: a progression stage for the exceptional use of a WSN for a specific application

Many studies proposed very efficient techniques to get significant results; many of them discussed data gathering, energy consumption, monitoring mechanism, and network techniques such as Zigbee, Bluetooth GPRS, and others. After literature review, some research questions are raised:(i)How much fast data is delivered?(ii)What data rate is needed? How much throughput of the network could be good for data transmission?(iii)What is the data delay among the nodes?(iv)What is the ratio of packet lost?

To find the answers of the above-mentioned questions, we proposed a mechanism to get reliable results. The results show the actual performance of network output. In our mechanism, we take 2 sensors and deploy them via mesh topology by using NS2 simulator.

2. Literature Review

Akyildiz et al. [2] found that farming is a rich application space in which the limits of utilizing WSN and WSAN are high. The WSN persistently works in surprising conditions and its wireless directivity is slip-up slanted due to the obstructions brought by environmental conditions. The transmission operations in WSN are unequivocally required in some key applications. Kang et al. [3] showed that WSNs have been considered for their potential application in various fields like prosperity care, disaster organizations, global positioning systems, furnished powers, environmental sciences, and cultivation. In sensor applications, the openness of benefits is adaptable and available to achieve a sensible network lifetime. Chen and Varshne [4] found that , in wireless sensor networks, it is an issue to delineate sensible guiding customs to execute different applications in different environment. In this partnership, Aces have proposed specific controlling customs to overhaul execution requests for unmistakable applications through the network layer of conventional wireless sensors.

Tanwar et al. [5] indicated that WSNs are self-sorting and include different types of sensor focuses for wireless operability. Creating, battle zone and military perception, living space monitoring, security learning, achievement monitoring, observations of standard catastrophes like timberland fires, mechanical technique control, and speedy transportation are some of the applications of WSNs. Wireless sensor focuses rely on inherent and compelled essential resources and are placed in wireless environments to collect information. Reducing the power consumption of a sensor focus point helps extend its lifetime.

Mahfooz et al. [6] illustrated that WSNs include the correspondence of small perceiving segments that work together to gather information, arrange, and surrender over wireless channels regarding physical phenomena. The self-overseeing and criticalness of these important networks can be prominent means to monitor underground mining, untamed wildlife, and contrasting physical establishments for cases, stages, pipelines, and networks. Developing countries have a multifaceted test in utilizing and tracking important resources. While the explanations for inefficient utilization of preferences are insufficient and without clear solutions, focus has shifted to using small-scale electronic contraptions to handle these issues, which require reporting properties of particular physical phenomena. The interface with the physical world creates adaptability for operations and wireless control.

Abouzar et al. [7] also proposed a mechanism to solve the inference problem in message delivering by using Receive Signal Strength Indication-based self-localization by deploying Bayesian algorithm for information aggregation. Praynlin and Ida Jensona et al. [8] selected two datasets, namely, SoDa (Solar Radiation Data) and NCEP (National Center for Environmental Predictions), to forecast average daily solar irradiance using two models (RBFN and BPN). Two-year data was used for training of the network and one-year data was used for testing. The RMSE values were observed to be less for BPN, precisely 3.12 MJ/m2 and 3.212 MJ/m2 for the two datasets.

Srivastava et al. [9] performed prediction of average daily solar intensity 6 days ahead using Model Averaged Neural Network (MANN). Nine parameters including time, average temperature, minimum temperature, maximum temperature, rain, wind, dew point, atmospheric pressure, and azimuth were given as inputs to neural networks. Model was compared with FFNN, RBFN, and BPN. Average of monthly RMSE for 12 months was observed to be less for MANN with a value of 204.52 W/m2.

3. Materials and Methods

NS2 is a discrete-event network simulator that was developed in 1989 as an improvement to an earlier network simulator. This simulator is a combination of C++ and OTcl, making it an object-oriented scripting language. Support for wireless networks was added in 1997, which was designed to simulate wireless LAN protocols, though this was later expanded to mobile ad hoc networks. A project at the Naval Research Laboratory produced an extension to the NS2 for sensor webs. This extension adds a phenomenon channel module to model physical phenomena such as sensor nodes and the environment. Although NS2 has been used to evaluate WSNs, the accuracy of the results is questionable as the MAC protocols, packet format, and energy models are different from those of typical sensor web platforms. NS2 began as a variant of the REAL network simulator in 1989 and has evolved substantially over the past few years.

3.1. NS2 Scenario Generator (NSG)

The NS2 scenario generator (NSG) is a tool that can run on any platform and generate TCL scripts for wired and wireless scenarios. The main features of the NSG are as follows:(1)Create wired and wireless nodes via drag and drop(2)Create simplex and duplex links for wired networks(3)Create grid, random, and chain topologies(4)Create TCP and UDP agents while supporting TCP(5)Tahoe, TCP Reno, TCP New-Reno, and TCP Vegas(6)Support ad hoc routing protocols such as DSDV(7)AODV, DSR, and TORA(8)Support FTP and CBR applications(9)Support node mobility(10)Set the packet size, start time of simulation, and end time(11)Time of simulation, transmission range, and interference(12)Range of wireless networks(13)Set other network parameters, such as bandwidth for wireless scenarios

The NS2 was developed by UC Berkeley and is an open-source software simulation platform for network technologies. The program is a discrete event simulator with a virtual clock where all the simulations are driven by discrete events. The abundant modules it contains, which include nearly all aspects of network technologies, allow researchers to easily develop a network technology. NS2 has become one of the first selected software applications to implement network simulations in academia.

4. Results

Two sensors (Arduino DFRobot for soil moisture and DHT11 for relative temperature and humidity) are used in the experiments for different networks. The results are analyzed using the NS2 simulator. The DSR wireless routing protocol is used in the simulation experiments. To communicate between sensors in the TCt3g5fr7u6t5P wireless communication protocol, ten, twenty, fifty, and one hundred nodes are used to make the network and validate the data rate, throughput, packet loss, data delay, and data delivery ratio for the sensors.

4.1. First Scenario

The Arduino DFRobot soil moisture sensor was used to create a network of ten nodes for the simulations as shown in Figure 3, which gave the following results. We transmitted 2685 packets over the network and received 2622 packets. There were 272 routing packets. A total of nineteen packets were analyzed and data lost were 3236 bytes in 10 nodes network. Throughput and delay were 213.02 and 792.21, respectively. As shown in Figure 4, there was an apparent loss of packets. The data loss ratio was low and the throughput was low.

4.2. Second Scenario

The number of nodes was increased to twenty and the same procedure was applied in the NS2 simulator. For the twenty-node network with a star topology, it was seen that the packet loss ratio increased, and the throughput decreased relative to the ten-node network. 2351 packets were sent and 2293 received where 290 were routing packets. The number of dropped data packets and dropped data was 23 and 1895 bytes, respectively, with a packet loss ratio of 0.07%. Throughput and delay were 186.31 and 727.84 approximately. In Figures 5 and 6 a better view of the results could be seen.

4.3. Third Scenario

As shown in Figure 7, the third simulation considered fifty nodes with the reasonable results. In this scenario, we transmitted 3047 packets and received 2985 with the loss of 62 packets, where the packet loss ratio was 0.12; we got an average delay of 672.62 ms and throughput of 242.94 kbps. Dropped data bytes were 5536 recorded. 420 packets were considered as routing packets. We present the above-mentioned results in Figure 8 for better analysis and understanding.

4.4. Fourth Scenario

The final scenario used one-hundred-node network with the same process. Sent and received packets were 2657 and 2597, respectively, with 0.11% packet loss. During transmission, 60 packets were dropped and dropped data ratio was 6516 bytes. We noticed 779.40 ms average delay and 211.21 kbps throughput.

The simulated output results for the two sensors differed as the number of nodes increased. When there were more nodes, the packet loss ratio increased, and the throughput decreased. Analyzing the procedures for precision agriculture indicates there are no problems with the sensors, but there are slight problems in the network side at the back end. In the first simulation, there are only ten nodes. The analyzed output of the simulations indicates that if there is a small number of packets, then the percent packet loss is higher. However, in the fourth scenario, the situation is different, as shown in Figures 9 and 10 for the one-hundred-node network in both sensors’ simulations. If a larger number of nodes are required, the network will collapse because the data lost ratio increases. However, it is more important to analyze the data throughput, which ptis a key aspect of successful communication networks. If the throughput is high, the network is considered to be working successfully. However, the simulations indicate that throughput decreased with the number of nodes, which is harmful to the network.

Precision agriculture is a vast domain with several sensors used to measure many aspects. However, the simulations only considered two sensors to determine the issues that may occur when establishing a network. In the experiments, all the issues were from the network, such as packet loss, packet drops, decreased throughput, and decreased data delay.

5. Conclusion

A WSN, also called a wireless sensor or WSAN, includes wrapped sensors that screen physical phenomena or steady conditions to monitor phenomena such as temperature, sound, and weight and pushes their measurements through the network to a focal area. Most existing networks are bidirectional to enable sensor control. The development of WSNs includes two or three of the following: (1) data for air collection, harvesting, and soil, (2) monitoring coursed zones, (3) various yields from an area, (4) different fertilizers and water fundamentals to various parts of an uneven zone, (5) diverse necessities of harvests for various air and soil conditions, and (6) proactive strategies instead of responsive blueprints. Sensors have been around for some time in various networks. The rule indoor controller was made in 1883, and many consider this as the basis for current assembled sensors. Infrared sensors have been around since the late 1940s and have become ubiquitous in recent years. Progression markers have also been utilized for many years. In this study, NS2 simulator was used for analyzing the results which have better environment for evaluation and experiments. We set up a virtual environment. We used different topologies for different scenarios to get better numbers. The simulation results are from two different sensor types that have differing outputs for a greater number of nodes in the network. It is seen that as the number of nodes increased, the packet loss ratio increased, and the throughput decreased. Analyzing the procedures in precision agriculture indicates there are no problems with the sensors, but there are issues in the network at the back end. In the first simulation, there are only ten nodes. The output of the simulations suggests that a small number of packets have a greater percent loss of packets. However, the results of the fourth scenario are quite different, as shown in the graphical representation of the one-hundred-node network in both sensor simulations. Only network issues in precision agriculture are discussed here. Packet loss in all scenarios is low but loss of data is not better for communication. Delay must be decreased in the future, but the throughput should be increased. There are many opportunities for future research to analyze the algorithms to overcome these issues to determine sensor functionality concerns.

Data Availability

The datasets used for this study can be obtained from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest.

Acknowledgments

This research was supported by Taif University Researchers Supporting Project (number TURSP-2020/254), Taif University, Taif, Saudi Arabia.