Automatic Temperature Control System on Smart Poultry Farm Using PID Method

Chicken farmers in Indonesia are facing a problem as a result of the country's harsh weather conditions. Poultry species are very susceptible to temperature and humidity fluctuations. As a result, an intelligent poultry farm is necessary to intelligently adjust the temperature in the chicken coop. A smart poultry farm is a concept in which farmers may automatically manage the temperature in the chicken coop, thereby improving the livestock's quality of life. The purpose of this research is to develop a chicken coop prototype that focuses on temperature control systems on smart poultry farms via the PID control approach. The PID control method is expected to allow the temperature control system to adapt to the temperature within the cage, thereby assisting chicken farmers in their task. The sensor utilized is a DHT22 sensor with a calibration accuracy of 96.88 percent. The PID response was found to be satisfactory for the system with Kp = 10, Ki = 0, and KD = 0.1, and the time necessary for the system to reach the specified temperature was 121 seconds with a 1.03 % inaccuracy.


Introduction
Indonesia's poultry business has a sizable market. Indonesian broiler meat output increased by 779,108 tons between 2005 and 2012, reaching 1,085,589 tons. This is an annual gain of 9.06 percent. Broiler meat production reached 1,689,584 tons in 2016. Additionally, Indonesia's egg output climbed from 681,147 tons in 2005 to 1,059,266 tons in 2010. This is an annual gain of nearly 6.80 percent. Egg production totaled 1,428,195 tons in 2016 [1]. Due to the harsh weather conditions [2][3][4], chicken growers face certain difficulties in keeping a comfortable habitat for their birds. Poultry species are quite sensitive to environmental temperature fluctuations. Chickens' body temperatures must be kept between 39.9°C and 41°C [4]. Chickens will perish if their body temperature rises by more than four degrees Celsius [5]. Due to the fluctuating severe temperatures, birds raised in the tropics are extremely susceptible to heat stress.
Heat stress occurs when cattle is subjected to high temperature increases both outdoors and inside [6,7]. As a result, we require a system capable of controlling the temperature in the chicken coop. A temperature control system for the chicken coop is required. Several more publications [8,9] make use of the Proportional-Integral-Derivative (PID) Method. However, a simple implementation of PID is still required for practicality and simplicity. Smart poultry farms are a new way for chicken farmers to expand their livestock operations through the use of Internet of Things (IoT) technology in its current form. Due to the improved system responsiveness caused by feedback, this strategy is projected to aid farmers in improving the quality and production of their crops. The application of smart poultry is gaining traction in Indonesia, where hundreds of thousands of poultry exist.

Broiler Chicken
Broiler chicken or broiler is a type of chicken that grows very fast, and its meat is used to meet people's daily needs. Broiler chickens in Indonesia can be harvested within 5-6 weeks with a weight of 1.3-1.6 kg, which is correctly raised to get optimal meat [10].

Heat Stress
Heat stress is a condition in which livestock find it challenging to balance heat production and body temperature expenditure. If the chicken experiences heat that exceeds its heat production (maximum heat losses), this can cause death in the chicken. Therefore, the chicken's body temperature should be maintained at around 39.9 °C to 41 °C. Chickens will die if their body temperature increases by 4°C or more [5]. To maintain body temperature, three-week-old broilers should be kept in an environment with temperatures ranging from 20°C to 25°C and a relative humidity of around 50%-70% [11], 26°C to 27°C for adult broilers, and laying hens between 18°C and 23.9°C [12]. Meanwhile, one-week-old chickens have a temperature of 32°C-34°C and two-week-old chickens have a temperature of 28°C-32°C [13].

PID Control
A PID controller determines the precision of a system with feedback as to its characteristics. PID control uses elements of P, I, and D values, which are mathematical models with Gain + Integral + Derivative as an input. The PID control component consists of three types, namely proportional, integral, and derivative. All three can be used together or separately depending on our desired response to the tool [14]. The PID algorithm is described in Figure 1.
Process where the values are: u(t) = control output; e(t) = difference between set point and output, Kp = gain Proportional; Ki = gain Integral; KD = gain Derivative; Ti = Integral time.

