Development of Control Board of Microcontroller Based Automatic Cow Scratching Machine

The use of cow scratching machines in dairy cow farms is increasing. By using automatic scratching machines, animal are cleaned, the pores in the skin are opened and stimulating blood circulation is accelerated so that animals relieve. In addition; the performance of the herd arises due to the increasing yield of milk. The costs of the cow decrease accidents are prevented because they no longer rub up against something to scratch themselves. In recent years, developments in microcontroller and sensor technology have cheapened the prices of microcontroller and sensor. Microcontrollers and sensors began to be widely used in agricultural fields as in a lot of industrial areas because of technological advances and being cheap economically. In the study a control board is designed to automate the animals scratching machine. In the control circuit of automatic cow scratching machines, motion sensor detecting that the animals lean against the brush and PIC 12F675 microcontroller that activate brush motor according to the information of sensors are used.


Introduction
Although agriculture has been out of interest of information sector in our country for many years, in developed countries it has an evolution that is sensitive to human beings, plants, animals, environment and allows the rise of quality and productivity in production with the development of information technology [10]. "Precision Farming" that is regarded as the continuation of the transition process of manpower to animal power then to the tractor power in agricultural refers to the use of developing technologies of information age in production process that is economic and integrated with environment [7]. The concept of precision agriculture was introduced for the first time in the U.S. in the 1980s and was born from the need to solve environmental problems resulted from agricultural activities such as the use of fertilizers and pesticides. Information technology in recent years with the development of precision agriculture has made rapid progress, especially in developed countries [9]. Precision agriculture is recognized as an appropriate approach for sustainable agriculture [5]. Discussions also about future trends continue while precision farming practices continue to develop [6]. Precision farming practices are also used in animal production as well as herbal production. Precision dairy cow breeding that is one of the precision cow dealing systems can be defined as an approach to sustainable milk production both economically and ecologically in broad sense. High level quality standards as well as protection of environment, animals and consumers in high level are the properties of such a system [2]. Information and electronic age offers new technologies and opportunities for dairy cow sector. Adapting to new challenges always require effort. However, the adoption of innovations provides significant benefits.
The main objectives of precision herd management in dairy cows are, to take advantage of the potential of animal at the highest level, to diagnose diseases earlier and to minimize the use of drugs through preventive health measures. On the other hand, owing to the precise herd management applications, herd management trends at group level may change in the direction of individual-based herd management again through the use of technology [1]. Nowadays, as computer is located in the center of major advanced technology elements within the scope of precision herd management practices, these applications generally are grouped under the concept "computer-aided herd management systems". Major advanced technology elements within the scope of precision herd management practices are listed below [2,3,4,8]:  Electronic animal identification systems  Automatic milk measurement systems integrated to milking system (the amount of milk, milking time, milk flow rate, electrical conductivity of milk, milk temperature)  Automatic animals weighing system  Activity meter  Automatic intensive fodder units (control and measurement of intensive fodder  consumption)  Feeding system that measures roughage fodder consumption  The Herd management software and internet connections (growers union, milk yield and quality control organization, genetic evaluation center) In recent years the use of cow scratching machine in business with dairy cow is becoming increasingly common. Grooming is very important in dairy cow. The word of our ancestors "two grooming a bait" indicates that grooming is as important as the bait. About 30 -40 pcs automatic scratching machines are sufficient for business with dairy cow. In Figure 1, it shows a picture of the cow scratching machines. In this study, a microcontroller based control board of cow scratching machine that is a part of precision herd management system is designed. Control card automatically runs the brush motor by detecting that cow, leaning against the brush, with the help of sensors.

