Animal Health Monitoring and Intrusion Detection System based on LORAWAN

In this paper, two important aspects of wildlife monitoring namely Health monitoring and Animal-vehicle collision (AVC) avoidance are addressed. Wildlife health monitoring is an important requirement in forest management. This necessitates monitoring the wellbeing and tracking of animals. In this work, temperature sensor and heart rate sensor are used to monitor the health condition of elephants. The sensors will give an indication, if the elephant’s body temperature and heart rate are not in range. An animal tracking system using Global Positioning System (GPS) is provided for remotely monitoring animal position. Internet of Things (IoT) technology is used to transmit the collected data from the sensors to a remote station where the data is stored in a database. If there is any critical condition identified, the system alerts the concerned officers/veterinary doctors to provide necessary treatment immediately. AVC is another important issue that affects wildlife heavily. In order to counteract AVC, a unified approach of Smart Animal Intrusion Detection System that monitors the movement of animals by integrating a number of sensors with LoRaWAN network, is proposed in this paper. Performance analysis of the proposed system is investigated using CupCarbon Software.


Introduction
Animal health monitoring is one of the important needs for preserving the natural resources of the country. Hence it is required to monitor the wellbeing and movement of the animals within a forest region [1]. Various wearable and implantable biosensors are designed to support remote health monitoring of animals [2]. Wireless sensor network (WSN) aids the health monitoring system by integrating the sensors with advanced wireless technologies [3]. For example, the physical condition of the animals can be monitored in real time using IoT technology [4]. Various techniques are proposed in the literature to monitor health condition of animals and their movements using IoT based WSN [5][6][7][8].
Animal-vehicle collisions (AVCs) affect animal life and human safety. In order to avoid potential collisions, animal detection systems must be installed to detect animals and repel the animals back into the forest [9][10]. Repellents work by an animal's natural aversion to something like chemical spray, electronic pet barriers, and signals from ultrasonic devices. Ultrasonic devices can generate ultrasonic waves of various frequencies (> 25 kHz). They offer safe and humane way of controlling animal intrusion and do not affect the human beings due to their operating frequencies that are way above the audible range of the human ear. Various methods are proposed in literature to avoid AVC and implement effective repellents [11][12][13][14].
This paper presents the implementation and results of a unified approach to detect animals near roadways and railways. Animal intrusion detection system is generally installed for early detection of the animals at the borders of the forest region. Animal entry is detected by the sensors like Passive Infrared (PIR) and motion sensors, at the boundary and is communicated to the central base station through LoRaWAN Technology. The significance of LoRaWAN is that it enables long range of communication over a wireless channel, while consuming less power. On receiving this information, the base station activates the silent siren and deters the animal away from the roadways and railways. A Graphical User Interface (GUI) has also been developed to display the farm conditions and intrusion zones. The frequency at which LoRa operates differs according to the geographical location of the country. In India, the operating frequency is 865-867 MHz of the unlicensed Industrial Scientific Medical (ISM) band [15].
The primary concern of the proposed work is the application of the sensors to avoid AVCs without harming the animals and repelling them back into the forest. Also, the forest officials make sure that water and other resources are available inside the forest region to avoid the starvation of animals. Introducing the LoRaWAN technology in this field will enable better surveillance due to its longer range and lower power consumption and the fact that it can be connected to the IoT cloud, from which information can be extracted by the user.
The paper is organized in such a way that the introduction to the proposed work is discussed first, followed by the proposed work and its block diagram. The proposed work includes animal health monitoring and AVC avoidance. Successively, the paper deals with the results and discussion, in which both hardware and simulation results are presented. It is followed by conclusion, acknowledgement and references.