Control P
Proportional control (control P) is proportional to the error value. If the error value is significant, the greater the control signal generated by the controller. Proportional control influences the system [14], including: a) Add or reduce stability. b) Can improve transient response in particular: rise time and settling time. c) Reduce (not eliminate) steady-state error.

Control I
Integral control (control I) is proportional to the change in error. The greater the error value, the faster the control signal increases/changes, Integral control influences the system [14] including: a) Eliminate steady-state errors. b) Slower response (compared to Proportional control). c) Can increase instability.

Control D
Derivative control (control D) is proportional to the change in error. The faster the error changes, the greater the control action caused. Derivative control influences the system [14], including: a) Provides a damping effect on the oscillating system to increase the value of Kp. b) Improved transient response because it provides action when an error changes. c) Only changes when there is an error change. D does not act when there is a static error, so D should not be used alone.

Design
In this research, the authors want to create a system that can automatically monitor the chicken coop's temperature and move the fan. A temperature sensor in the form of a DHT22 sensor is needed. In Figure 2, it can be seen that the system design consists of sensors, controllers, serial monitors, motor drivers, and outputs. The sensor is used to detect the temperature in the chicken coop. The controller functions as the system's core, namely to process data from the sensor and produce output to drive the fan. The serial monitor serves to display the results of system work in real-time. Finally, the motor driver drives the fan according to the input given when the program is run. In this system, the desired error tolerance is 2%. Figure 2. System block diagram. Figure 3 is the flow of the programming algorithm. At the input stage, the temperature value for the setpoint is obtained from the existing temperature data. Then the temperature sensor reads the temperature value in the cage to see how much it differs from the setpoint, and then the PID method works to determine the fan speed to reach the set point.

DHT22 Sensor Calibration and Accuracy Test
The DHT22 sensor is used to detect the temperature value in the system. Tests are carried out to determine whether the DHT22 value follows the predetermined values and functions. The sensor value will be compared with the digital thermometer value.

Data Power
Temperature Data Figure 4. Comparison of temperature test results. As illustrated in Figure 4 and Table 1, the DHT22 sensor and a digital thermometer with a 96.88 percent accuracy value were compared. As a result, the DHT22 sensor is appropriate for this application.

PID Response Testing on The System
The addition of a PID controller improves the system's responsiveness. PID is used to accelerate the rising time, the settling time, and to correct steady-state faults. When the PID is included, the response becomes more accurate by lowering the error value. The controller fixed the fault until it reaches the predetermined point. When Kp = 10, Ki = 0, and KD = 0,1, the system reaches the rise time on the 121st data and the settling time on the 153rd data with a 1.03 percent steady-state error. By examining the stability of the system using the authors' values for Kp, Ki, and KD, we can see that the system response has a small error value and a rapid rising time. As a result, Kp = 10, Ki = 0, and KD = 0.1 are reasonable values due to the system's good reaction.

System Time and Success Test
This test is used to determine the system's success rate and the time required for the tool to reach the predetermined set point. The system was successful in this test when the setpoint was 29°C with a 1.03 percent error and when the setpoint was 28°C with a 0% error. When the setpoint temperature is set to 27°C, 25°C, or 24°C, the system is unable to reach the setpoint and can only reduce the temperature to 27.9°C. When a setpoint temperature of 29°C is applied, the system takes 121 seconds to achieve the setpoint and remains steady for 23 seconds. Meanwhile, when the setpoint temperature is 28°C, the system stabilizes after 404 seconds of reaching the setpoint (Fig 6).

Conclusion
Based on the results of testing and analysis of the temperature monitoring system in chicken coops using the PID method, it can be determined that the calibration of the DHT22 sensor has a sensor accuracy value of 96.88 percent, indicating that the DHT22 sensor is suitable for use in this system. Kp = 10, Ki = 0, and KD = 0.1 were used in trial and error to determine the optimal Kp, Ki, and KD values for the system to achieve the setpoint rapidly and with little errors. The system reaches the set point in 121 seconds, remains stable for 23 seconds, and has a 1.03 percent inaccuracy with these parameters.