Design of Pedometer with Radio Frequency (RF)

The main factor affecting efficiency and economic situation in dairy cattle breeding is the semination performances of cows. The most important factor on the effect of semination performance is to determine the of oestrus on time. If the oestrus cannot be determined on time, it will causes delays in insemination, decline of pregnancy rates and the birth interval prolongation. Measuring steps of each cow with using the pedometer is the most commonly preferred method in determining oestrus. In this study, a new pedometer having a digital accelerometer with high sensitivity, low power consumption was designed and manufactured to have the opportunity for the three – axis measurement. A RF communication module was used to transfer data from the pedometer to the computer. Header files and library code for both the RF transceiver and accelerometer sensor software were created. All the codes were written over CCS in the C programming language. A program was developed to interpret the mobility data by using static and dynamic thresholds. The most good error rates were determined to be 3% for the static threshold method and 8% for the dynamic threshold method.


Introduction
Livestock farming, which was carried out by small family enterprises in the past, is performed on medium or large scale farms, nowadays.This change required the use of livestock farm mechanization and automation.Tracing the needs and conditions of each animal on middle or large scale farms by farm workers is very labor intensive and causes delays and errors in farm operations because of the workers' negligence and deficiencies.One of the most important subjects affecting the profitability of modern and largescale dairy cattle enterprises is to manage herd correctly and timely by making effective decisions based on the continuous monitoring of animal situations (restlessness, body temperature, location, etc.).For this purpose, computerized herd management systems containing electronic instruments have been intensively used by agricultural enterprises.The herd management systems warn the breeders by collecting and evaluating the information about the individual performances, oestrus and health of animals.Hence, the breeders take necessary cautions and make necessary work plans without permanent losses.
Animal mobility rapidly increases during animal oestrus period.The pedometers which count animal steps and are mounted on animal legs or knotted on necks are used to observe and quantify animal mobility.The increase of animal steps in a given time period compared to its former periods are used as the independent variables of the mathematical models that predicts if the selected animal is in oestrus (Tarhan et al, 2015).A new pedometer having an electronic acceleration sensor and counting the number of animal mountings besides animal steps in a given time period will be introduced.

Materials and Methods
Electronic acceleration sensors will be used to sense animal steps in this study since the slope sensors used in commercial pedometers get affected considerably from mechanical conditions.The pedometer with an acceleration sensor can be used to count separately the number of steps and mountings performed by a cow since acceleration values will be different for its walking and mounting activities.
Animal mobility will be quantified according to the acceleration changes in terms of steps or mountings during the movement of animals by the new pedometer.The new pedometer keeps the mobility data in its own storage and send them to the main computer at selected time points with its embedded RF module.The main electronic comments used in the pedometer are as follows: • A 3-axis digital accelerometer (ADXL345) with high resolution (13-bit) and high range (±16 g) was used.This sensor can measure acceleration instantaneously in three dimensions (Anonymous, 2015).
• A microcontroller having PIC16F877A code from Microchip Technology company was used.This microcontroller is an integrated circuit having an input/output (I/O) unit, a CPU and a RAM.It has a total number of 40 pins and there are 33 pins for input and output (Anonymous 2017;Yurttaş, 2012).
• The ALU is the centerpiece chip that executes all the arithmetic and logical operations performed by the computer.In two-oper and instructions, typically one operand is the working register (W register).The other operand is a file register or an immediate constant.In single operand instructions, the operand is either the W register or a file register (Nisan and Schocken, 2005;Godse and Godse, 2009) • A RF4432 module was used wireless communication.RF4432 operates at 1.8~3.6Vwith extra low standby current which makes it suitable for battery powered-up applications (Anonymous, 2011).This RF module transfers mobility data two main computer wirelessly every two hours.RF4432 series is a low cost, high performance transparent two way semi-duplex GFSK transceiver with operation at 433/470/868/915 Mhz.It has receive sensitivity -121 dBm and output power 20 dBm (Anonymous, 2016).
• A regulator system known as voltage regulator or voltage amplifier was used to keep voltage within the given range (Kılıçer, 2009).
• A long-lasting Lithium Polymer (LIPO) battery was used as a power supply.
Two different electronic circuits were designed and manufactured.The block diagram of the developed circuits is given in Figure 1.A moving circuits (Figure 2) was placed within the pedometer and supplied the mobility data as requested by a fixed circuits.The circuit connections in the Proteus drawing program of the moving circuit shown in Figure 3.The fixed circuit consists of two circuits in the form of receiver -transmitter.The fixed circuits (Figure 4) controls the moving circuits to transfer mobility data from pedometers to the main computer.The main computer stored and processed the mobility data and the data could be observed through the monitor (Figure 5).

