An Expandable Modular Internet of Things (IoT)-Based Temperature Control Power Extender

: Today, the world’s electricity consumption is growing rapidly, and therefore energy de-mands are also increasing. In the past few decades, various measures have been taken to improve equipment and system design to increase production and transmission efﬁciency and reduce power consumption. This article proposes a novel Internet of Things (IoT)-based temperature control power extender with two working modes of cooling and heating to solve power shortages. The power is turned on or off accurately and in a timely manner through a temperature-sensing element, thereby avoiding unnecessary power consumption to achieve the goal of energy-saving. This can directly power on or off the power extender through the Internet. It can also use a 2.4G Wi-Fi wireless transmission to transmit, for example, real-time temperature information, the switch status and the master–slave mode. Related data can be controlled, collected and uploaded to the cloud. Each proposed power extender’s temperature setting in a large-scale ﬁeld can be set uniformly, and no staff is wasted to set the temperature separately. Taking a general industrial electric fan as an example, if it is changed to drive with this temperature control extension cable, and assuming that the industrial electric fan is activated for 900 s per hour, its power-saving rate is 74.75%. L.-B.C.; C.-T.L. and L.-B.C.; supervision, L.-B.C.; project administration, C.-T.L. and Y.-Y.L.; funding acquisition, L.-B.C.


Introduction
Global warming is becoming more and more serious, and climate abnormalities worldwide occur one after another. After the Kyoto Protocol to curb global greenhouse gas emissions comes into effect, energy technology innovation and energy conservation will become effective strategies for reducing carbon dioxide. Due to the gradual expansion of global warming and the rapid changes in the ecological environment, many different ecological crises have begun to occur worldwide. Therefore, all government organizations and non-governmental organizations attach great importance to such an issue [1].
Nowadays, the world's residential electricity consumption is growing rapidly. People are more and more interested in more efficient devices for such a large amount of energy, especially after doubling oil prices led to an increase in electricity rates [2]. Population growth has brought about the problem of a lack of natural resources. Artificial resources such as electricity cannot cope with rapid population growth. In the past few decades, various measures have been taken to improve the equipment and system design to increase production and transmission efficiency and reduce power consumption [3].
This article proposes a novel master-slave expandable modular IoT-based temperature control extensor. The proposed extensor provides two working modes of cooling and heating through a temperature-sensing element to turn on or off the power accurately and in a timely manner, thereby avoiding unnecessary power consumption. Besides that, the data of real-time temperature information, the switch status and the master-slave mode control can be collected and uploaded to the cloud through Wi-Fi wireless transmission. The terminal device can perform manual, semi-automatic and fully automatic parameter setting and can achieve energy-saving in multiple applications. Therefore, each function's research and planning are a modular design. The functional modules are connected in series through the connecting board, thereby achieving low costs and miniaturization advantages.

Preliminary
The primary purpose of this work is energy saving. In many areas, the weather is too hot in summer. People usually use air conditioners to lower indoor temperatures. However, the air conditioner consumes a lot of electricity, so many people only turn on the air conditioner. After 3 h, the air conditioner will be turned off (using a timer function). Nevertheless, the indoor temperature will slowly rise at this time, and it may take less than 30 min for people to wake up from high temperatures. Hence, they must get up and turn on the electric fan to dissipate the heat, interrupting sleep, and over a long time, this leads to low sleep quality. At this point, if we use our work to assist with controlling indoor temperatures, we can significantly improve this situation. When the temperature rises above the set temperature in this work's cooling mode, the temperature control extension cord will start to supply power to the socket connected to the cooling method. Currently, the device (such as an electric fan) begins to cool down the temperature. When the temperature is too low, the temperature control extension cord will stop the power supply to avoid wasting power.
In this way, people can use the air conditioner and low-power electric fans-instead of using the power-consuming air conditioner for cooling all night-if the air conditioner is turned on for 2-3 h. First, we can use the temperature control power extender to turn on the electric fan to dissipate heat, as shown in Figure 1. themselves and conflict with each other, focusing on one side is not enough to provide adequate performance for actual IoT applications. As a result, they must be considered jointly [12]. Hao and Zhang [26] analyzed media access control (MAC) performance for reliable power-line communication networks with automatic repeat request (ARQ) schemes. Saban et al. [27] developed a sensor node-based network for remote moisture measurement in timber based on Bluetooth low energy (BLE) and a web-based monitoring system. Other extender applications can be found in [28][29][30][31][32][33][34][35][36][37][38][39][40][41].
This article proposes a novel master-slave expandable modular IoT-based temperature control extensor. The proposed extensor provides two working modes of cooling and heating through a temperature-sensing element to turn on or off the power accurately and in a timely manner, thereby avoiding unnecessary power consumption. Besides that, the data of real-time temperature information, the switch status and the master-slave mode control can be collected and uploaded to the cloud through Wi-Fi wireless transmission. The terminal device can perform manual, semi-automatic and fully automatic parameter setting and can achieve energy-saving in multiple applications. Therefore, each function's research and planning are a modular design. The functional modules are connected in series through the connecting board, thereby achieving low costs and miniaturization advantages.