Proposed Work
In the proposed work, a number of sensors are integrated to a LoRaWAN gateway that can communicate over a wireless medium, in order to deliver real time information about the movement of wildlife to the forest authorities. The objective of this work being to provide reliable data to the users in a secured manner, it promotes better protection to wildlife and resources and ease of work for the forest department. This objective is achieved by establishing a connection between the gateway and the nodes that are remotely placed in an uncontrolled terrain. The block diagram of the proposed system is shown in the Fig. 1. The sensors namely, PIR Sensor, Motion sensor, GPS and biomedical sensors are connected to the LoRa modules and they sense the movement of animals across the forest border, and transmit data to the gateway through the LoRa shield. This shield works at a frequency range of about 865-867 MHz. The gateway in turn is connected to a cloud server from which data can be extracted by the user via a webpage and/or Android app. This system will provide the exact location of the area of mishap(s) thereby facilitating timely actions to be taken by the authorities. The block diagram in Fig. 1 gives a rough glimpse of the hardware components used in the proposed system. The sensors are deployed based on the terrain. Gateway will be triggered if at least one sensor detects the animal. In some places, more than one sensor will be deployed for reliable detection. The proposed system has been implemented in the Pannimadai region, Coimbatore District, India. Pinging can be performed to check whether a proper connection is established. The next step would be to register the configured gateway with a network server, such as The Things Network (TTN), an open-source decentralized infrastructure for Internet of Things, for which a user account has to be created. Further, each and every node should be configured on the TTN cloud. This is achieved by creating an application and a device on the TTN console.
Creating a device generates three parameters: a network session key, an application session key and a device address. These keys should be copied to the code on Arduino IDE at the appropriate locations. This enables the nodes to communicate with the gateway and the network server. After connecting the components and running the code, the output appears on the TTN webpage with the support of proper payload formats. The acquired data can be further viewed on an Android application or a webpage. Here, Ubidots is the application server deployed and it extracts the data from the TTN network server. This server has a web page and an Android app on which data can be viewed. SMS and email alerts can be sent through this webpage using a threshold-based mechanism. Through this, suitable alerts can be rendered at appropriate times.
ii) Animal Tracking and Health Monitoring The proposed system consists of elephant health monitoring and tracking sub-system. The biosensors are used to continuously monitor the body temperature and heart rate along with the animal position tracking. Normal body temperature range varies from animal to animal. The normal body temperature of an elephant is 35.5 degree Celsius or 97.7 degree Fahrenheit. Whenever the elephant is not well, there will be a deviation in the body temperature value. Heart rate (HR) of an elephant is also sensed by using heart rate sensor and it reflects the physical state of the animal. The standard heart rate of elephant is 25 to 35 beats per minute. GPS module is used for tracking the animal's position. The collected sensor values will be stored in cloud database which can be used by authorized officers or care takers to monitor the vital parameters of an elephant. For transmitting the collected data to the receiver, LoRa module is used. It sends information with low data rate but to a long range. The conceptual diagram of the proposed system is shown in the Fig. 3. CupCarbon simulator is used to simulate the animal health monitoring sub-system.

Results and Discussions
First the results using IR sensors are discussed in this section. After the sensors are integrated with the LoraWAN network, the network components are configured so as to transmit the information received from the sensors to the remote monitoring station. Initially, Pinging is performed to check whether the gateway can communicate with other web servers through internet. It provides means to check the network connectivity of the configured gateway for proper functionality. On the application server, switch is chosen as the widget and the configuration is made in such a way that it is OFF when no intrusion is found. This condition can be observed from Fig. 5(A). The condition with intrusion is set to be the ON state and can be viewed on the webpage of Ubidots as in Fig. 5(B). The same data can be accessed by the Ubidots app that is compatible with Android and iOS. SMS, call and email alerts can be sent to the users by making changes on the application server accordingly. For this, threshold values can be assigned by the user and the application server provides notifications based on the real time data, it acquires from the environment. A buzzer is connected to the node and coded in such a way that if an intrusion is detected, the buzzer blows i.e. when the IR data changes from 01 to 00, the buzzer goes and remains in that state till the condition changes. Fig. 6 LoRa GPS output on TTN Console Fig. 6 shows the latitude and longitude values of the location where the LoRa GPS shield has been placed. These values can be exported to the Ubidots using the API credentials as seen previously. Using the latitude and longitude values, the location of the animal can be tracked easily and continuously.
CUPCARBON SIMULATION RESULTS CupCarbon is a WSN simulator that can be used to simulate various use cases related to smart city and IoT applications. Fig. 7 shows the CupCarbon Simulator displaying roads, sensor nodes and Connections. By using Smart City CupCarbon simulator, the exact location can be sensed by using different sensor nodes and these sensor nodes are connected by using different radio modules and standards like Zigbee, Wifi and LoRa. CupCarbon consists of very easy script language based on the SenScript, the sensors will provide an intuitive commands. During simulation, if the sensor senses the value of the body temperature or heart rate greater than or less than the normal standard range. For body temperature if it varies as greater than 40 or less than 30 it shows indication. And for heart rate if it varies as greater than 35 or less than 25 it shows the indication. Then that particular sink node will be indicated in yellow colour and sends the information as the elephant is not well to the base station. Here the elephant 1 and elephant 5 sink node is indicated in yellow colour due to the heart rate range and temperature range of elephant 1 and elephant 5 varies than the normal range. So the sink node sends the collected data and information to main base station. And that main base station will transmits the information and data as elephant 1 heart rate is not in range and elephant 5 temperature is not in range to the receiver. After sensing the number of sent messages and received messages will be displayed.  The data logging provides a file which consists of transmission time for each sensor node, transmitted ID to detect from which sensor node has been transmitted and sensed value of that sensor node. Fig 12 shows the data logging of the sensor node for sensor ID 1.

. Conclusion
From the results obtained, it is evident that LoRaWAN technology can be used for establishing a reliable communication between the gateway and the nodes, in the proposed animal health monitoring and intrusion detection system. The forest authorities will be able to monitor the forest border regions and in case of animal intrusion, they will be made aware of it at an earlier stage. The animal health monitoring using LoRaWAN was designed and tested using CupCarbon simulator which allows controlling and monitoring of different wireless sensor nodes. The results are shown to prove that the CupCarbon has the best performance with high accuracy and easy script language for wireless sensor networks. In future, more wireless bio-sensors of both wearable and non-wearable types can be used for animal health monitoring. The sensors like pedometers can used to check the activity status of an animal, ECG for heart rate sensing and AX3 logging can be used to keep tracking of health parameters of the animal.