Collecting information on estrus in cattle using the internet of things

ABSTRACT Monitoring the movements of ruminant animals is one of the most challenging tasks. In animals that act according to their habits, it is difficult to label such movements and transfer them to farmers. Monitoring and recording the movement and behavior of animals on a farm is an adopted method for successfully determining the duration of the estrus cycle in ruminant animals. The Internet is a technology that offers remarkable solutions for such applications. The aim of this study is to determine the hourly step counts and to find the estrus period in the most accurate way with a circuit design applied to the ankles of animals using an IoT-supported microcontroller. The data is transferred to the web environment wirelessly and monitored via wi-fi communication signals. This wireless wearable and network equipment determines the step count and monitors the animal's abnormal body temperature. An IoT-supported microcontroller provides wireless communication, high-speed data transmission, and low power consumption. Insemination was ensured by testing different animals on the application farm. The data is monitored in real-time, and the system gives an alert. Low cost, high reliability, and being able to be watched over the internet are the advantages of the system. This study helped develop new techniques and provided a low-cost proposition for testing wearable technologies on animals.


INTRODUCTION
There may be situations such as not knowing the estrus period of cattle and reluctance to feed due to stress.These conditions are among the factors that reduce the productivity of both the animal and the herd (Altınçekiç and Koyuncu, 2012).
Every farm and dairy business aim for at least one calf from their cows each year.Insemination of cattle at the right time is crucial in achieving those goals.The success in determining the timing of insemination varies depending on the success in recognizing the estrous period.Estrus is the period when an adult cow, at certain intervals, displays an inclination to mate or be mounted by a bull until she is pregnant, and behaves physically and instinctively in a way that is suitable for breeding.In an average 21day reproductive cycle, the main estrous period lasts for 12-18 hours (although this duration is shorter in the summer) (Göncü, 2011).In Figure 1, the most appropriate time interval and process for insemination during estrus are shown.
Figure 1.Estrus Period (Güngör and Tumer, 1998) In cows, heat is the period when they let the bull jump on them.The estrus periods and periods differ according to each cattle.This period generally lasts 9-18 hours.Although angry cows are more active at night, it is seen that they show the behavior of standing on the bottom at night when the surroundings are quieter and calmer.One of the important signs of anger is that animals that have entered this period es pecially stand and stay in their places for a long time and are difficult to move.In addition, angry cattle gather with other animals in the herding community, which is about to be angry, and form a different grouping (What…, 2018).
In this study, hardware has been designed and tested by utilizing IoT communication technologies and sensors to define and intervene most accurately and appropriately in estrus time.The software part records the data of the designed circuit directly over the internet in the dynamic database via API restful service and presents it to the end user graphically.The Internet of Things is a useful technology in this type of real-time data monitoring, data control, and transfer, and it has been one of the key components of Industry 4.0 (Yoon-Min et al., 2015).introduced an automatic plant watering system to help in smart farming using Arduino and data mining.Germani et al. (2019) Schofield et al. (1991) demonstrated that it is easier to collect movement data using the pedometer approach and that it is a characteristic that varies more according to the estrus ratio.Maatje et al. (1997) reported identifying estrus at a rate of 78% by monitoring the behavior of animals, and a misdiagnose rate of 32%.Firk et al. (2003) utilized multivariate statistics and analyses to detect estrus.De Mol et al. (1997) stated that the application of fuzzy logic alongside activity monitoring would be useful for farmers to detect the next estrous period of an animal that recently went through estrus.Additionally, Ferreira et al. (2007) established a fuzzy expert system for detecting the upcoming estrus time in cattle by taking into consideration the characteristics of the most recent estrous period of the animal in case the monitoring shows deviation from the normal behavior pattern.Tzounis et al. (2017) presented the challenges and potential for the propagation of wireless sensor networks and IoT used in the agricultural sector.Zervopoulos et al. (2020) introduced a low-cost system capable of acquiring systematic and synchronized measurements using wireless sensor networks in agriculture.Zhang et al. (2018) proposed a platform for the operation of a data transmission and analysis system which gathers activity and status information on livestock.Memmedova and Keskin (2011) used the fuzzy logic model in their study to detect estrus by using trait activity in cows.