Preliminary
The primary purpose of this work is energy saving. In many areas, the weather is too hot in summer. People usually use air conditioners to lower indoor temperatures. However, the air conditioner consumes a lot of electricity, so many people only turn on the air conditioner. After 3 h, the air conditioner will be turned off (using a timer function). Nevertheless, the indoor temperature will slowly rise at this time, and it may take less than 30 min for people to wake up from high temperatures. Hence, they must get up and turn on the electric fan to dissipate the heat, interrupting sleep, and over a long time, this leads to low sleep quality. At this point, if we use our work to assist with controlling indoor temperatures, we can significantly improve this situation. When the temperature rises above the set temperature in this work's cooling mode, the temperature control extension cord will start to supply power to the socket connected to the cooling method. Currently, the device (such as an electric fan) begins to cool down the temperature. When the temperature is too low, the temperature control extension cord will stop the power supply to avoid wasting power.
In this way, people can use the air conditioner and low-power electric fans-instead of using the power-consuming air conditioner for cooling all night-if the air conditioner is turned on for 2-3 h. First, we can use the temperature control power extender to turn on the electric fan to dissipate heat, as shown in Figure 1.  It can quickly achieve the indoor cooling and energy-saving objectives. Hence, we can also use the proposed temperature control extensor to turn on the electric fan while turning on the air conditioner and reduce the indoor temperature at the same time. Furthermore, some experts have found that every one degree decrease in the set temperature will consume about 2-3% of the electricity. Therefore, it is recommended to use low-power electric fans when using air conditioners. When the indoor temperature reaches a sufficient cooling level, the temperature control extensor will automatically turn off the electric fan, which will avoid improper power wasting.
This work can also be used to facilitate the breeding of livestock. For example, general pig farms have very high requirements for temperature control. Heat stress is prone to occur when the ambient temperature exceeds 33 • C and the duration of this temperature is long. Given this response, if ventilation and cooling measures are not taken to improve the environmental temperature and humidity, the pig's health will be compromised, which will affect the efficiency of breeding. Therefore, in the hot summer, pig farms face high temperatures, high humidity and unfavorable climates. However, the farm cannot install air conditioning to control the temperature due to the consideration of electricity costs. Generally, only large industrial fans are used to cool down these facilities. When using large industrial fans to cool down temperatures, the impact on the electricity bill is also very considerable.
Moreover, industrial fans can only cool down temperatures. If the temperature drops significantly in the middle of the night, it will be too cold and cause some pigs discomfort. At this time, if the industrial fan is connected to the temperature control extension line, when the temperature of the farm is too high, the industrial fan will automatically start. When the temperature is too low, the industrial fan will automatically turn off.
This work can be used to cool down residential environments and livestock breeding facilities and be used to cool outdoor equipment. Benoit-Cattin et al. [42] evaluated the effect of long-term high temperatures on a CPU-based edge device's performance. The experiment proved heat dissipation. It greatly helped to improve the CPU-based edge device's performance. Therefore, if the temperature control extensor is used to cool outdoor equipment, then it is an excellent energy-saving choice. Usually, when the sun out completely, the cooling demand is very high. The night temperature is lower, and no additional cooling is required.
Conversely, this work can also provide a heating mode when the temperature drops below the set temperature. The proposed IoT-based temperature control extensor starts to supply power to the heating device connected to the socket (such as an electric heater). When the temperature is too high, the proposed IoT-based temperature control extensor will stop supplying power. When the elderly or children are in a cold winter, they need the heating mode of the proposed IoT-based temperature control extensor, and this function is also very much required when raising chickens or pigs.
In summary, the proposed IoT-based temperature control power extender mainly provides the following contributions:

•
The power is turned on or off accurately and in a timely manner through a temperaturesensing element, thereby avoiding unnecessary power consumption and achieving the purpose of energy-saving; • When the proposed power extenders are used in large-scale farms, the commands are transmitted to other slave power extenders through Wi-Fi 2.4G wireless transmission, saving on setting staffing; • Old machines and equipment can have smart functions through the proposed power extender, and their switches can be controlled remotely through a mobile device.

The Proposed IoT-Based Temperature Control Power Extender
The proposed IoT-based temperature control power extender can accurately turn on or off the power supply at the right time through a temperature-sensing element. It can also directly turn on or off the power extender through the Internet. A Wi-Fi wireless transmission module uniformly sets each extender's temperature setting in a large field. Figure 2 shows a flowchart of the system process. Figure 3 shows the system architecture. As shown in Figure 2, the system first establishes a connection with the cloud server. If there is no connection, the system will repeatedly try to establish a relationship. After a Electronics 2021, 10, 565 5 of 17 connection is established, the system will wait for a command from the application and turn on or off the proposed power extender's power supply, according to the command's content. Then, the system will turn on or off or set the proposed power extender's heating or cooling mode, high temperature value and low temperature value. Then, the system checks whether the connection continues and repeats the whole process. plication and turn on or off the proposed power extender's power supply, according to the command's content. Then, the system will turn on or off or set the proposed power extender's heating or cooling mode, high temperature value and low temperature value. Then, the system checks whether the connection continues and repeats the whole process.

System Process and Architecture
The proposed IoT-based temperature control power extender can upload real-time temperature information, as well as the switch status and master-slave mode control. These related data can be collected in the cloud through Wi-Fi wireless transmission. The terminal device can perform under manual, semi-automatic or fully automatic parameter settings. The terminal device can be a mobile phone, a tablet or a computer. When master power extender A receives the command information from the public or private cloud server, it will immediately forward the command to other slave power extenders via Wi-Fi wireless transmission.   Figure 4 shows the hardware block diagram of the proposed IoT-based temperature control power extender. The power supply module is a 110 V/220 V universal voltage. The microcontroller unit (MCU), according to the set temperature information and the  The proposed IoT-based temperature control power extender can upload real-time temperature information, as well as the switch status and master-slave mode control. These related data can be collected in the cloud through Wi-Fi wireless transmission. The terminal device can perform under manual, semi-automatic or fully automatic parameter settings. The terminal device can be a mobile phone, a tablet or a computer. When master power extender A receives the command information from the public or private cloud server, it will immediately forward the command to other slave power extenders via Wi-Fi wireless transmission. Figure 4 shows the hardware block diagram of the proposed IoT-based temperature control power extender. The power supply module is a 110 V/220 V universal voltage. The microcontroller unit (MCU), according to the set temperature information and the current temperature, sends commands to the control circuit to determine whether the extender should be powered to the output terminal. The rules of deciding whether to supply power are shown in Table 1. The communication module is a Wi-Fi 2.4G wireless transmission module responsible for data transmission with the cloud and transmission between extenders, as shown in Figure 4.  Figure 4 shows the hardware block diagram of the proposed IoT-based temperature control power extender. The power supply module is a 110 V/220 V universal voltage. The microcontroller unit (MCU), according to the set temperature information and the current temperature, sends commands to the control circuit to determine whether the extender should be powered to the output terminal. The rules of deciding whether to supply power are shown in Table 1. The communication module is a Wi-Fi 2.4G wireless transmission module responsible for data transmission with the cloud and transmission between extenders, as shown in Figure 4.  Table 1. Power supply rules for the cooling and heating modes.

Power On
Power Off

Cooling Mode
When the current temperature is higher than the Max (high temperature value), a cooling device (such as an electric fan) needs to be activated.
When the current temperature is lower than the Min (low temperature value), there is no need to cool down at this time.

Heating Mode
When the current temperature is lower than the Min (low temperature value), the heating equipment (such as an electric heater) needs to be activated.
When the current temperature is higher than the Max (high temperature value), there is no need to heat up at this time.
In this article, the high temperature value is marked as the Max, and the low temperature value is marked as the Min. When the temperature rises above the set high temperature value in cooling mode, the temperature control extension cord will supply

Power On
Power Off

Cooling Mode
When the current temperature is higher than the Max (high temperature value), a cooling device (such as an electric fan) needs to be activated.
When the current temperature is lower than the Min (low temperature value), there is no need to cool down at this time.