Material and Method
In the system, two mercury contact sensors are used on the control card to detect that the cow leans against the brush ( Figure  2). Mercury droplet in mercury contact sensors on the control card moves when the cow lean against the brush to scratch and it triggers the sensor by making short circuit two contacts. Figure 2. Mercury contact sensors used in the study A transformer of 3.2 W 230/12 V is used in supplying of the control card. AC signal was converted to a DC signal by using one bridge diode at the output of transformer. 12 V value converted to DC signal was decreased to 5 V that will supply micro-controller card by using 7805 IC. In Figure 3, circuit elements of feed unit on the control card are shown.  (Figure 4). Logic is 0 while the value of the pins, where mercury contact sensors connect to PIC 12F675 microcontroller does not allow output. When anyone of mercury contact sensors is triggered, mercury sensor allows output and data information that logic is 1 comes to PIC 12F675 microcontroller. When logic 1 data comes to 12F675 PIC microcontroller from mercury contact sensors MOC3020 optotriac is triggered and it triggers BTA12 triac. Thus, the single-phase 0.18 kW 220 V AC motor that moves the scratching brush operates. LM35 temperature sensor was used to control the temperature on the control card. Also, one 4-ampere fuse was used at the output of the circuit to protect the motor from overloading. At the same time UM3481 IC on the control card is triggered by PIC 12F675 microcontroller to prevent the cow to get afraid and to relieve them. One 0.5 W speaker was used to convert one of 8 melodies signals in UM3481 integrated to audio randomly. General view of control card is seen at Figure 5. Control card is inserted into the connection box that activates the brush. System operates as follows: PIC 12F675 microcontroller waits for data from the sensors. When one or two of the sensors is triggered, the microcontroller runs the motor. The brush connected to motor starts revolving for 20 s and melody plays simultaneously. The microcontroller sensors continue listening during operation. If data comes from any of sensors in 20 s, a time of 20 s is played/loaded again. Unless any sensors allow output in 20 s motor stops operating and the melody ends. If the motor temperature exceeds 55 oC during operation, the microcontroller stops the motor. If temperature drops below 50 oC, the system continues to operate. The circuit diagram of the system is seen at Figure 6. Figure 6. Circuit diagram of the system "PIC BASIC PRO" programming language was used for the software of PIC 12F675 microcontroller. The flow diagram of the program written in this programming language is seen in Figure  7. The program written in "PIC BASIC PRO" programming language was converted to file with HEX extension by Micro Code Studio program. The obtained file with HEX extension was loaded on program memory in PIC 12F675 microcontroller via PIC Programmer by using the IC-Prog software.

Research Results and Discussion
A microcontroller based electronic card was designed to control of cow scratching machine automatically with the realized system. The installation of microcontroller based control card is pretty easy. As it is installed in motor connection box, it is not affected by environmental conditions such as water, moisture, dust. The movement of the brush is provided by the microcontroller by detecting that cow lean against the brush by mercury contact sensors. Blood circulation of cow increase as itching of cow with the brush opens the pores on the skin. As the stress of the cows is eliminated, milk yield increases. As it is provided that the cows get cleaned and be relaxed, the harmony of cow with each other gets better and herd performance increase. Also, as skins of cow is clean due to automatic cow scratching machine, there is not any contamination in milk and that increases the quality of milk. The accidents and diseases that may occur while cow rub unhygienic places to scratch itself are prevented with automatic cow scratching machine. By the studies, an electronic card that runs cow scratching machine of which the use expands in business with dairy automatically cow was developed. We can sort the results obtained with developed microcontroller based the results the control card as follows:  When compared to cow scratching machine manually operated at certain times, it is seen that electricity consumption is less with the developed system because motor only operates when cow lean against the brush.  The melody that began to play with the brush eliminated the cows' timidity. Thus, the cow got used to the machine in a short time.


The parasites on cow's skin are eliminated so the health of cows is protected and they are provided comfort.  The cleaning of body parts of cow where they cannot reach itself (the eye and surrounding area) is provided. An EPROM can be used for a different melody from 8 melodies in Um3481 IC on control card to be played. Thus, different melodies can be played by loading the desired melody in the EPROM. A misting system on the machine for cow to cool especially in summer can be designed. Thus, when the brush starts working, misting system can be automatically activated. This study is sample study for precision herd management systems with the use of sensor and microcontroller in cow dealing.