MATERIALS AND METHOD
This section of the study provides detailed information about the materials that allow animal data monitoring for activity, step counts, and skin temperature.Additionally, this section contains information about recording and tracking the step counts of animals in real time by using an accelerometer attached to the animals' feet.
The MLX90614ESF-BAA infrared thermometer is designed for non-contact temperature measurements.An internal 17-bit ADC and a powerful DSP provide high sensitivity and stability (Thermal…, 2022).The thermometer makes it much more convenient to accomplish tasks such as body temperature measurement and motion detection.Figure 2 shows an image with the names of the pins.A microcontroller has an input-output unit, timers, PWM outputs and analog inputs, a communication unit, and a memory unit.They can be utilized in many areas from small applications to large ones.
An ESP8266EX-based Wemos D1 mini that supports WiFi 802.11 b/g/n standards, is used as an IoT object.Figure 3 shows the pin information and an image of the model.This module has 11 digital input/output pins, with all but D0 supporting interrupt/PWM/I2C/One-wire, 1 analog input (3.2V maximum input voltage), Micro USB B type input, and the power input supports 9-24V input voltages (Demirtaş, 2017).Additionally, the technical features are as follows: Microcontroller: ESP-8266EX model, operating voltage: 3.3V, flash memory: 4MB, dimensions: 68.6 mm x 53.4 mm, weight: 25gr and ability to work with Arduino, NodeMCU.The MMA8451 digital accelerometer detects motion, tilt, and basic steering.It has a wide usage range, from +-2g up to +-8g, and can be used with Arduino or another microcontroller.The MMA8451 is an accelerometer that provides clear results (Anonymous, 2021).It's designed for use in phones, tablets, smart watches, and more, but works just as well in Arduino projects.Figure 4 shows an image of the model and Table 1 shows its technical features.The accelerometer also has built-in tilt/orientation detection.Thus, one can tell whether the device is being held in landscape or portrait mode and whether it is tilted forward or back.Since it's a 3V sensor, it features a low-dropout 3.3V regulator and level-shifting circuitry.That means it's perfectly safe for use with 3V or 5V power and logic.30 amps of instantaneous current can be drawn from these batteries, which can draw high amps for terminal batteries, medical batteries, flashlight batteries, notebook batteries, motors, microcontrollers, and electronic devices (Online…, 2022).Monitoring the number of steps taken by animals on a daily and weekly basis is one of the most effective methods in determining the estrous period.An animal whose estrous period is approaching and who is in estrus exhibits more active behavior during the day compared to other normal days.In this section, a circuit is designed in the form of a device to be placed on the animal's ankle.As the microcontrollers used in the study had a single analog output pin, data could only be obtained in the one-dimensional X-axis in the first prototype and the steps of the animal were monitored in this way.In the second prototype, an extra analog multiplier module was added to the circuit.This addition helped to get the X, Y, and Z coordinates, allowing both the step counts and the behavior of the animals to be monitored.
Table 3 shows the materials used in the device.
The coordinate changes in the animal's ankle and the step count information were transferred to the automation system via the Mma8451 module.
Figure 5 shows the stages of creating the device step by step.
Figure 6 shows the experimental circuit wiring diagram and schematic wiring of the device as hardware.Wemos d1 mini model was used as the microcontroller.Figure 7 shows the overall operating structure of the device when it's attached to the animal.The device designed within the scope of the application was applied to the ankles of the animals.Determining the number of steps takes the data from the rest states, that is, when they do not take a step, and sends it to the automation.The device application is shown in Figure 10.The application was made by recording both the number of steps and skin temperature data on different animals on the farm.Both animals were selected from cattle that had given birth at least once.
It is observed that the general body temperature of cattle increases in connection with estrus.In bovine animals, the body temperature is generally around 38.5-38.6oC in healthy conditions.During the two days before estrus, their body temperature progresses at a lower-than-normal level.During estrus, 84% of the animals show an increase in temperature between 0.1 and 0.5 o C. Rectal temperature measurement is not practical in farms.Instead, it has been found very practical to instantly measure the skin temperature in real-time by using a thermal thermometer.
Step count and skin temperature data are transferred to the web-based automation graphically every 10 minutes by the microcontroller via the internet, paired with the earring number, and shown to the user.Figure 10 shows the graphical interface.The graphical representation of the incoming data in automation is shown in Figure 11.Sending data to automation: The data is sent to the server with the API (Application Programming Interface) service, via the restful service-based structure of the software in the microcontroller on the devices.
Saving data to the database: When the data comes to the web server where the automation is located, it is added to the relevant table in the MySql database server and saved.
Graphical transfer of data to the user: At the stage of data monitoring, javascript-based graphs allow the end user to monitor real-time values on the web automation.
In the IoT management section, the physical address of the added device is matched to the earring number of the animal and saved.Deleting and listing a new IoT device is also done in this section.Many animals can be added to the system (Gündüz and Başçiftçi, 2022).

