Abstract

The farmers of agricultural farms manage and monitor different types of livestock. The manual inspection and monitoring of livestock are tedious since the cattle do not stay at fixed locations. Fencing many cattle requires a considerable cost and involves farmers’ physical intervention to keep an eye to stop them from crossing beyond the access points. Visual tracking of livestock and fencing is a time-consuming and challenging job. This research proposes a smart solution for livestock tracking and geofencing using state-of-the-art IoT technology. The study creates a geographical safe zone for cattle based on IoT and GPRS, where the cattle are assigned dedicated IoT sensors. The cattle can be easily remotely monitored and controlled without having any need for farmers to intervene for livestock management physically. The smart system collects the data regarding the location, well-being, and health of the livestock. This kind of livestock management may help prevent the spread of COVID-19, lower the farming costs, and enable remote monitoring.

1. Introduction

Food is a basic need for every individual, and the importance of agricultural industry cannot be overstated. The rapidly growing population of the world reduced farming area because of industrialization, exodus of farmers to urban areas, and climate change which are some of the factors that are challenging the agricultural industry to the next level. A stable and progressive agricultural industry is extremely important to feed the ever-increasing population of the world.

The world economy was driven mostly by agriculture until the 18th century. Around 1760, the first industrial revolution started with the invention of the steam engine. The large-scale mechanization resulting from this revolution started luring farmers to abandon their farms and move to urban areas for socioeconomic benefits. The second and third industrial revolutions in the next two centuries accelerated this migration process resulting in increased abandonment of farmlands. Shengfa and Li [1] analyzed farmland abandonment in various regions of the world since the 1950s. The study argues that the phenomenon is more pronounced in more advanced regions of the world, and this trend is expected to continue in the future too.

Today, we are at the cusp of the fourth industrial revolution which is driven by several disruptive technologies including but not limited to sophisticated machine learning algorithms, Artificial Intelligence (AI), Internet of Things (IoT), Unmanned Aerial Vehicles (UAVs), robotics, and quantum computing [2, 3]. Such powerful technologies have already changed our lives dramatically. They have found application in almost every domain of life, and agriculture is no exception. Artificial Intelligence and machine learning technologies have been applied in analyzing and managing soil [4], crops [5], livestock [6], and water resources [7]. Computer vision techniques have been employed for addressing several issues in agriculture such as plant disease detection [8], insect detection [9], farmland management [10], and crop yield analysis [11]. References [12, 13] provide excellent reviews of the application of IoT technologies in agriculture. Precision farming is another technique in agriculture that has seen significant boost because of invention of cheap sensors and UAVs [14].

A satellite navigation device (commonly called a GPS receiver) can be used to determine its position using a satellite navigation system. As of today, there are four active satellite navigation systems that provide global coverage, namely, Global Positioning System (GPS) by the United States, Galileo by Europe, GLObal NAvigation Satellite System (GLONASS) by Russia, and BeiDou by China. A satellite navigation device may be attached to any object to track and monitor its position in real time. A geofence can be established by defining a closed polygon referring to a geographic area on earth. A location-aware device can then make use of this geofence to trigger alerts when the object enters or leaves the area defined by the geofence.

Internet of Things (IoT) is an extremely exciting set of technologies that is already shaping the future of humankind. IoT is based on the concept of uniquely identifiable interconnected devices (such as sensors, computers, and mechanical devices), collecting the data, and storing it in the cloud that is processed by intelligent algorithms to achieve common goals. IoT has several applications in almost all domains of life. References [1517] provide excellent reviews of some such applications.

Livestock monitoring is another important aspect of farming. Traditionally, cattle were monitored manually and confined in farms by building physical fences. However, advanced technologies have made it possible to track and monitor the cattle automatically. Navigation satellites and Global Positioning System (GPS) are extensively used for tracking the position of cattle. UAVs have made real-time monitoring of cattle a cost-effective and hassle-free task. Radio-frequency identification (RFID), wireless sensor networks, and the Low Power Wide Area Network (LPWAN) are other potential technologies for establishing virtual fences to keep the farm animals in a confined area.

