Construction of a prototype for tracking dogs in the streets using Arduino Construção de protótipo para rastreamento de cães nas ruas utilizando Arduíno

Article history One of the motives that compromises the welfare of dogs is a lack of understanding of their needs and of the natural behavior of the species. The use of telemetry as a means of indirect observation is emergent and has provided a significant increase in scientific perspectives. However, its use is still limited for domestic animals despite the high potential for applying the technology in this area. Thus, the objective of this project was to construct a prototype using telemetry via satellite, of reduced size and low cost that allows for the monitoring of dogs in the streets. The prototype of the tracker was constructed containing a Pro Mini Arduino with an ATmega328 micro-controller, a GPS module for the Arduino, GPS u-blox NEO-6M and a Micro Sd reading/taping module for the Arduino. The final weight of the prototype was 197.4±101.5 grams with the battery and is attached to the collar. The dispersion of the planimetric coordinates around the mean was 2.7 meters, which increased to 10.9 meters when the height factor was added to the dispersion. It was concluded that with the size and weight of the prototype used it was possible to evaluate medium to large-sized dogs in the street. The prototype showed the precision necessary to read the coordinates collected for projects aimed at monitoring dogs in the streets, since these do not demand millimetric precision and accuracy. Received 25 May 2018 Accepted 14 April 2020


INTRODUCTION
In recent decades the absence of responsible custody has culminated in the presence of animals wandering in cities in the diverse societies. Such a situation creates problems for the welfare of the dogs (PAULA, 2010) and one of the reasons for the compromise of canine welfare is a lack of understanding of their needs and of the natural behavior of the species.
Added to the problems of their welfare, an uncontrolled canine population constitutes a public health problem. The majority of zoonoses are related to inadequate postures and interventions in the environment, which may affect both the human population and domestic animals (CACERES, 2004). Garcia, Maldonado & Ferreira (2012) concluded that a population management program should ally political, sanitary, etiological and humanitarian strategies as part of a unique health concept, thus providing benefits for both the animals and society. Although studies have been carried out concerning the spatial distribution of dogs in the streets, there is still a lack of research on the behavior and relationship of dogs in their communities (KWOK et al., 2016).
To improve the understanding of the reality of a population, Del-Claro (2004) suggested two forms of observation: direct and indirect observation. Jorge (2011) concluded that an efficient behavior monitoring system should follow the animal's movements in real time and store all possible information such as residence time in each area of the monitored region and the speed of travelling. However, such monitoring is practically impossible to carry out by direct observation and simultaneous registering without the use of a specific apparatus. Thus, indirect observation appears to constitute an efficient alternative in the monitoring of behavior.
The GPS (Global Positioning System) is used in indirect observation (SO-IN;PHAUDHUT;TESANA 2012) amongst other technologies that collaborate with monitoring and tracking. Mantovani, Rae & Ourique (2013) concluded that the difficulty in tracking animals by satellite is still evident and emphasized the need for research into the transmission of animals with more efficient and resistant antennae.
Thus the objective of this project was the construction of a prototype using telemetry by satellite, of reduced size and low cost to allow for the monitoring of dogs in the street controlled by a processor, that, after depositing the intellectual protection requirement, will become public domain according to the Open Source Hardware classification.

