Design of a new on-off controller based on Arduino UNO R3 with application to Window A/C

Window Air Conditioner (A/C) is air conditioning which services need of thermal comfort inside a small or medium room. To maintain the desired temperature, then A/C employs the thermostat that functions as an on-off controller. In general, it works based on the set point and the control differential; however the differential is not available to set. In fact, the differential has a  quite important role . In this paper was proposed a new optional controller based on an Arduino UNO R3 so that the differential can be also set. In addition, it is aimed to anticipate if the thermostat has a problem. Based on these purposes, then it was designed an on-off controller and the thermostat was replaced by using the Arduino in which was uploaded the algorithm of controller. However, the excellence of device can be tested in A/C without uninstalling the existing thermostat.   The response of control system obtained is appropriate with design objectives. Although, it at crucial time points still has a response error with range from 0.02 0 C to 0.38 o C.Thus, it is more accurate than a conventional system whose error from 0.5°C to 0.95°C. Moreover, the designed controller can reduce the  energy  consumption of about 66% compared to the thermostat.


Introduction
A modern air conditioning must be able to control the air temperature at the desired value for each time by means of heating or cooling (1).Usually, the Air conditioning (A/C) system for small to medium capacity uses window and split type.To maintain the desired temperature, then A/C employs the thermostat that functions as an on-off controller.In general, the thermostat works based on the set point and the control differential, however the differential is not available.In fact, the differential role is important.The differential value influences both of human thermal comfort and energy saving (1,2).Too big the differential value makes a conditioned room comfort less (3)(4)(5).Whereas, too small the differential causes inefficient system (6)(7)(8)(9) and also A/C be on and off frequent (2,10).In addition, the action also requires high restarting current that equals to 4 to 10 times bigger than running current (11).
To respond the disadvantages, the researchers applied PID (Proportional Integral Derivative) (12,13) and Adaptive control concept (14) whose results were interesting in simulation.However, so far in implementation they had constraints; both of them were determination of control parameters, and control components that were need to support and to add to control system (15).Based on those considerations and also since the on-off control system has not only simple control components, but also reasonable budged (16), then, in this paper is proposed a new optional controller based on an Arduino UNO R3 so that the differential can be also set.In addition, it is aimed to anticipate if the thermostat to be breakdown or has other problem.To this purpose, the design of control and monitoring of the A/C will be performed.For the design of controller, the thermostat of the A/C will be replaced by using Arduino in which will be uploaded algorithm of on-off controller.Arduino is a microcontroller chip with the type of AVR from Atmel Company which is open source (17).The Arduino uses programming language C that is simplified using simple functions, so that beginners can learn quite easily and well.
Whereas, for monitoring will be designed using the laptop monitor and the LCD keypad shield (16).However, in the testing of designed controller is only carried out the takeover of function of thermostat by Arduino UNO R3, while the thermostat is still installed in the A/C.In addition, the proposed LCD keypad shield not only can monitor a room temperature but also can change the set point temperature and the control differential value of on-off controller via its keypad.This makes easier to set the set point and the differential for the user.Moreover, using the laptop as a monitor is needed additional software PLX-DAQ and Ms. Excel.

Control System
2.1.On -off control system A control system is a system that has a controller which serves to correct a response error e(t) so that the response y(t) approaches a desired input value (set point).Fig. 1 shows a block diagram of control system.In this case, it is used an on-off controller.An example of on-off controller is a thermostat.Its output u has only two states, namely, at any time to be On or the other time to be Off that be sent to a relay, as looks at Fig. 2 below.This signal is called a control signal that instructs an action for relay to turn on or off the A/C.The on-off controller is used more in refrigeration and air conditioning since it is not only simplest and probably most common control mode, but also reasonable budget (16).

Response of on-off control system
Step response of an on-off control system is shown in Fig. 3 below.The set point is the desired input to be a constant.However, the actual output can only approximate it.The output seems to fluctuate about the input.When the output achieves Tcut-off, the system turns off, then the output goes up.On the contrary, when the output achieves Tcut-in, the system turns on, then the output goes down.This pattern will continue as character of the control system.

Figure 3.
Response curve of on-off control system for cooling process (18).

Design of control system and implementation
The design of control system consists of two parts, namely design of hardware and program.The design of hardware includes selection of controller, sensor, and relay.A controller is a device to maintain a quantity is constant.It was used to a mechanical-electrical device or a electronic circuit, for example a thermostat.However, currently its working principle can be adapted to a computer program so that it can be used a computer with related program as a controller.This is called control system based on computer.Whereas, the design of program is of computer program for on-off controller so that it can represent character of the thermostat.To do this, it is initialized by designing a flowchart of the controller.

Design of hardware
In this design, the explaination focuses on designing of main components that is related to control system.The main components are the Arduino, sensor, and display.It is explained shortly reasons in selection of them.To display data is used two methods.They are LCD and Laptop.Whereas, the other components are shown directly their connection paths to the Arduino which can be traced through a wiring diagram of the entire hardware design.

Selection of microcontroller
The arduino includes a microcontroller that functions as a computer.Thus, it can be used to process computer program.Note that, a microcontroller is not a controller in meaning of control system discipline.Since, in this paper was designed a on-off controller using the program , then it is selected Arduino Uno as shown in Fig. 4. The arduino is also equipped with static random-access memory (SRAM) to hold data and flash memory, and erasable programmable read-only memory (EPROM) to save program.

Selection of temperature sensor
To measure room temperature is selected a sensor SHT 1x.The sensor can measure temperature from -40 0 C to 123.8 0 C. It has typical accuracy +/-0.5 0 C.These specifications are relevant that are needed in controling and monitoring the temperature.Connection of sensor SHT1x with Arduino UNO R3 is shown in Fig. 5.For more detail, it also can be seen in tabel 1.