Results and Discussion
3-axis accelerometer was used for correct determination and calibration of the number of steps during operation.Thus, there does not require calibration studies of a single axis accelerometer.In order to provide accurate data, step algorithms were obtained by analyzing the instantaneous data on the axis 3 of the accelerometer.Graphs created with instant axis data shown in Figure 6 and Figure 7.
When Figure 6 and Figure 7 are examined, peak to peak square form on the Y axis indicates a step that occurs.250 number of the accelerometer output take as a reference for determining the number of steps in step algorithm.X-axis the data points at zero of measurement was understood that to be inactivity and animal's lying.Z axis occurring in full-frame form shows that mounted on animal movement.In dairy cattle breeding, the success rate in determination of oestrus is important.The step test data was used as a success criterion because the experiment on the cows could not be done as a pedometer circuit field experiment performed in the thesis study.Measurements included not only gait activity but also activities such as stopping, lying and overtaking.The step values and the error rates obtained by the static step decision mechanism method, which is one of the methods selected for the activities, are shown in Table 1.When the results shown in Table 1 are examined, it is seen that each test has its own error rates independent of the number of steps.This is because the laboratory where experiment performed is not so wide enough and used RF modules do not support long distances and breaks with the data loss that occurred in the smallest obstacle has been effective in the results.In addition, Measurement without pedometer outer mold also has a negative effect on the values.The plurality of measured values in the static step decision mechanism also increases the accuracy of the calibration.Measurements with the highest error rate are measures of running activities.The measured values obtained by the second method, dynamic threshold value method, are shown in Table 2.When Table 2 is examined, it is seen that error rates are high.The biggest reason for this is the measurement without the pedometer mold.The values obtained with the instant measurements on the accelerometer axes caused unbalanced results due to without mold settlement, this case has led to deviations in calibrations and step calculations.When the static and dynamic threshold measurement results are compared, since the static threshold method gives acceptable error results, it has been decided to use it as a step detection algorithm.
Chin and Lu (2008), In their experiments were done on a 30-meter distance in the lab with 5 trials for each speed (slow walking, fast walking, jogging).The accuracy of the step detection as well as the distance calculations were within acceptable accuracy limits as indicated in Table 3.

Conclusion
In dairy farming businesses, oestrus detection is an application that requires a lot of manpower.Difficulty following oestrus and the inability to determine anger can lead to problems in reproduction and can affect the profitability of the business.The inability to detect the oestrus in a timely manner causes an average loss of 21 days per animal.In a missed oestrus, calf birth interval and milk loss increases.The use of a pedometer has become compulsory to reduce these drawbacks.However, the investment costs are high due to the fact that many of these devices are imported.
Even though dairy farming developed in Turkey in recent years, technological investments such as pedometers can not be made considering that most of the dairy farming enterprises in Turkey are formed by small businesses and family businesses.It is possible to instantaneously monitor the oestrus of each animal in the herd, to make interpretations in illnesses such as lameness due to immobility and to realize future plans in a very accurate manner with a pedometer with a well-prepared application and a eligible hardware.
It is thought that researchers who will work on this topic in the future will be able to obtain more accurate measurement results and lower error rates by using the low pass filter on the data on the accelerometer axes when they prefer the dynamic threshold value method.It is suggested that a software which determines an action decision by static step decision mechanism Using combination of static and dynamic threshold value methods and by analyzing axis data with dynamic method using low pass filter may be more successful.

Table 3 .
Percentage error for different walking speeds Çizelge 3. Farklı yürüme hızları için hata oranları accelerometer and Table 4 show test data taken for distances of 35 ft., 70 ft., and 100 ft. with a stride length of 0.74-0.75meters.All tests were done with a normal walking gait.Actual steps were counted by the test subject.