MATERIAL AND METHODS
The project was submitted to and approved by the Ethics Committee for the Use of Animals of the Parana Federal Technological University under protocol nº 2015-006.
To construct the prototype, a study was first made of possible points to be observed in the construction of the prototype such as its final size, precision in reading of the data since navigation devices have a precision error in meters (SEGANTINE, 2005), autonomy time of the battery used, fitting of the prototype to the animal's collar, observation of the final weight of the prototype fixed to the collar, protection of the components from impact and its impermeability.
With respect to the final size of the prototype considering the animal's comfort, the construction was based on a size reduction such that when attached to the animal's collar it should not exceed 6% of the live weight of the animal (SCHUBAUER, 1981;KATHLEEN, 2003). The tracker prototype was formed of four parts ( Figure  1), one containing the Arduino Pro Mini with the ATmega328 micro controller, the second containing the GPSu-blox NEO-6M GPS module for the Arduino, the third the Micro Sd reading/taping module for the Arduino, Sd Card Pic Reader/ Tape recorder for information storage and the fourth part containing the power supply consisting of two rechargeable 1100mAH/ 3.7V lithium-ion cells connected in parallel. A printed circuit board (PCB) was produced to interconnect all the components ( Figure 2). A lack of charge to the tape-recording component of the Sd card could corrupt the data stored in the files. To prevent this a sensor was added to the system to evaluate the battery charge. The sensor selected was a model TL431 programmable shunt regulator which guaranteed a minimal charge of above 3.3 volts, the charge required for the functioning of the Arduino Pro Mini and Sd card module present in the prototype.
The logistics part of the collar works according to the flow sheet shown in Figure 3. As soon as the prototype is charged, it checks for the presence/ functioning of the Sd card and battery and the prototype is automatically switched off if any test fails. The GPS is then synchronized and if this gives valid results the reading of the geo-positioning of the GPS effectively starts (using the NMEA 0183 protocol) with storage of the data from five consecutive readings, aimed at identifying discrepant positionings. In sequence, the next readings are taken after the programmed time interval, followed by a check of the battery charge to see if it is still adequate. If it is not adequate the device is switched off and if it is adequate the need for a new synchronization of the GPS is checked for. If required, synchronization is carried out and if not required the device returns to the reading step. Programming allows for configuration of the time interval between readings of the position, configured according to the objective of the experiment. The accuracy obtained in determining the position of a point on the earth's surface using the GPS system is directly related to the quality of the receiver and with the correction method used. Of the sentence formats of the NMEA (National Marine Electronic Association) the GPGGA (Global Positioning System Fix Data) was used, which is one of the most used sentences of the NMEA standard and attends the proposals of the present project, since it carries out the correction of the essential data and provides accurate data and the 3D location (latitude, longitude and height).
To evaluate the quality of the prototype with respect to the accuracy of the data, the dispersion of the readings of the coordinates was evaluated in relation to the mean of the data obtained, using readings carried out with the prototype switched on and maintained in the same location for 30 days.
To calculate the probable circular error (PCE) the mathematical correction was applied using the coordinates of the mean point (Equation 1), where σS and σW correspond to the standard deviations of the latitude and longitude coordinates, respectively. The precision of the dispersion of the values around the mean was calculated using the planimetric standard deviation (PSD) involving the parameters of the longitude and latitude coordinates (Equation 2), the total standard deviation (TSD), and adding the standard deviation parameters of the altitude coordinate (σA) to the PSD calculation (Equation 3).
Autonomy of the power supply is directly related to the consumption of the necessary energy to maintain the parts switched on. To evaluate any significant difference in the autonomy of the battery, the number of valid readings was evaluated at two separate moments, one with the prototype programmed to switch on, carry out the initial synchronization, tape readings during the preprogrammed period and remain switched on continuously until the battery runs out, and the second moment with the prototype programmed to switch on, carry out the synchronization, tape five readings and switch off, switching on again after a pre-programmed period.
After evaluating the quality of the data obtained, the prototype was fitted to a commercial animal collar. They were separated and placed in three lidded plastic cabinets (Figure 4) composed of acetonitrile, butadiene and styrene (ABS plastic), which, in addition to serving as an electrical insulator, provided resistance to impact, heat and low temperatures and could be cut to allow for the connection of wires and make it easy and practical to change the batteries and remove the micro Sd card without removing the whole prototype from the collar. The cabinets were fixed to the collar using highly resistant, impermeable adhesive tape. Collars with the prototype fixed to them were tested with eight street dogs, looked after by maintainers who provided them with food and shelter. Each dog was monitored for 10 days with readings every 5 minutes. The dogs used were medium sized and considered to be of the neighborhood, that is, they had been castrated, lived in the street and were not taken in by their maintainers. In a pilot experiment, 20 collars without trackers were put on street dogs, and it was observed that seven of these were stolen. Thus, the following exclusion factors were applied: docile dogs who allowed strangers to get close, non-castrated dogs, and abandoned dogs with no maintainer to look after them. The dogs had a mean weight of 18.2±3.4 kg, were all adults of undefined age and looked after by a maintainer for at least a year. The maintainers fed them twice a day, in the morning and late afternoon and these moments were used to swap the batteries and read the data. The mean readings at different moments of synchronization of the prototype were compared using the t-test (IC 95%). Excel®, Minitab17®, Ublox 8.11® and Google Earth Pro® were used to store and analyze the data, and for their descriptive statistics and spatial presentation.