Heating Mode
When the current temperature is lower than the Min (low temperature value), the heating equipment (such as an electric heater) needs to be activated.
When the current temperature is higher than the Max (high temperature value), there is no need to heat up at this time.
In this article, the high temperature value is marked as the Max, and the low temperature value is marked as the Min. When the temperature rises above the set high temperature value in cooling mode, the temperature control extension cord will supply power to the cooling device connected to the socket. At this time, the target object will start to cool down. When the temperature is lower than the set low temperature value, the temperature control extension cord will stop supplying power. Conversely, when the temperature drops below the set low temperature value in heating mode, the temperature control extension cord will supply power to the heating device connected to the socket.
At this time, the target will start to raise the temperature. When the high temperature is higher than the set value, the temperature control extension cord will stop supplying power. A photograph of the hardware prototype of this work can be seen in Figure 5.
power to the cooling device connected to the socket. At this time, the target object will start to cool down. When the temperature is lower than the set low temperature value, the temperature control extension cord will stop supplying power. Conversely, when the temperature drops below the set low temperature value in heating mode, the temperature control extension cord will supply power to the heating device connected to the socket. At this time, the target will start to raise the temperature. When the high temperature is higher than the set value, the temperature control extension cord will stop supplying power. A photograph of the hardware prototype of this work can be seen in Fig  The setting buttons can set the extender's heating or cooling mode, high temperature value, low temperature value and other information. The temperature setting button increases or decreases the temperature. Taking Figure 6 as an example, it is currently set to cooling mode, where the high temperature value is 26 °C , the low temperature value is 24 °C and the current temperature is 20.6 °C . If the temperature rises to 26 °C , the proposed extender will supply power to the load (such as an electric fan) when the temperature drops to 24 °C , and the proposed extender's sockets stop supplying power (power off).  Figure 7 demonstrates an example of the heating mode, where the high temperature value is 24 °C , the low temperature value is 21 °C and the current temperature is 20.7 °C . If the temperature is lower than 21 °C (currently lower than 21 °C ), the sockets of the proposed extender will supply power to the load (such as an electric heater), and when the temperature rises to 24 °C , the sockets of the proposed extender will stop supplying power (power off). In addition to setting these parameters through the setting The setting buttons can set the extender's heating or cooling mode, high temperature value, low temperature value and other information. The temperature setting button increases or decreases the temperature. Taking Figure 6 as an example, it is currently set to cooling mode, where the high temperature value is 26 • C, the low temperature value is 24 • C and the current temperature is 20.6 • C. If the temperature rises to 26 • C, the proposed extender will supply power to the load (such as an electric fan) when the temperature drops to 24 • C, and the proposed extender's sockets stop supplying power (power off).
power to the cooling device connected to the socket. At this time, the target object will start to cool down. When the temperature is lower than the set low temperature value, the temperature control extension cord will stop supplying power. Conversely, when the temperature drops below the set low temperature value in heating mode, the temperature control extension cord will supply power to the heating device connected to the socket. At this time, the target will start to raise the temperature. When the high temperature is higher than the set value, the temperature control extension cord will stop supplying power. A photograph of the hardware prototype of this work can be seen in Fig  The setting buttons can set the extender's heating or cooling mode, high temperature value, low temperature value and other information. The temperature setting button increases or decreases the temperature. Taking Figure 6 as an example, it is currently set to cooling mode, where the high temperature value is 26 °C , the low temperature value is 24 °C and the current temperature is 20.6 °C . If the temperature rises to 26 °C , the proposed extender will supply power to the load (such as an electric fan) when the temperature drops to 24 °C , and the proposed extender's sockets stop supplying power (power off).  Figure 7 demonstrates an example of the heating mode, where the high temperature value is 24 °C , the low temperature value is 21 °C and the current temperature is 20.7 °C . If the temperature is lower than 21 °C (currently lower than 21 °C ), the sockets of the proposed extender will supply power to the load (such as an electric heater), and when the temperature rises to 24 °C , the sockets of the proposed extender will stop supplying power (power off). In addition to setting these parameters through the setting Figure 6. Cooling mode example. It is currently set to cooling mode. The high temperature value is 26 • C, the low temperature value is 24 • C and the current temperature is 20.6 • C. Figure 7 demonstrates an example of the heating mode, where the high temperature value is 24 • C, the low temperature value is 21 • C and the current temperature is 20.7 • C. If the temperature is lower than 21 • C (currently lower than 21 • C), the sockets of the proposed extender will supply power to the load (such as an electric heater), and when the temperature rises to 24 • C, the sockets of the proposed extender will stop supplying power (power off). In addition to setting these parameters through the setting buttons of the proposed IoT-based temperature control extender, the proposed extender can also be set via the mobile device application, as shown in Figure 8. buttons of the proposed IoT-based temperature control extender, the proposed extender can also be set via the mobile device application, as shown in Figure 8.  In addition to the heating or cooling modes, high temperature value and low temperature value of the proposed extender, we can also see the channel value of the proposed extender. This function is designed for large application fields because the number of proposed extenders may be as many as hundreds in a large application field. It is a vast project to establish such a large number of extenders. Therefore, the proposed extender with the same channel value can be set to the same parameter value simultaneously, which can save a lot of effort. For example, suppose the master extender in Figure  9 is set to 000 (i.e., the dip switch is set to 000). In that case, the set parameters can be transferred to other channels through Wi-Fi wireless transmission and assigned to the slave extender of 000 for the slave sockets of different channels. As a result, this setting cannot be received. buttons of the proposed IoT-based temperature control extender, the proposed extende can also be set via the mobile device application, as shown in Figure 8.  In addition to the heating or cooling modes, high temperature value and low tem perature value of the proposed extender, we can also see the channel value of the pro posed extender. This function is designed for large application fields because the num ber of proposed extenders may be as many as hundreds in a large application field. It a vast project to establish such a large number of extenders. Therefore, the proposed ex tender with the same channel value can be set to the same parameter value simultane ously, which can save a lot of effort. For example, suppose the master extender in Figur 9 is set to 000 (i.e., the dip switch is set to 000). In that case, the set parameters can b transferred to other channels through Wi-Fi wireless transmission and assigned to th slave extender of 000 for the slave sockets of different channels. As a result, this settin cannot be received. In addition to the heating or cooling modes, high temperature value and low temperature value of the proposed extender, we can also see the channel value of the proposed extender. This function is designed for large application fields because the number of proposed extenders may be as many as hundreds in a large application field. It is a vast project to establish such a large number of extenders. Therefore, the proposed extender with the same channel value can be set to the same parameter value simultaneously, which can save a lot of effort. For example, suppose the master extender in Figure 9 is set to 000 (i.e., the dip switch is set to 000). In that case, the set parameters can be transferred to other channels through Wi-Fi wireless transmission and assigned to the slave extender of 000 for the slave sockets of different channels. As a result, this setting cannot be received.
Finally, the adopted electronic components and their specifications for this work are shown in Table 2. The relay module is a 5 V/10 A two-channel relay board. Each channel requires approximately 15-20 mA of driver current and can be safely connected to loads with up to 250 V and 10 A AC voltage and a 30 V and 10 A DC voltage. The relay is very useful in most control applications because it can directly control the relay by the 3.3 V or 5 V signal of the PIC, DSP, AVR, Arduino or other microcontrollers. Finally, the adopted electronic components and their specifications for this work are shown in Table 2. The relay module is a 5 V/10 A two-channel relay board. Each channel requires approximately 15-20 mA of driver current and can be safely connected to loads with up to 250 V and 10 A AC voltage and a 30 V and 10 A DC voltage. The relay is very useful in most control applications because it can directly control the relay by the 3.3 V or 5 V signal of the PIC, DSP, AVR, Arduino or other microcontrollers.
In this article, the communication transmission adopts the message queuing telemetry transport (MQTT) protocol architecture [43]. Hence, the system can synchronize the time with the central server every minute, avoiding the related problems caused by an unsynchronized time and data delays as follows: 1. We use the finite element machine architecture to write programs, and the device will automatically ignore it to avoid errors when assisting with false data injection [44]; 2. We use the timestamp as the judgment of data approval, so the same timestamp will only approve one piece of data. Hence, data with errors due to delay can be ignored; 3. Because of the solution to the first two problems, system resources can be prevented from being exhausted due to heavy occupation.

