The feasibility study: Accuracy and precision of DHT 22 in measuring the temperature and humidity in the greenhouse

The greenhouse is a technology to overcome weather uncertainty as an impact of climate change. It can manage and control the temperature and humidity adjusted to the plant’s needs. Therefore, it requires accurate input of climate data from the monitoring system. The study aims to design an affordable and feasible monitoring system using three DHT22 sensors installed in a greenhouse. In particular, the data is appeared on Liquid Cyrstal Display (LCD) and is transmitted to the Ubidots platform using ESP32. The accuracy level is quantified by the difference values between DHT22 and the thermos-hygrometer, while the precision level is calculated using the correlation analysis of each sensor. As a result, the accuracy of DHT22 in measuring the temperature and humidity is high, with Root Mean Square Error (RMSE) of 1.48°C and 3.18%, respectively. Furthermore, the correlation values are 0.81 and 0.85. In conclusion, the research successfully produces an appropriate real-time system to monitor temperature and humidity.


Introduction
Bogor Agricultural Development Polytechnic (Polbangtan) is a vocational education established by the Ministry of Agriculture.The mission is to produce entrepreneurial graduates, especially in urban farming development.Its applied learning system focuses on increasing students' practical skills with a percentage of 70% practice and 30% theory.Based on [1], vocational education needs a replica of a company that is adopted and transformed on campus to support the practical skill of students.Polbangtan Bogor has an agriculture and animal husbandry teaching factory collaborating with companies or the government.In 2019, the Directorate General of Agricultural Infrastructure and Facilities, Ministry of Agriculture, gave smart greenhouse grants to Polbangtan Bogor.Not only as a teaching factory, but it can also be used to i) crop production units with high economic value, ii) 1230 ( 2023 For cultivation, implements two hydroponic systems: the nutrient film technique and the dutch bucket.Commodities planted include lettuce, pakchoi, kailan, and melon.The hydroponic system has several advantages, such as i) the water loss is lower, ii) the provision of nutrients with more precision, and iii) high productivity [2][3][4].It has a high-opportunity business in the future.A large investment is needed for the installation, so planning-related components and materials must be considered appropriately [4].
The greenhouse is popular as precision agriculture that can provide the ideal microclimate for crop growth [5].It is important because temperature, relative humidity, sunlight, and wind speed are critical agricultural, environmental conditions.Those cases rapidly drive weather forecasting, monitoring, and controlling technology growth [6].Here is an IoT approach that broadly connects some instruments to share, store, process, and analyze data using the internet [7].
In advance, agriculture needs an efficient and accurate indoor microclimate monitoring system.Combining several inexpensive sensors to build a monitoring system has proven effective and accurate.Sensors are utilized at multiple points to measure the environmental condition.It connects to the Ubidots platform to show the data in real-time [6,8,9].DHT22 is a low-cost sensor that can measure temperature and relative humidity.It produces an analogue signal to the digital output and transmits it to a data pin.Data is read using a single wire and extracted into temperature ( o C) and relative humidity (%) values [10].The previous study proved that the performance of DHT22 in measuring humidity and temperature board range is accurate [11].Based on the previous study above, the research aims to develop a microclimate monitoring system with affordable and precision DHT22.

Monitoring system design
The research was conducted from February until December 2022 in SGH Polbangtan Bogor, with a total area of 400 m 2 .The maximum indoor temperature is 42 o C and a minimum 24 o C. IoT provides information regarding temperature and humidity to facilitate integration and communication between several devices.The study produced a monitoring system with three DHT22 sensors equipped with an Atmega2560-based slave processor.Two-way communication between devices using an RS485 cable network with a full duplex master-slave method that sends multiple data from each slave to the master processor, which combines Atmega2560 and ESP32.
The monitoring system consists of two subsystems: master-slave and sensor-enslaved person.The master-slave comprises AVR Atmega2560 and ESP32, which transmit temperature and humidity data to the server every hour using an internet connection from a wifi router.Meanwhile, the three slave sensors comprise an ATMega 2560 AVR, which manages temperature and humidity data using the full duplex method or two-way serial communication based on RS458.
The workflow of the microclimate monitoring system is as follows: 1.The DHT22 sensor is equipped with a slave processor based on the Atmega2560 microcontroller installed at the front, middle, and back of the greenhouse; 2. the master processor requests temperature and humidity data from three slaves starting with the numbering character of each slave (Slave 1 character "1", Slave 2 character "2", Slave 3 character "3"), and then the data is sent to the master processor alternately through the RS485 serial cable network; 3. the master processor receives and partitions the temperature and humidity data from each slave; and 4. partition result data will be sent and stored in a cloud called Ubidots, which can be monitored by handphone or laptop in real-time.
The flow chart of a monitoring system is shown in Figure 1, the design of the monitoring system is shown in Figure 2, the user interface of monitoring is in Figure 3, the motherboard connection is in Figure 4, and more information is in Table 1.

Result and analysis
RMSE is used to compare and calculate the different values of the sensor and calibrator.Beforehand, the accuracy of the thermo-hygrometer HTC-2 as a calibrator is validated using a comparative method to the performance of the temperature and humidity meter UNI-T UT333 in various conditions.After the calibration, the sensors and calibrator are installed in the greenhouse's front, middle, and back points to represent the spreading of temperature and humidity in the greenhouse.The placement of sensors is shown in Figure 5.The data are taken every hour of the day, and the analysis result of temperature and relative humidity are shown in Figures 6 and 7, respectively.Based on Figure 6, sensors I, II, and III can measure temperature with RMSE of 1.65, 1.86, and 0.92, respectively.It is better than similar research in which RMSE is 5.79 and -2.31 [10,12].It is influenced by the non-uniformity of laboratory temperature conditions [12].An additional test was carried out using correlation to measure the accuracy of DHT22 compared to a thermos-hygrometer.In Table 2, the result shows that the average correlation coefficient is 0.81.It can be concluded that the DHT22's ability to measure temperature is good (r values > 0.8).Based on Figure 7, the capability of sensors I, II, and III to quantify the relative humidity is 3.17, 3.70, and 2.68, respectively.It is better than the previous study, which investigates the ability of the DHT22 to measure relative humidity with RMSE 4%.It is because Indonesia differs from where the sensor is made, also called environmental errors [13].In addition, a correlation analysis test was performed to measure the accuracy of DHT22.Based on the results in .1088/1755-1315/1230/1/012146 2 hydroponic cultivation training, and iii) edutourism for the public.

Figure 2 .
Figure 2. Design of a monitoring system.

Figure 3 .Figure 4 .
Figure 3.The user interface of the monitoring system.

Figure 5 .
Figure 5.The placement of sensors in the greenhouse.

Figure 6 .
Figure 6.Temperature calibration at each point of the greenhouse (a) front, (b) middle, and (c) back

Figure 7 .
Figure 7. Relative humidity calibration at each point of the greenhouse (a) front, (b) middle, and (c) back

Table 2 .
The result of regression analysis on temperature.

Table 3 ,
it obtained an average correlation coefficient of 0.85.It can be concluded that the sensor's ability to measure relative humidity is good (r values > 0.8).

Table 3 .
The result of regression analysis on relative humidity.system has been successfully created.Data can be viewed in real-time via the Ubidots platform.DHT22 has a good level of accuracy in measuring temperature and humidity, with an RMSE of 1.48 o C and 3.18%, respectively.Furthermore, the correlation values are 0.81 and 0.85.In conclusion, this study produced a precise and affordable system for monitoring temperature and humidity in the greenhouse.