RESULTS AND DISCUSSION
The final weight of the prototype was 197.4±10.5 grams with the battery and fixed to the collar. Authors recommend that telemetric transmitters do not exceed 7% of the animal's weight to avoid discomfort and changes in the animal's natural behavior (SCHUBAUER, 1981;ECKLER;BREISCH;BEHLER, 1990;KATHLEEN., 2003;HALLER;GUIMARÃES;RAIMO, 2015), thus the final weight of the prototype allowed for its use in animals weighing above 3.3±0.2 Kg without causing discomfort, and could thus be used in small, medium and large-sized dogs without impacting the animal's comfort. All the dogs used in the experiment were medium sized and showed no signs of trying to remove the collar, indicating that the collar caused no discomfort.
Thirty readings were taken with the prototype in the stationary position to carry out the descriptive statistics necessary to calculate the dispersion of the data and the probable circular error, resulting in 17,213 minutes of reading and 8,588 coordinates taped and analyzed.
The relative position of the location of each satellite in relation to the others is given by an indicator called the dilution of precision (DOP), and according to De Oliveira & Saraiva (2012), the value of the DOP is inversely proportional to the value of the precision of the coordinates collected. The sentence GGA of the NMEA protocol provides, together with the position, the number of satellites visible at each reading and also the dilution of the horizontal precision (HDOP -Horizontal dilution of precision) or dilution of the precision of the horizontal measurements (latitude and longitude). The HDOP observed (Table 1) in the study is a relative indicator of the good planimetric precision of the prototype since the values provided by the NMEA protocol in the study was close to zero, and, according to Pissardini & Fonseca Jr (2018), adequate values for the dilution of precision should be below 5. In addition, the number of satellites visible at the collection moment was shown to collaborate with the better quality of the coordinates collected. The efficiency of data collection is associated with a group of factors, including the number of satellites visible during data collection and the relative position of each satellite in relation to the other visible satellites (DUTRA, 2017). With three satellites visible, a 2D positioning, which englobes the latitude, longitude and time, is possible. As from four satellites visible, the altitude can be added to the positioning, it being advisable to have five or more satellites visible during collection (DUTRA, 2017).
The standard circular error found in the evaluation of the prototype was 3.3 meters (PCE), that is, 50% of the coordinates generated were within a radius of 3.3 meters from the mean point encountered. The value found for the SCE was close to the accuracy values provided for the SCE of 2.0 to 2.5 meters, as presented on the manufacturer's datasheet 1 . The value for the SCE found in the study signified that the possible difference between the true position of the animal and that registered by the prototype could be close to a radius of 3.3 meters. For scenarios with street dogs where the environment covers a large area, such values can be considered acceptable, but in smaller areas, for example, dogs confined in the yard or inside the house, maybe the location precision of the animal would have to be evaluated by some other technology to guarantee greater precision.
The dispersion of the planimetric coordinates around the mean showed a PSD=2.7 meters and when the altitude factor was added the dispersion increased to a TSD=10.9 meters.
The difference between the planimetric and total deviations observed in the study was also observed in other studies, where the authors Bielenki Júnior (2008) and Monico (2000) observed that the horizontal coordinates (latitude and longitude) calculated by a GPS were from two to five times more precise than the vertical coordinate (altitude). This is an important factor to ponder on, since the mapping with a horizontal precision of two to five meters could result in a precision of dozens of meters with the addition of the vertical error (DUTRA, 2017).
To choose the power supply for the prototype, a consumption of 100mA and a voltage of 2.7 to 3.6V, necessary for the functioning of the GPS components, were taken into consideration. In the evaluation of the autonomy of the battery with a rechargeable lithium-ion cell of 1100mAH, 600 minutes (10 hours) of coordinates readings were expected. The result obtained was 625±116.9 minutes of readings with the prototype programmed to switch on the GPS receiver, carry out the synchronization, and continue switched on until the voltage reached the minimal value required to keep the GPS receiver working, In a separate trial, the battery consumption was tested with the prototype programmed to switch on the receiver, carry out the synchronization, carry out a reading, switch off the receiver, wait the programmed interval for the next reading, switch on the receiver again, carry out the synchronization, tape the reading, switch off again, and so on for successive readings. In this second trial, the autonomy of the battery failed to present a decrease in consumption and increase in time of readings as expected (P-value=0.236 in 95% IC). The increase in battery time was to 693±129.9 minutes (11 hours and 55 minutes±2 hours and 10 minutes). In a third trial, the prototype was tested using two rechargeable lithium-ion cells connected in parallel and this resulted in a significant increase (P-value<0.05) to 1321±207.6 minutes (22 hours±3 hours and 46 minutes) of readings time, which allowed for the readings of the dogs to study their behavior with respect to their routines and daily activities.
The collar with the prototype fitted into the plastic cabinets was replicated to obtain five collars, which were placed on the dogs and the data of the coordinates, read every five minutes, collected daily. From the coordinates, data such as speed and displacement patterns, distance covered and occupation area could be extracted (Table  2), thus collecting data that made it possible to analyze the spatial behavior of street dogs. Active displacement 2 0,3(±0,7) 82,5 17,5 3,6(±1,2) 11,6(±3,8) *Displacement patterns according to the values calculated for the distance ranges between coordinates, observed daily every five minutes; 1 Distance range of 0.0 to 20.0 meters considered stationary or local movement; 2 Distance ranges above 20.1 meters considered as active displacement with exploratory walks.
In the analysis of the results obtained for the displacement of the dogs, the PSD and TSD values presented showed no significant impact on the wanderings of the dogs, confirming that for a spatial analysis of street dogs, millimetric accuracy and precision are unnecessary, an imprecision of a few units in meters not interfering in the final mapping design. Figure 5 shows the wanderings of two dogs (dog A and dog B) in a 24-hour period with readings every five minutes between March and April, 2018. The collar showed no structural damage due to possible impacts caused by the natural behavior of the dogs, with no signs of wear and tear or deformation. The use of a highly resistant, impermeable adhesive tape to fix the prototype to the collar was sufficient to avoid it getting wet on rainy days when the dogs were using the collar, although the adhesive tape, despite its good resistance showed signs of wear and tear, and could possible snap if used for a longer time.

CONCLUSIONS
Considering the size and weight of the prototype, it was concluded it was possible to evaluate medium and large-sized dogs. The prototype has a reading precision for the coordinates collected necessary for the street dog monitoring project, where millimetric precision and accuracy is not required. The use of batteries in parallel increased the autonomy time of the prototype. Taping of the data on a microSd card was efficient, although the implanting of a system to send the data collected in real time to a server may be the best guarantee to avoid a loss of data if the collar is stolen or destroyed, and also reduce the daily intervention by the observer with the dogs to collect the data from the collars. An improvement of the finishing for the final presentation of the prototype is still necessary, as also the stimulation of future studies with the use of environmental sensors to improve the prototype.