Smart farming concept relates to location-aware devices to monitor the movement of animals and raise alerts when they violate the boundary of the geofence of the farm or pasture. Additionally, IoT sensors may be used to monitor the health and well-being of farm animals. References [18, 19] proposed a device that is based on the satellite navigation system to track the position of an object to which it is attached. The position is transmitted through an available wireless transmission medium such as a radio frequency, wireless, or cellular network. References [2022] described a geofencing scheme based on the geographic area being divided into one or more grids. The proposed scheme exploits this grid structure to optimize computational resources required for location monitoring because a complex polygon requires more calculations to achieve the desired goal.

Figure 1 presents the number of research articles published from 2010 to 2020 on remote livestock tracking. It can be seen that there is significant scope of remote monitoring of livestock employing the latest technologies. With the passage of time, the researchers have devised enhanced solutions in this problem domain. Despite a good number of cited works, still, the need to address the issues related to optimized geofencing is on the way.

References [2325] also proposed the concept of geofencing by providing auditory feedback and light electric shocks to an animal wearing a tracking device. Through these feedback mechanisms, the device can effectively guide an animal from one to another location. It may also be used to keep an animal within a geofence defined by its owner.

References [26, 27] proposed an implant device for tracking the location of an animal in addition to monitoring its health and well-being. The device also contains enough storage to record medical information about an animal such as past surgeries, any disease, medication, and owner contact information.

Safeguarding against theft of animals is an obvious application of the ability to monitor the location of an animal in real time. To this end, researchers have proposed several systems that can be used to minimize the chances of animal theft. Reference [28] proposed such a system based on a centralized database to store livestock details, radio-frequency identification (RFID) tags, and an available communication technology such as a cellular network. The proposed system employs several heuristics to identify theft of animals. One such heuristics marks an animal as “stolen” if the animal is found in a geographic location that is considered “far” from the registered location of the animal and its geofence for gazing. Another heuristic is discovery of an animal having registered a location drastically different from that of other animals in a herd. Reference [29] proposed a similar system that uses wireless sensor networks and unmanned aerial vehicles for animal tracking and identification.

Several researchers have proposed IoT-based frameworks for geofencing as well as other aspects of smart farming. References [3035] proposed various systems for monitoring of livestock through data recorded using sensors and network communication nodes. References [3638], in addition to collecting the data, also proposed means for automatically analyzing the data and an interface to monitor the livestock. Reference [39] proposes the use of a long-range Low Power Wide Area Network (LPWAN) technology to collect and process several parameters related to the health of cattle as well as their environment. The data recorded by sensors is relayed to one or more gateways through long-range end devices. This data is subsequently processed by an application server and presented to the user for visualization and analytics. A C++ simulation shows that the proposed architecture can effectively cover an area of 7 km2 in a rather harsher hilly terrain. Reference [40] proposed a similar solution based on Long-range Wireless Access Network (LoRaWAN) technology. The use of LoRaWAN makes such solutions more feasible in rural areas with poor cellular or Internet coverage.

Many different satellite navigations have been considerably employed to determine the position of livestock. We can observe four active satellite navigation systems providing global coverage, namely, the Global Positioning System (GPS) by the United States, Galileo by Europe, GLObal NAvigation Satellite System (GLONASS) by Russia, and BeiDou by China. It is very contemporary to navigate through satellite nowadays. Commonly, a satellite navigation device is attached to the livestock under monitoring, and the device can promptly track and monitor the position of the livestock in a real-time scenario. In addition to this navigation, a dedicated geofence can greatly help in defining a closed shape, normally a polygon, that refers to a geographic area on earth. A location-aware device can then make use of this geofence to trigger alerts when the object enters or leaves the area defined by the geofence. A number of cited works highlight that geofencing-related solutions are more appealing for remote livestock monitoring.

