# Intelligent Thermal Comfort Controlling System for Buildings Based on IoT and AI
## 3 Material and Methods
### Calculation of Comfort and PMV Value  
Human comfort is related to physiological functions such as sensory function and temperature regulation. At the same time, it is affected by external meteorological factors, such as the temperature, humidity, and pressure of the space in which it is located, the light of the external environment, and the wind speed. When the temperature is moderate, the effects of various parameters on the human body are not significant. But, when the temperature is high or low, its fluctuations become very important to the human body's thermal balance and warmth. Generally speaking, the human body is most sensitive to temperature factors. Therefore, using temperature as a parameter to calculate real-time human comfort can be used as a reference and control for the overall experiment.  
The intelligent thermal comfort control system based on the Internet of Things in this paper can be used to control at least one room comfort parameter in a building. During the experiment, a room with a standard size was selected to arrange the sensors and controllers (see Figure 7). This method is suitable for automatic heating, cooling, ventilation, and lighting in the area of a building. A set of modules contain sensors and controllers, which are placed in the area to be measured indoors. The typical room shown in Figure 7 has hardware including induction acquisition module, light intensity sensor, wind speed sensor, temperature sensor, humidity sensor. They are all connected with the central server that can collect data instantly for an indoor environment. The data is sent and received through the wireless gateway, which has already had existed solutions by technological companies. The article is not going to discuss more the data transferring procedure and its format since the main research methodology is applied to thermal comfort considerations. However, in practical applications, multiple sets of control system equipment can be arranged in multiple rooms, so that each room can run an independent thermal comfort control system.  
Figure 7: Schematic of A Room with Integrated Automation Devices.  
In order to build a more accurate algorithm, two parameters specific to the occupants of the building are considered, Which is the metabolic rate (met) (1 met = 58 W/m\({}^{2}\)) of heat produced by the human body, and the cloning (clo) (1 clo = 0.155K.m\({}^{2}\)/W) that represents the thermal insulation of clothing. In terms of thermal comfort evaluation, [PERSON] proposed a method for evaluating thermal sensation models, called PMV (Predicted Mean Vote). The PMV index comprehensively considers various factors that affect the thermal comfort of the human body, and represents the evaluation of thermal comfort by most people. The PMV indicator contains functions of four environmental parameters and two human parameters. Four environmental parameters are internal air temperature (Ta), air velocity (Va), average radiant temperature (Tr), and relative humidity (HR). The two human parameters are metabolic rate (met) and clothing condition (clo). The method proposed by [PERSON] comprehensively considers the occupants' feelings and environmental parameters, and objectively reflects the thermal phenomenon of the surrounding environment (Figure 8).  
In the Python programming language environment, the formula for calculating PMV is as follows:  
a = 0.028 + 0.3033 * np.exp(-0.036 * m)  
b = 0.028 + 0.3033 * np.exp(-0.036 * m)  
c = 0.42 * (m - w - 58.15) - 0.0000173 * m * (5867 - pa) - 0.0014 * m * (34 - ta)  
d = 3.96 * 10 * (-8) * fd * ((tcl + 273) ** 4 - (tmrt + 273) ** 4) - fcl * 12.1 * va ** 0.5 * (tcl - ta)  
pmv = a * (b - c - d);