Internet of Things-based Cow Body Weight Recording System

— Internet of Things (IoT) can be applied to various aspects, especially it can be used as a system for recording, storing, sorting, and processing data. This application can be used in a cattle body weight recording system. Recording is all types of record activities such as identification activities, genealogical records, production and reproduction records, maintenance management records and livestock health records in certain populations. In the process of fattening cattle, recording is an essential activity, but in a survey conducted at the Sumber Sekar laboratory of the Faculty of Animal Husbandry, Universitas Brawijaya, a problem was found, namely the availability of cattle scales for the recording process. For this reason, an internet of things-based cow body weight recording system was designed. The internet of things-based cow body weight recording system uses 2 Load Cell sensors to weigh the cow's body weight and an RFID sensor to read the cow's identity, in addition to the sensor the system has a website as a user interface. It is hoped that this application can improve the efficiency of the cow body weight recording process and produce an intelligent tool system.


I. INTRODUCTION
In 2021, the trend of beef production in Indonesia will tend to decline, not in line with the increase in the cattle population. According to the Directorate General of Livestock and Animal Health, Indonesia's beef production was 437,783.23 tons, a decrease of 3.44 percent compared to 2020 of 453,418 tons [1]. The lack of beef supply in Indonesia is due to weak synchronization between reproduction management and slaughter management. The reason is that 78% of national beef production comes from smallholder farms [2]. The fattening industry always has a PBBH (daily body weight gain) target for each livestock kept, therefore recording body weight needs to be done regularly, because the PBBH value is used as an evaluation and a measure of success in the fattening process. Meanwhile, in traditional farms, recording is still lacking attention. Recording is all kinds of activities such as identification activities, genealogical records, production and reproduction records, maintenance management records and livestock health records in certain populations. In the process of fattening beef cattle, recording is an essential activity [3]. For this reason, a mechanism is needed that can efficiently record ADG for cattle and can be integrated with the database. In the fattening industry, in general, there are scales to measure the body weight of cattle, but they are still inefficient because they have to put the cows in pin cages and have to condition the cows so they can be weighed. In a survey conducted in the field laboratory of animal husbandry, Faculty of Animal Husbandry, University of Brawijaya, a problem was found, namely that scales were not always available for recording. Based on these problems, the creation and development of an IoT-based cattle body weight recording system was carried out.

II. RESEARCH METHOD
The research method used includes determining tool specifications, system block diagrams, electronic hardware design, and software design.

A. System Specifications
System specifications need to be determined in advance as a reference for tool design so that the tool is made according to the expected goals. The specified tool specifications include: 1. The system can measure the weight of cattle with a maximum limit of 1000kg. 2. The system can read the value of the RFID tag at a minimum reading distance of 50cm. 3. The system can send data on the RFID value and the weight of the cattle at the specified time. 4. The system can still read accurately at a maximum slope of 1°. 5. The system can connect with Firebase Realtime Database. 6. Data can be accessed through the website. Diagrams and blocks of the internet of things-based cattle body weight recording system can be seen in Figure 1.  Figure 1. Shows a block diagram of the internet of things-based cattle body weight recording system. The microcontroller used is NodeMCU ESP32. RFID HW-VX6330K is a UHF middle-range RFID reader which has a reading range of 6-8 meters which can be programmed [4]. Using NodeMCU ESP32 because reading data from the HW-VX6330K RFID sensor requires serial communication, while serial communication using SoftwareSerial on NodeMCU ESP8266 is not recommended for receiving data because it will cause errors. NodeMCU ESP32 functions as a data receiver from the HW-VX6330K RFID sensor, and the Load Cell weight sensor. The load cell used is the 500kg NA4 mavin type [5]. Aside from being a data recipient, NodeMCU ESP32 also functions as a data sender to the Firebase Database. RFID TAG serves as the identity of the cow. The HW-VX6330K sensor functions as a receiver of RFID value data from RFID TAG. Load Cell serves as an indicator of the body weight of the cow. HX711 functions as a load cell reading data amplifier. The 16x2 LCD functions as a viewer for the process of measuring the body weight of a cow. Push Button A functions to calibrate the scales. Push Button B is used to send collected data to Firebase Database. The Firebase Website will display data from the Firebase Database so that it is easy for users to understand. Users can download data and delete data on the Firebase Website.

C. Hardware Design
Based on system block diagram mentions at Figure 1. The hardware design in schematic can be seen on Figure  2. The cattle body weight recording system uses 2 load cells connected to the HX711, the HW-VX6330K sensor, 2 push buttons, and a 16x2 LCD. All of these devices are connected to NodeMCU ESP32, the HW-VX6330K sensor is connected to NodeMCU ESP32 via serial communication to send RFID value data from the sensor to the microcontroller. The RFID tag is attached to the cow's ear for the convenience of reading. NodeMCU ESP32 will send data to the Firebase Database which will be displayed with the Firebase Website. The microcontroller is supplied with a voltage of 5V, the Load Cell Sensor is supplied with a voltage of 3.3V, the HW-VX6330K Sensor is supplied with a voltage of 9V.