DISCUSSION
The process was carried out with 2 dairy cows on the farm by way of recording data related to both step counts and skin temperature.Both animals were selected from among cattle that had given birth at least once.
After 14 days from insemination, skin temperatures and step numbers of animals were recorded for 7 days.Tables 4 and 5 present this data.
However, taking the instant measurement of the skin temperature in real-time using a thermal thermometer proved to be quite efficient.Table 6 shows the average power consumption of the device.
If the data logger works for 8 hours a day on the device that the study introduced as a solution, the battery life is approximately 21 days.When the power supply runs out, the authorized people on the farm can replace the batteries.If one wishes to extend this period, one can utilize larger capacity lipo batteries or adjust the data transmission intervals and set it to a lower frequency.Table 7 shows the approximate price range for the system.
The results were tested to detect daily behavioral changes, and Vertex Lite, another commercial product, was chosen as the performance product for comparison.Table 8 shows the comparative results.Considering the measurement results, using the data related to the 1st animal, the system showed that the animal could be in estrus on the 6th and 7th days.The veterinarian confirmed the signs of estrus upon examination of the animal and the subsequent insemination proved successful.
Observations showed that the system can assist in estrus detection by full-time monitoring of the step counts and skin temperatures of the animals.

CONCLUSION
The cost of the device and the system put in place is lower compared to other devices that work with the same principle.In later stages, it is possible to use the circuit designed in the study by testing it on more animals, as well as on calves.By utilizing low-power modules instead of the microcontrollers used in the study, it is possible to extend the battery life of the device that collects the pedometer and skin temperature data, thus further reducing the cost.
If the outer case of the device that is put on the animals' ankles is designed in a more rounded or oval shape, it would be possible to prevent any injury to the ankles of the animals in case of contact with any hard surfaces.
It has been observed that estrus and behavioral information tracking is quite common in commercially available and commercially marketed systems.It has been observed that most of the products sold in our country are of foreign company origin.In Table 9, the origins and approximate prices of pedometer products sold for estrus monitoring in the market are listed and compared with the designed system.Brand Feature Origin Approximate price (USD$).The next phase of the study is aimed to ensure longer battery life by using future LORAsupported devices and gateway.By testing its applicability to each farm in terms of cost, the system can be made lighter and more stable with only wearable wireless body nets without any physical changes on the farm.
The reference list has been prepared by considering the comparisons between different heat detection methods and practices in Turkey and different countries with the same geography.In a 2016 doctoral thesis, Yıldız (2016) examined the effects of factors related to estrus in cattle by using artificial neural network models.Hilal et al. (2022) also examined studies carried out using artificial neural networks in the field of dairy farming.In one study, Özgüven et al. (2017) discussed the wireless data transmission methods used in pedometers in the market (Fernandez et al. (2018) carried out a reverse engineering and security evaluation of commercial tags for RFID-based IoT applications.Ferrari et al., 2018 demonstrated the impact of quality-of-service parameters on the communication delay from the production line to the Cloud and vice versa.Patil et al.

Figure 5 .
Figure 5. Stages of creating the device.

Figure 8
Figure8shows the flow diagram of the codes running on the microcontroller of the device.

Figure 7 .
Figure 7.The overall operating structure of the device.

Figure 8 .
Figure 8. Flow diagram of the codes running on the microcontroller.

Figure 9 .
Figure 9.The appearance of the device before and after encasing.

Figure 10 .
Figure 10.Application pictures of the pedometer on the farm.

Figure 11 .
Figure 11.The graphical interface of the automation Connection to the Wi-Fi network: Software on IoT-supported microcontrollers connects devices to the network.
Table 2 lists the technical specifications of the battery.

Table 3 .
Materials used in the device and their specifications

Table 4 .
Skin temperature and step count chart of a 2-year-old animal that had given birth once

Table 5 .
Skin temperature and step count chart of a 2-year-old animal that had given birth twice

Table 8 .
Comparison of the recommended device and another available commercial product

Table 9 .
Approximate price and origin comparison of commercially available pedometers