Table 1 presents a brief summary and comparison of the research works discussed above. We can see many different solutions of remote livestock tracking. We can see that safeguarding the livestock appears as an obvious application of the ability to monitor the location of an animal in real time. Until now, the researchers have proposed several systems that can be used to minimize the chances of animal theft based on RFID tags, wireless sensor networks, unmanned aerial vehicles for animal tracking and identification, long-range Low Power Wide Area Network (LPWAN) technologies, GPS, IoT, and GPRS. Despite a good number of cited works, only a few researches can be identified that focus on the geofencing for livestock monitoring.

3. Methodology

Varieties of cattle in a paddock have genetically different grazing, sleeping, and playing patterns. Goats and sheep are more active, and they have different food intake and digestion systems than cows and buffalos. The current livestock management systems mostly employ IoT and GPS sensors connected to satellite and GPRS for navigation and communication, respectively. GPS and GPRS sensors consume device energy and communication bandwidth. Besides, the same set of sensors is installed for all livestock categories despite genetic diversity among animals in the same herd. In addition, the conventional tracking systems track the movements of livestock without any profound geographical boundaries that become challenging in case the animals go very far from the main access points. To address these issues, this research study proposes an enhanced management system that provides convenience to farmers to define a geographical safe zone for livestock. The farmers are notified by the system when cattle try to go beyond the defined boundary of the zone. Besides, the navigation and communication are automatically controlled according to the genetic diversity of different animals.

Figure 2 presents an overview of the conceptual framework of the proposed system. The red ellipse represents a drawn geographical safe zone for the livestock. Ultrasonic sensors installed at the elliptical boundary of the safe zone identify the movements of the cattle. The ultrasonic sound waves propagate and discover the presence of livestock, and its distance is calculated. If the distance of the cattle crosses the defined safe-distance threshold, the communication navigator is activated. The animals in the herd are equipped with navigation sensors that sense the locations of animals by navigating through the satellite. The system calculates the distance of each animal from the safe zone geographical boundary and alarms the farmer when the distance of the animal gets close to a threshold value. The proposed system glimpses the exact location of animals in case the animals are out of the safe zone for a specified period. The motion sensor suspends the navigation and communication when the animal is recorded in a static state to optimize the energy and communication bandwidth for significant utilization.

Figure 3 presents the implementation scenario of the proposed framework described in Figure 2. We can see different steps involved in tracking a whole herd or particular cattle in the herd based on sensing the location coordinates and having communication with the system through the communication channel. An elaborative presentation is presented in the following algorithm: (1)A herd may contain a variety of livestock with any number depending on the nature of business and local facilities available to farmers for keeping and managing animals. For the moment, we suppose that a typical herd can contain a maximum of animals defined as , (2)Since the currently proposed system tracks the locations of animals contained in herd , we need a navigation sensor to connect individual cattle with the communication satellite to receive the location coordinates of each animal. Besides, since the system needs to analyze the latest distance of animals from the defined safe zone, we need to pass these location coordinates to the system through the communication channel. For this, we need to equip animals with and navigation and communication sensors, where (3)Since primarily the system is supposed to keep the animals in a defined safe zone, in order to maximize their security, grazing, and leisure period, we define a safe zone with geographical coordination points such that (4)The ultrasonic sensors sense the cattle crossing the safe zone and alarms/alerts the GPS sensor to initiate detecting the location of (5)The geographical sensors installed calculate the geographic coordinates of livestock by communicating with the satellite. We identify the geographical coordinates of an animal such that (6)For the sake of comprehensive and timely analysis of calculated coordination points, we need to transmit the identified coordinates of animal to the system through the communication channel(7)Next, we calculate the distance of animal (having coordinates using coordinates ) with defined safe zone such that , where is the defined threshold distance(8)Now, we evaluate that the distance , where is defined as the threshold distance for animals to keep safe in the safe zone

Let us create the instances , , , ,…, , where (forward and backpropagation of waves from the ultrasonic sensor).