Display
Monitoring of room temperature is conducted through two displays, namely LCD and monitor of laptop.These purpose to obtain data in both numerical and graphic form.And connection of LCD display to the arduino UNO R3 is shown in Fig. 6.The LCD has keypadshield that is used to set a desired temperature and the diffrential.It display setpoint temperature , differential, and room temperature in numerical form.Whereas, a data display that uses a laptop in which is installed the Arduino software, a PLX-DAQ software and Ms. Excel can be seen in Fig. 7.The PLX-DAQ and Ms. Excel is needed to display data in graph form.It will display continously reading time, room temperatur in both numerical and graphic form in Ms. Excel editor.Thus, it can be observed dynamics of room temperature in real time.Moreover, the response error at Tcut-in (upper limit) and Tcut-off (lower limit) can be determined from the graph which is easier than a conventional way .

Design of the entire hardware
Finally, Fig. 8. shows how to all hardware components be integrated to become an unit in a wiring diagram form.In the diagram all components are displayed and shown their connections except Laptop which its connection has been provided a particular slot and a USB cable.The Arduino Uno as controller is connected directly to a temperature sensor SHT 1x, relay and LCD.However,to turn on or off A/C, it does not have connection directly and must be through a relay.In this case, it is needed only one of the relays.

Design of program
The Design of program is performed according to the flowchart shown in Fig. 9.This figure shows generally an algolrithm of on-off controller including input setpoint temperature (Ts) and differential, read sensor output Tr, calculate Tcut-off and T cut-in , then controller will take decision wheather it turn on or off compressor.This depends on room temperature (Tr), Tcut-off and Tcut-in.If Tr ≤ Tcut-off is true, then the controller instructs relay to turn off compressor.On the other hand, if Tr ≥ Tcut-in is true , then it instructs relay to turn on compressor.This purposes to correct response error that happen.The action is repeated continously so that room temperature can be maintained at desired temperature.Based on the flow chart is designed a program which is called an algorithm of on-off controller.Then the program is uploaded into the Arduino.Thus, the arduino services as on-off controller.In addition, it also monitors room temperature.

Response Analysis of on-off control system for window A/C
To find accuracy of the proposed on-off controller was performed colecting data and then analyzed.In this case, setpoint temperature was varied for three values, namely 22 o C, 23 o C, and 24 o C and the same diffrential of 2 o C, then the response curves of on-off control system were investigated and discussed.
It can be seen from Fig. 10 below the response curves of on-off control system for window A/C for three different setpoint temperatures and the same differential.Each response curve fluctuates about its setpoint temperature.It seems that the curve of setpoint of 22 o C undergoes on-off cycle more often compared with the setpoint of 23 o C dan 24 o C.This is caused when compressor stop working at point of Tcut-off and the same differential of 2 o C, then for the lowest setpoint temperature of 22 o C the room air obtain the biggest heat transfer rate from outdoor through wall, roof and floor.So that the time required from Tcut-off to Tcut-in is the shortest or its on-off cycle the most often.However, their cycle frequencies are not different significantly, therefore their restarting current are almost the same.That means the difference of Tsetpoint values does not influence significantly to energy consumption.Then for further analysis purpose, the three curves were converted into a table.In this case, it was determinated the response error which was defined as the difference between Tsetpoint and Tcut-off or Tcut-in, respectively.The results look as in table 2. It shows that respon of control system has error with range from 0,02 o C to 0,38 o C.This error is caused evaporator which can not stop or start immediately to draw heat of room air at the same time when compressor is stopped or started by controller, respectively.If the error range is compared with the thermostat error whose range from 0.5°C to 0.95°C (1,2,10), then the designed controller response is more accurate.

Effect of control differential value
To investigate energy consumption of the proposed on-off controller the differential was varied for three values, namely 2 o C, 3 o C, and 4 o C and the same setpoint of 22 o C, then the response curves of on-off control system were analyzed and discussed.Figure 11.shows that curves fluctuate about its setpoint in the same parttern with 3 maximum peaks and 4 minimum peaks.At the beginning all three curves start at temperature of about 24.6 °C.When A/C is set at Tset 22°C, response curves for the differential 2°C and 3°C which are only plotted one the parttern are almost overlapping.However, for the differential 4°C ,response curve shows expansion and time required longer than others.During 1000 minutes in response curve, the biggest differential response has one action compared to three actions of the other differentials.In this case, one action is one the parttern of response that consists of 3 maximum peaks and 4 minimum peaks.That means in comparing the biggest differential uses one restarting current whereas the others use three restarting currents.Since, each starting current is 4 to 10 times running current (10), then the biggest differential has at least energy saving to be 2 x 4 times running current.In the other words, since the conventional thermostat is set for the differential 2°C and 3°C (1,2), then the designed controller is also energy saving of 2/3 or 66% compared to the thermostat.This is why so important to provide a button to set the differential to appropriate value as proposed.

Conclusion
The current research investigates the effect of control differential and response error on the designed control system and the energy saving for air conditioning, especially a window A/C .It can be considered as a promissing enough solution for the energy consumption issues.The results showed that the system response has satisfied the desired temperature, although it still has the error with range from 0.02 o C to 0.38 o C.This error range is lower than the thermostat error whose range from 0.5°C to

Figure 8 .
Figure 8. Wiring diagram for design of hardware.

Figure 9 .
Figure 9. Flowchart for design of program

Figure 10 . 2 .
Figure 10.Response curves of on-off control system for various setpoint temperatures

Figure 11 .
Figure 11.Response curves of on-off control system for various differentials.