D. Data Storage Design
Firebase is a service from Google that functions as a backend as a service (BaaS) which is a solution for developers developing android applications [6].Sensor data sent from the microcontroller to firebase and displayed on the website uses the REST API protocol. Firebase uses two services, namely firebase realtime database and firebase hosting. Firebase realtime database is a noSQL database hosted in the cloud with functionality to sync and store data. Data stored in JSON form and synchronized in realtime to every connected client [7]. Firebase hosting is used for uploading website pages that have been designed in visual studio code software. When the website upload process requires software assistance, namely the firebase CLI, after that, the website programming deployment process is carried out so that a website address is obtained that is automatically generated on firebase hosting [8].

A. Testing the accuracy of the Load Cell sensor
Testing the results of the Load Cell sensor readings is carried out by measuring several sandbags which are confirmed in advance by using conventional scales. After the weight has been ascertained, the sandbags will be weighed with a load cell. The measurement results of the Load Cell sensor will be analyzed by calculating the error value on the sensor. By knowing the error value of the Load Cell sensor reading, it can be determined the feasibility of using the Load Cell sensor for measuring cattle body weight. The data obtained from testing the Load Cell sensor can be seen in Table 1.  Figure 3 it can be seen that the average error in the reading of the load cell weight sensor is 0.4%. The reading performance of the Load Cell sensor is quite good because the output weight that is read is constant at the same setpoint so that the Load Cell sensor is suitable for measuring cattle body weight.

B. Cow's Weight Measurement Test
The test for measuring the body weight of the cow is carried out by guiding the cow up on the scales and then recording the results of the scale readings. An illustration of measuring the body weight of a cow can be seen in Figure 3. Based on Table 2, the measurement results still fluctuate, this is because when measuring body weight, the cow is directed by being pulled and pushed so that the force from pulling and pushing causes inaccurate measurement results.

C. Testing the RFID reader HW-6330K
Testing the HW-VX6330K sensor is carried out by measuring the reading distance of the RFID sensor and seeing the reading results. From the test results it can be seen that the maximum distance of the HW-VX6330K sensor reading. Based on Table 3, it can be seen that at a reading distance of more than 110cm there is an error where the data is completely unreadable. In the specifications for the HW-VX6330K tool, the maximum reading distance is 6m, but in testing it is only up to 110cm. This happens because the HW-VX6330K sensor has set a maximum reading distance of 100cm to prevent interference from other RFID tags.

D. Testing The Tilt of The System
Testing the tilt of the scales is done by adding a wooden board to one end of the scales. The thickness of the wood used is 3cm, while the total length of the scales is 180cm, so that every 1 board indicates an increase in slope of 1°. Test illustration can be seen in Figure 5. This test is carried out to determine whether there is an effect of the inclination of the scales on the weight measurement results. The data obtained from testing the slope of the scales can be seen in Table 4. Based on Table 4 it can be seen that the average error results at angle 1° is 0.01%, at angle 2° is 0.1%, at angle 3° is 1.%. From the description above, it can be seen that the maximum angle of inclination so that it remains in accordance with the sensor specifications of ±0.02% is 1°.

E. Website Result
The website was created to facilitate monitoring of sensor data received from a cattle body weight recording device as well as to utilize the implementation of Internet of Things technology. Website interface design is made using the HTML (Hypertext Markup Language) programming language as the main or basic structure for creating website pages [9]. The interface design uses the help of the Visual Studio Code application, the HTML is inserted with JavaScript (JS) which functions to make website pages more interactive. In addition to JavaScript, CSS (Cascading Style Sheets) is also used which functions to design the appearance of website pages. CSS was developed by the W3C, an organization that develops internet technology with the aim of facilitating the process of structuring pages on websites [10]. The website page that is created contains a one-row and threecolumn table that will hold time and date data, id data from RFID tags, and weight data from load cell sensors that are sent by the microcontroller via the firebase realtime database as well as buttons to download data and delete data. This website is titled "Data Timbangan Sapi" which is shown in Figure 4. Figure 5. in following is an activity diagram image to clarify the work system from the user interface. The initial activity on this system is that the user enters the website domain to open the website page. The second activity that can be done is to press the push button so that the data is sent to the database to be displayed on the website page. To download measurement data the user can perform the data download activity and to clean up the data the user can perform the data delete activity.

IV. CONCLUSION
From the results of design and testing the following conclusions can be drawn. 1. Design of body weight recording system cow based internet of things designed able to measure the body weight of cattle less than 1000kg. This recording system can send data to a database that can accessed through the website, so that data can be accessed from anywhere and anytime existing devices. 2. In testing the tilt of the scales, it can be seen that the maximum slope of the scales so that the measurement data is still accurate is 1°. Because the greater the slope value, the greater the error value in the measurement results of the scales. 3. The website function work perfectly the user can download the data file to csv format and can delete the old data.