The time can be defined by (9)In this case, if the result is (calculated is not less than threshold ), then the system alarms the farmer to locate the animal and get it back to the safe zone(10)Otherwise, the system resenses the current location of livestock after a defined period

Contrary to the conventional livestock tracking system where the farmers have to sometimes do a physical exertion for tracing the cattle that go beyond the common access points, the defined safe zone provides convenience with secure and prompt management. Besides, in the case of lazy livestock that do not change their locations more frequently, the system can significantly save power consumption and communication channel utilization. In the scenario where the farmers require a more substantial safe zone, there is very low probability for livestock to go beyond safe zones by exceeding the location threshold. The proposed system is equally suitable for the sensing devices equipped with a solar panel for power supply.

4. Experimentation

This study designed a geographical paddock to monitor the spatial, temporal behaviors of livestock. It is a contemporary phenomenon that different livestock animals have different patterns of grazing, movement, and resting events. The frequency of these events varies from animals to animals, and mostly, they are related to the genetics of individuals and the current psychological states in rare cases. The tracking phenomenon of livestock is tremendously attributed to such spatial, temporal events reflecting the allocation of appropriate sleep time units to hardware for saving energy and communication bandwidth.

Figure 4 describes the visual implementation of monitoring of livestock using a defined geographical paddock through remote sensing of their spatial, temporal activities. The yellow and red circles represent warning and alarming zones for the farmers or caretakers. The ultrasonic sensors sense the cattle crossing the safe zone and initiate the GPS to trace the location of . The application calculates the geographical distance of each animal , for an number of animals in the herd . The application also defines a distance threshold that helps to match the current difference of with the safe zone . When (having geographical coordinates ) approaches , the absolute geographical distance is calculated and compared with threshold . The application warns the farmer in case the difference of two geographical distances seeks the threshold value. Similarly, the farmer gets a warning notification when the said difference of distances exceeds the defined threshold . The warning alarm helps the farmer to get an alert on the current location of , and the farmer may carefully observe the movement of .

Figure 5 describes the detection and tracking phases of the proposed system. The ultrasonic sensors connected to Arduino sense the presence of cattle. The ultrasonic sensor data is sensed through ThingSpeak. At first, the Arduino initializes the ultrasonic sensor to collect its data. The distance of the cattle is calculated, and the Arduino forwards the distance to the ESP8266 module using serial communication. We need to choose a threshold value for the sensors to sense the obstacle and to calculate the distance. Based on the calculated distance, the serial communication helps ESP8266 to convey the distance to ThingSpeak using a communication channel.

The distance of cattle from the sensors is measured using the following formula: ; here, the level of humidity and temperature impacts the speed of the sound wave at a particular place.

Once the system detects the cattle going beyond the safe zone, the GPS module attached to Arduino is activated, and the module connects to nearby satellites and starts reading the current location coordinates of the cattle. These location coordinates are passed to the farmer’s mobile through the communication channel attached to Arduino.

Figure 6 presents an overview of hardware components employed for livestock detection and tracking. Figure 6(a) depicts an Arduino Uno microcontroller board manufactured using Microchip ATmega328P. This microcontroller board has been used to connect the detection and navigation components. Figure 6(b) shows an ultrasonic HC-SR04 sensor that uses SONAR to detect the livestock and determines its distance from the safe zone. Figure 6(c) is the NRF24L01 wireless module used as a communication module in the setup. Figure 6(d) presents the hardware modules installed for livestock identification and tracking. In the experimentation, the ultrasonic module detects the presence of livestock by calculating and comparing its distance with the safe zone threshold defined in the system. The navigation module is activated to track the current location of the animal once the system identifies the cattle breaching the designated safe zone. The navigation coordinates are communicated to the network using a communication channel. The farmer can locate the current location of those cattle that are outside the safe zone. This provides automated fenceless farming to farmers by remotely identifying the current situation of all cattle in a heterogeneous herd.