Energy Comsunption Calculation
When the temperature of the environment and the electrical appliance power are different, the proposed extender's calculated energy-saving effect could be different. Even in the same environment with the same electrical appliances, the Max and Min values are set by the proposed extender. When the value is different, the energy-saving effect obtained is different. For example, in a livestock farm, the temperature of a particular day falls between 28 °C and 23 °C . If the Max value is set to 27 °C , the Min is set to 26 °C and the energy-saving effect obtained by the other set of Max values is set to 28 °C , the Min value is set to 27 °C , which is absolutely different.
It is more complicated to calculate electrical appliances' power consumption when connected to the proposed extender. Unlike ordinary electrical appliances, which con-  In this article, the communication transmission adopts the message queuing telemetry transport (MQTT) protocol architecture [43]. Hence, the system can synchronize the time with the central server every minute, avoiding the related problems caused by an unsynchronized time and data delays as follows:

1.
We use the finite element machine architecture to write programs, and the device will automatically ignore it to avoid errors when assisting with false data injection [44]; 2.
We use the timestamp as the judgment of data approval, so the same timestamp will only approve one piece of data. Hence, data with errors due to delay can be ignored; 3.
Because of the solution to the first two problems, system resources can be prevented from being exhausted due to heavy occupation.

Energy Comsunption Calculation
When the temperature of the environment and the electrical appliance power are different, the proposed extender's calculated energy-saving effect could be different. Even in the same environment with the same electrical appliances, the Max and Min values are set by the proposed extender. When the value is different, the energy-saving effect obtained is different. For example, in a livestock farm, the temperature of a particular day falls between 28 • C and 23 • C. If the Max value is set to 27 • C, the Min is set to 26 • C and the energy-saving effect obtained by the other set of Max values is set to 28 • C, the Min value is set to 27 • C, which is absolutely different.
It is more complicated to calculate electrical appliances' power consumption when connected to the proposed extender. Unlike ordinary electrical appliances, which consume pure power, the factors that affect power consumption include the temperature setting, ambient temperature and electrical appliance type, among other factors. For the convenience of deriving the formula, we take the industrial electric fan of a livestock farm as an example. Moreover, the calculation method of electric energy consumption is referred to in [1]. The electric energy consumed is calculated for every hour of the industrial electric fan using the proposed extender and the unused extender. Industrial electric fans are used to calculate the energy-saving rate (ESR). Figure 10 shows the hourly power consumption curve of an industrial fan with the proposed extender. In other words, Figure 10 illustrates how to calculate an industrial fan's hourly power consumption with the proposed extender. sume pure power, the factors that affect power consumption include the temperature setting, ambient temperature and electrical appliance type, among other factors. For the convenience of deriving the formula, we take the industrial electric fan of a livestock farm as an example. Moreover, the calculation method of electric energy consumption is referred to in [1]. The electric energy consumed is calculated for every hour of the industrial electric fan using the proposed extender and the unused extender. Industrial electric fans are used to calculate the energy-saving rate (ESR). Figure 10 shows the hourly power consumption curve of an industrial fan with the proposed extender. In other words, Figure 10 illustrates how to calculate an industrial fan's hourly power consumption with the proposed extender. Please note that P(t) is the hourly power consumption change of the industrial electric fans with recombined temperature control extension cords. The meanings of the other parameters are as follows: T is the cumulative number of seconds to start an industrial fan per hour; Wf is the power when the industrial electric fan starts, with the power consumption of the general industrial electric fan mostly falling between 150 W and 400 W; and We is the power of the proposed extender. The actual measured power of the prototype of the proposed extender is 0.7 W.
As shown in Figure 10, the industrial electric fan using the proposed extender has T seconds per hour to maintain the starting state (the cumulative total of T seconds is the starting state, not 0-T seconds) of 3600-T seconds. This is to maintain the closed state and calculate the electric energy Eph consumed by the industrial fan per hour by calculating the area: Besides that, we assume that in the livestock farm, the industrial fans are turned on 24 h a day and a total of 24 × 365 = 8760 h in a year. Therefore, the annual electric energy Epy of each industrial fan is Epy= ∑ ℎ =Eph × 8760 kw h (2) Compared with industrial fans that do not use the proposed extender cords, because industrial fans are always in the starting state, the electric energy consumed by Please note that P(t) is the hourly power consumption change of the industrial electric fans with recombined temperature control extension cords. The meanings of the other parameters are as follows: T is the cumulative number of seconds to start an industrial fan per hour; W f is the power when the industrial electric fan starts, with the power consumption of the general industrial electric fan mostly falling between 150 W and 400 W; and W e is the power of the proposed extender. The actual measured power of the prototype of the proposed extender is 0.7 W.
As shown in Figure 10, the industrial electric fan using the proposed extender has T seconds per hour to maintain the starting state (the cumulative total of T seconds is the starting state, not 0-T seconds) of 3600-T seconds. This is to maintain the closed state and calculate the electric energy E ph consumed by the industrial fan per hour by calculating the area: Besides that, we assume that in the livestock farm, the industrial fans are turned on 24 h a day and a total of 24 × 365 = 8760 h in a year. Therefore, the annual electric energy E py of each industrial fan is Compared with industrial fans that do not use the proposed extender cords, because industrial fans are always in the starting state, the electric energy consumed by each fan per year is F py = (W f /1000) × 8760 = 8.76 × W f kw h. Thus, we can calculate the ESR and the annual saving of each fan if the general industrial electric fan in the livestock farm is changed to an industrial electric fan using the proposed extender. The annual electricity consumption D py , the annual cost M py (assuming 4 NT$ per kilowatt-hour of electricity) and the annual carbon emission reduction C py are calculated as follows (each kilowatt-hour (kw h) can generate 0.623 kgCO 2 e carbon emissions): C py = (F py − E py ) kw h × 0.623 kgCO 2 e / kw h (6)

