The Design of A Telegram IoT-based Chicken Coop Monitoring and Controlling System

This work is licensed under a Creative Commons AttributionShareAlike 4.0 International License Abstract Less ideal chicken coop condition is one reason for the low productivity of chickens in Indonesia. Based on this condition, breeders need monitoring and control devices that can be used easily anywhere and anytime. In this study, the monitoring and control devices based on the Internet of Things (IoT) were successfully designed using the ESP8266 microcontroller. The monitoring system used a DHT11 temperature sensor while the controller used a bulb and fan as the actuator. Monitoring data and control commands were displayed via Telegram. Coop testing was carried out with three different treatmentsthe light was on, the fan was on, and both were on-resulting in temperature and humidity measurement data ranging from 24–32 oC and 61–78%, respectively. Therefore, this monitoring and control device can prevent the conditions of the chicken coop that are ideal less so that chickens' productivity increases.


1.
Introduction Protein is a part of human nutritional needs which can be obtained from either animals or plants. Up to this time of being, meats and egg consumption in Indonesia is counted as 5.51 and 6.36 kg/capita/year, respectively. From all meats and eggs that have been consumed, chicken consumption is calculated as 3.87 kg/capita/year. Meanwhile, purebred egg chicken and egg breed chicken consumption are consecutively counted as 5.84 and 0.18 kg/capita/year. From the mentioned data, it is known that the contribution of the chicken meat nationally reaches as of 70.23%, while the contribution of egg purebred chicken and egg breed chicken nationally reach as of 91.82% and 2.83% consecutively [1]. It can be concluded that native chickens' productivity is quite low due to several factors, such as temperature and humidity [2]. Temperature and the humidity in the coop requires fast and precise monitoring because it is easy to change [3]. Temperature and humidity must be properly regulated, feeding, and drinking as well as maintenance of sanitation so that chickens have avoided heat stress and pests [4]. Aside of that, the chicken coop, which has improper temperature generates the growth of the numbers of Coliform bacteria [5], decreasing the physical quality of chicken meats [6], and decreasing the health quality of its blood [7]. Meanwhile, if the coop humidity is improper, it can potentially generate Campylobacter Jejuni bacteria's growth and increase heat stress of the chickens [8].
Currently, there are many of temperature control devices that are still simple and have not been integrated with the Internet of Things (IoT) platform. Thus, the process of temperature and humidity control takes relatively a lot of time [9]. As for the air quality monitoring program that is not carried out in real-time, then the chickens will have the possibility of the diseases due to the poorly monitored [10]. To overcome this, the researchers offer an innovative device for monitoring the air quality of chicken coops based on temperature, humidity, fan, as well as an incandescent bulb with the help of IoT.
Technology advances in the microcontroller, which is based on the IoT, leads to an ease in the communication via internet. This technology can be controlled anytime and everywhere as long as it is connected to an internet connection [11]. A microcontroller is a chip that can be used as a control [12]. The development of monitoring and controlling technology for chicken coops is currently being developed, including the use of Arduino Uno microcontroller [13], Arduino Nano [14], NodeMCU [15], ESP-32 [16], up to the use of a Raspberry Pi mini-computer [17]. Meanwhile, the coops data transmission can be delivered via radio frequency 2.4 GHz NRF24L01 [18], via SMS with SIM 900A module [19], up to Bluetooth [20]. Environmental conditions can be monitored using a platform named Telegram. Telegram is a popular messaging service based on the open-source platform found by Rusia Pavel Durov in 2013 [21]. This platform is cloud-based and is using an end-to-end encryption system, self-destruction messages, and multi-data structure infrastructure [22]. The provided facility is an automatic notification by utilizing an open Application Programming Interface (API) through bots to send an automatic message [23]. Telegram is available on both mobile phones and desktop. On mobile, it is available on iPhone, Android, and Windows phones. While on desktop, it is available on Windows, Linux, and MacOS and web browser [24].
Therefore, this article discusses the design of a chicken coop monitoring and controlling system using ESP-32 technology, an open IoT platform, which is easy to use by anyone. Moreover, this platform uses a cloud-based, end-to-end encryption system, self-destruction messages, and multi-data structure infrastructure. The automatic messages will then be delivered through the bots to the user to adjust the chicken coops quality as hoped-for. The chicken coops' measured parameters are the temperature and humidity coops using the DHT11 sensor equipped with an incandescent bulb and fan as the temperature and humidity actuator chicken coops. The addition of an incandescent bulb is useful for increasing the temperature and humidity. In contrast, a bulb's addition is useful for decreasing the temperature and humidity inside the coops. Sensor data will be displayed on Telegram, which can be accessed by the users. This study provides profound comprehension about IoT-based technology design in monitoring and controlling the chicken coops.