Table 2 presents an experimental scenario in which a variety of livestock at different instances of time access the safe zone boundary. The ultrasound sensors sense their distance comparing it with the defined threshold . The farmers receive the mobile notifications for the cattle that cross the safe zone, and their location coordinates assist the farmers in tracking the current location of livestock. The sound waves emitted by sensors are mechanical in nature and travel using a medium. It has been noticed that certain environmental conditions, i.e., humidity and temperature, may also impact the performance of such sensors. Since these sensors are being employed for the detection of livestock pertaining to a distance threshold compared with the distance of cattle from the safe zone boundary, the environmental conditions do not impact the sensor performance degradation for the detection of cattle. The significant outcome of this detection mechanism is to detect the livestock without impacting any physical damage to them in the course of longitudinal compression of waves having a frequency of 100 kHz to 50 MHz.

The significance of the proposed livestock management system reflects in reducing the time and energy complexity of the system and integrated modules, as shown in Figure 7. A variety of livestock have different grazing patterns genetically, and thus, their physical activities are proportional to these genetic behaviors [5254]. It has been observed that certain livestock, e.g., cows and buffaloes, are sluggish as compared to goats and sheep. Once the cattle have gone through the graze period, the physical excitement to intake more food is considerably reduced, and the livestock prefers to have rest or lay down for a long time. During this inactive or passive activity, the safe zone ensures that the cattle remain inside the geographical boundary and do not step out. This way, the tracking system is not required to be initiated to record the locations of cattle since the cattle are already inside the safe zone parameters. Goats and sheep, on the other hand, are more physically active even after the intake of proper food. The probability of such livestock is higher than the sluggish or passive livestock. The tracking of active livestock might be frequently required in this case as compared to cows and buffaloes. The proposed system signifies the avoidance of unnecessary utilization of resources, i.e., time, energy, and effort. All three scenarios defined in Figure 6 describe that the probability for goat or sheep to cross the geographical threshold is much higher than cows followed by buffalos.

Figure 8 presents the average probability values for tracking different livestock under certain restrictions, i.e., considering different scenarios of the safe zone and without a safe zone. The red line in the legend describes a uniform probability of tracking all livestock without having consideration of a safe zone. The existing approaches, cited in the literature, track the livestock right away, syncing with the initialization of the tracking system. This phenomenon assigns the same probability values to all livestock irrespective of their genetic type and behaviors and thus results in wastage of system resources. On the contrary, the concept of adopting a geographical safe zone ensures that genetic behaviors and activities of different livestock are taken care of while tracking their movements. In all scenarios described in Figure 6, it can be observed that the average tracking probability of different livestock is quite different from each other. For instance, the average likelihood of tracking goats or sheep is higher than that of cows and buffaloes. Besides, the cows have a somehow higher average tracking probability as compared to the average likelihood of buffaloes. Hence, the proposed livestock detection and tracking system are significantly context-aware (as per genetics of different livestock).

5. Conclusion

This study proposes design of a geographical paddock to monitor spatiotemporal behaviors of livestock. In a conventional livestock tracking system, the farmers have to do physical exertion for tracing the cattle that go beyond the common access points. The proposed solution addresses these issues by providing convenience to farmers to define a geographical safe zone for livestock. The farmers are notified by the system when cattle try to go beyond the defined boundary of the zone. Besides, the navigation and communication are automatically controlled according to the genetic diversity of different animals. The system calculates the distance of each animal from the safe zone geographical boundary and alarms the farmer when the distance of the animal gets close to a threshold value. The proposed system glimpses the exact location of animals in case the animals are out of the safe zone for a specified period. The motion sensor suspends the navigation and communication when the animal is recorded in a static state to optimize the energy and communication bandwidth for significant utilization. The significance of the proposed livestock management system is reflected in reducing the time and energy complexity of the system and integrated modules.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

The authors extend their appreciation to the Deputyship for Research & Innovation, Ministry of Education in Saudi Arabia for funding this research work through the project number IFT20172.