ESR Calculation
Since the ESR of industrial electric fans using the proposed extender is closely related to the average hourly industrial electric fan's cumulative start-up seconds T, this subsection discusses the relationship between the ESR and the average hourly start-up seconds T of an industrial electric fan. Moreover, we calculate the maximum and minimum ESR.
First, from Equation (3), it can be seen that the ESR is inversely proportional to the electric energy consumed by an industrial fan per hour E ph using the proposed extender. From Equation (1), it can be seen that E ph is proportional to T. It can be seen that the ESR is inversely proportional to T. As a result, the longer the startup time, the worse the ESR is.
Next, to actually calculate the energy-saving rate, W e and W f must be brought into the actual power value. The real power measured by W e was 0.7 W, and the power of the general industrial fans was mostly between 150 W and 400 W, so we took the middle value of approximately 280 W to calculate Equation (1). Then, we brought different T values into the E ph formula to calculate the E py , ESR, D py , M py and C py values of each industrial fan (using the proposed extender) for different T values (not using the proposed extender.) For comparison with industrial fans with extension cords, Table 3 lists the critical parts (the T value is listed at 180 s intervals). Table 3. Electric energy (E ph ), annual electric energy (E py ), energy-saving rate (ESR), annual electricity consumption (D py ), annual cost (M py ) and annual carbon emission reduction (C py ) values of each fan with different average hourly start-up (T) values.  Table 3 shows that an ESR of 99.75% occurred when T = 0 (indicating that the industrial fan had not been started within 1 h). The same was true for other D py , M py and C py values. The ESR increased with the T value and decreased linearly. When T = 3600 s (indicating that the industrial fans were all activated within 1 h), the ESR dropped to −0.25%, but this was unlikely to happen because if the proposed extender were adjusted to the appropriate Max or Min value, this situation would not occur. Figure 11 shows the relationship between the ESR and the T value, which is drawn based on the T and ESR columns in Table 3. It can be seen from Equation (3) that the ESR is inversely proportional to the electric energy consumed by an industrial fan per hour E ph using the proposed power extender. From Equation (1), E ph is proportional to T, so it can be seen that the ESR is inversely proportional to T. The longer the startup time, the worse the ESR will be. As a result, this is a linear relationship.