2.
Method Overall, this system consisted of hardware and software. The hardware includes the required types of sensors and a microcontroller. The use of module types included the DHT11 sensor to monitor the temperature and the humidity. Real-Time Clock (RTC) is an integrated circuit on the motherboard of the computer that saves time-value, SD-card module to keep the data on the memory card as well as the initiation of an actuator in the form of fan and incandescent lamp, and Wi-Fi ESP8266 NodeMCU module used for delivering the sensor data as shown in Figure 1. Meanwhile, the software uses Arduino IDE software and Telegram.
Actuator control in the form of a fan and incandescent light is connected to a two-channel automatic switch module (relay) on pin D0 and D1 NodeMCU. The DHT11 sensor reading requires one digital pin, namely on pin D2 NodeMCU. Next, pin D3, and D4 NodeMCU are used as I2C communication by the RTC module. SD-card module requires four NodeMCU pins for SPI communication, such as D5, D6, D7, and D8. After the hardware has been designed, the next step is to give commands via the programming language in Arduino IDE software. As for Telegram, the synchronization step is done using a bot account provider, namely botfather. Important information required for synchronization is API token and a bot account that has been created and a Telegram ID user. Telegram ID information can be obtained from Telegram to keep the safety in accessing the bot account. The initial step is started by connecting to the Wi-Fi. If the device has successfully connected to the WiFi, the next step is synchronized with the bot ID and the user, and then a bot Telegram account will be responding to the users' commands (see Figure 2).
WiFi connection is the main requirement in the hardware system, then the chicken coops condition such as temperature and humidity parameter that is detected by DHT11 module. In addition, the main requirement for the actuator function is the readiness of an automatic switch that is connected to the incandescent bulb and fan. The RTC module starts the time recording with all the activities that have been done will be saved on the SD-card (see Figure 3). The temperature and humidity sampling retrieval are carried out by giving an incandescent bulb and fan effect both of 11 samples. Data recording was also carried out using standard measuring instruments, namely a thermometer and hygrometer. The data acquisition results by the DHT11 sensor have a temperature and humidity correction value of ± 3 ºC and ± 3%, respectively, which corresponds to the calculation of the error.

3.
Results and Discussion The design of a Telegram IoT-based chicken coop monitoring and the controlling system has been successfully created. The device is in the form of a cube box, as shown in Figure 4. The device is arranged following the explanation in the method section of this article, which can then be seen more clearly in Figure 5.
The bot account in Telegram that has been programmed will respond to the user because the user sends a message to start as in Figure 6. The bot account will provide several command options. The actuator in the form of an incandescent bulb and a DC fan can be turned on or off by the user. The command /NyalakanLampuPijar (turn on the incandescent light) will turn on the incandescent lamp, while the /MatikanLampuPijar (turn off the incandescent light) will turn off the incandescent lamp. The command /NyalakanKipasDC (turn on the DC Fan) will then turn on the fan while /MatikanKipasDC (turn off the DC Fan) will turn off the fan. Information about the bulb and fan status can be found using the command /StatusLampudanKipas (status of light and fan).   If both actuators are turned off, the /KondisiDaruratMatikanKeduaAktuator (emergency condition turn off second actuator) command can be used. The process of monitoring temperature and humidity is carried out by using the /StatusMonitoring command to obtain data in the form of temperature and humidity values for the coop at that time. Every command that is sent will get a reply from the bot account, as shown in Figure 6.b and Figure 6.c.
Based on those three images, the Telegram bot account's reply message has a small delay time. This is due to a good internet connection so that message delivery by the monitoring device server has a small delay. In addition, adequate electricity flow is also an essential factor so that the monitoring device can operate properly. When the power suddenly goes out, the device cannot send a reply message to the command that has been sent by the user. This is because the equipment is not equipped with an internal power source to fully use the PLN connection.
The data that has been received from Telegram software were processed with Microsoft Office Excel software and compared with standard measuring instruments (thermometer and hygrometer). The data acquisition results by the DHT11 sensor have a correction value of ± 3, as shown in Table 1, which corresponds to the calculation of the error. Based on the monitoring, there is a fluctuating change in the temperature and humidity values of the coop, which are respectively (24 ± 3) ºC to (32 ± 3) ºC and (61 ± 3) % to (78 ± 3)%. The monitoring results were obtained with 3 different coop treatments, namely, the bulb was on, the fans were on, and both were on as shown respectively in Figure 9-14.
Based on Figure 9, the bulb's effect on can increase the chicken coops temperature to (32 ± 3) ºC from the initial temperature with an increase in the average temperature (0.8 ± 3) ºC. Meanwhile, based on Figure 10 the humidity value drops to (63 ± 3) % from the initial humidity, namely (76 ± 3) %, with an average decrease in the humidity of 1.4%. These two results differ from standard measuring instruments with a temperature difference of 8.21% and 7.96% humidity. This is due to the conditions where the data was collected, there was a lot of wind, so it was affected externally by temperature and humidity. Temperature and humidity are ideal conditions for chicken breed coops. Chicken breed generally needs a temperature of 30-32 o C with a humidity of 60-80% [25].
The effect of fan duration is shown in Figure 11 and Figure 12. In this treatment, the 's temperature decreased to (26 ± 3) ºC from the initial temperature (27 ± 3) ºC with an average temperature increase of 0.1 ºC. In comparison, the humidity of the coops increased to (71 ± 3) % from the initial value, namely (70 ± 3) % with a decrease in mean humidity of 0.1%. These two results differ from standard measuring instruments with a difference of 14.6% for temperature and 0.513% for humidity. From these results, the fan provides changes in temperature and humidity for the coop conditions, namely 1 ºC and 1%, respectively. This is due to the conditions where the data is collected. There is a lot of wind to beat the wind flow generated by the fan. However, this result is an ideal result for chicks aged 15-21 days, especially on temperature monitoring, while the ideal humidity is also ideal for chickens in general [26].
The data collection conditions were carried out during a windy night so that the fan would facilitate the coop's air circulation, which increased coop temperature not as maximally as the first coop treatment. However, temperature and humidity are ideal conditions for chickens in general. The monitoring data has a difference in numbers with standard measuring instruments, namely 17.7% and 4.84% for temperature and humidity, respectively.
Overall monitoring data obtained the mean difference and the percentage difference between the mean of 3.30 ºC; 2.61%; and 13.4 ºC; 3.95% for temperature and humidity respectively compared to data obtained from standard measuring instruments. The monitoring device used is a DHT11 sensor with a tolerance limit for the difference in temperature and humidity of 2 ºC and 5%, respectively [26]. Based on this information, the measurement by monitoring device in the humidity aspect can still be tolerated and is considered accurate. Likewise, for the temperature aspect, regardless of external factors. It is recommended to place the coop in good air circulation so that the measurement can be more accurate and stable. Apart from these external factors, this chicken coop condition monitoring device can potentially breed farmers to achieve food security, which is the substance of one of the SDGS goals, namely without hunger.

Conclusion
IoT-based chicken coop monitoring and controlling devices using Telegram software have a fast response making it easier for chicken breed farmers to increase their productivity. It is also easy to use with various commands needed to maximize the productivity of the chicken breed. Based on the three treatments applied, the largest increase in temperature and decrease in humidity is found in the first treatment, which is only turning on the lights. These values are 0.8 ºC and 1.4%, respectively. Monitoring data ranged from 24-32 ºC and 61-78% for temperature and humidity, respectively. The measured humidity has a mean difference of 2.61% compared to standard measuring instruments, so it can be said to be accurate. Meanwhile, the temperature measurement has a mean difference of 3.30 ºC so it can be said to be accurate because of the unsupportive conditions. Based on these results, it is advisable to place the coop in a condition protected from the wind. Thus, monitoring and controlling devices can prevent the conditions of the chicken coop that are not ideal so that chickens' productivity increases.