Case Study for ESR Calculation
We used a livestock farm as an example to do energy-saving analysis. We assumed that there were 80 of the proposed extenders on the farm and 80 industrial fans. The proposed extender could transmit wirelessly via a Wi-Fi 2.4G wireless communication module. We could uniformly set each of the farm's temperature settings for the sockets without wasting human resources by selecting them individually.
The farms bred pigs. In the hot summer, the pig farms face the challenge of high

Case Study for ESR Calculation
We used a livestock farm as an example to do energy-saving analysis. We assumed that there were 80 of the proposed extenders on the farm and 80 industrial fans. The proposed extender could transmit wirelessly via a Wi-Fi 2.4G wireless communication module. We could uniformly set each of the farm's temperature settings for the sockets without wasting human resources by selecting them individually.
The farms bred pigs. In the hot summer, the pig farms face the challenge of high temperatures. Hence, large industrial fans must be used to cool down. The fan model was FS-50, the voltage was 220 V and the rated power was 280 W. For the 1400 RPM industrial fans, if the proposed extender was not used, each fan's annual power consumption would be as high as 8760 × 0.28 = 2452.8 kw h.
In this application field, through actual measurement and adjustment of the Max (high temperature) and Min (low temperature) values of the proposed extender, we found that when the Max value was 22 • C and the Min value was 20 • C (i.e., the proposed extender was in cooling mode), it was more suitable for pigs weighing 5-40 kg. After actual measurement by the power meter, it was found that the average cumulative start-up seconds T of an industrial fan in an hour was about 900 s. We illustrated its energy-saving effects through the reduced electricity consumption over the same period of one year. Hence, we can directly refer to Table 3 to calculate the related values (now using the E py , D py , M py and C py values of T = 900 s) as follows: • The power consumption of 80 industrial fans using the proposed extender (E py value of T = 900 is 619. Therefore, we only needed to add 80 industrial electric fans to the farm and 80 of the proposed extenders to get the expected results, as can be seen in Table 4. We assumed that the fan operated 24 h a day and that the cost was calculated at four yuan per unit (degree). The power consumption of the proposed extender was 0.7 W. The power consumption of the industrial electric fan was 280 W (T = 900 s).

User Satisfaction Analysis
We divided satisfaction into three aspects for discussion: whole, home and farm. In this article, there were 249 people in the questionnaire survey, of which 47% were male and 53% were female. The analysis results are shown in Table 5. The average ranking of overall satisfaction found that the top three satisfaction ratings for the IoT-based temperature control power extender settings were "2. I think this IoT-based temperature control power extender can keep the space at a certain temperature without wasting electricity (m = 4.85)." The highest score was "3. I think the function of the IoT-based temperature control power extender's cooling mode is useful (m = 4.76)," followed by "I think this IoT-based temperature control power extender has an excellent energy-saving effect (m = 4.70)".
In terms of home satisfaction, "When this IoT-based temperature control power extender is used in the home, I think it is very suitable for use when the air conditioner stops and the room temperature rises. The cooling mode is used to start the fan to cool down automatically (m = 4.40)", which was the most-satisfied response by consumers.
Finally, according to the above results, it was found that the satisfaction degree of the proposed IoT-based temperature control power extender used in different areas was farm > home. Moreover, it was found that consumers favored the cooling mode more than the heating mode. From the satisfaction analysis in Table 5, it can be seen that the operating interface scores were all biased to be low. Among them, "I think the temperature setting unit of this IoT-based temperature control power extender is appropriate (currently, the smallest temperature unit that can be set is 1 • C)" was the most important point for review. It may be that consumers wanted the temperature setting unit to be smaller, such as 0.50 • C. In summary, the proposed IoT-based temperature control power extender could keep the space at a certain temperature without wasting electricity so that consumers could be satisfied.

Conclusions
The expandable master-slave IoT temperature control extender proposed in this article has been equipped with two working modes: cooling and heating. The power supply can be turned on or off accurately and in a timely manner through the temperature-sensing component, thereby avoiding unnecessary power consumption. It can also be controlled through Wi-Fi 2.4G wireless transmission, uploading real-time temperature information, the switch status, the master-slave mode and other collected data to the cloud server. The terminal device performs parameter settings.
When we used the proposed power extender in large-scale breeding farms, it was found that there were different temperature requirements for pigs of various sizes in the breeding farm. Even the Max and Min values that needed to be set at night and during the day were different. In practice, each area must be adjusted frequently. Fortunately, the proposed power extender can first select the master extender parameters and then immediately transmit the commands to other slave extenders through Wi-Fi 2.4G wireless transmission. Therefore, no human resources are wasted to go to the site and set each power extender.
Recently, many smart machines and pieces of equipment have been dedicated to reducing power consumption. Still, as long as machines and equipment are equipped with smart technology, their prices are usually high, and the existing old machines and equipment do not have smart power-saving functions, so they need to be set manually. This is why IoT-based power extenders have been developed in recent years. Old appliances and equipment can have smart functions through this temperature control extension cord or be remotely controlled through a mobile device. As long as the old devices and equipment are connected to the proposed power extender, they can instantly become intelligent machines and equipment. In future works, we will consider and design cybersecurity with the proposed power extender to avoid network attacks such as false data injection attacks [44], replay attacks [45] and denial of service attacks [46].