ARDUINO BASED DESIGN OF OPTIMAL AND ADAPTIVE CONTROLLERS FOR ENERGY OPTIMIZATION

Kakali Dutta, Namrata Nayana Borah, Prastuti Deka and Mrinal Buragohain Department of Electrical Engineering Jorhat Engineering College, Jorhat, Assam. ...................................................................................................................... Manuscript Info Abstract ......................... ........................................................................ Manuscript History Received: 05 May 2020 Final Accepted: 10 June 2020 Published: July 2020

Undoubtedly, energy crisis is one of the most important challenges in this century for the world and hence energy optimization is the best feasible alternative that is economically possible. The present work offers simple solution for automation of electrical appliances so that energy can be optimized with manual back up. Automation is provided with the use of various sensors suitable to observe the production processes, actuators and different techniques and devices. In this project, the automation system developed in a smart room are: automatic 220V lamp control using LDR, automatic lamp control using LDR and PIR sensor, automatic fan control using DHT11 sensor, and automatic load control using ac dimmer circuit. In all these applications, Arduino UNO processing-unit along with 3 sensors and a dimmer circuit. This system is designed to control electrical devices throughout the house with ease of installing it, ease of use and cost effective design and implementation, reduction in energy power wastage and hence resulting in lowered electricity bills, due to optimal use of electrical energy with adaptation.

…………………………………………………………………………………………………….... Introduction:-
In the ever increasing world population, our resources are being consumed as well as depleted at a very fast rate and so step towards energy conservation result in increased environmental quality, national security, personal financial security and higher savings. In the light of rising energy costs, limited deposits of raw materials and global warming due to carbon dioxide emissions, the efficient use of energy is continually gaining importance.
In India, it is very common to see manual operation of electrical equipments (lights, AC, fans, etc.) and use of manual switching system to operate electric gadgets. It is very common for people to forget to switch off the gadgets after usage as people are so busy with many different works. To help the people it is very much helpful if one can provide automation systems for the problems. Automation is provided with the use of various sensors suitable to observe the production processes, actuators and different techniques and devices. Smart home automation gives the owner of a home an ultimate control over his or her home by automated lighting system, dimming, and electrical appliances. Energy consumption optimization means choosing and adopting methods and technologies for correct using of energy that is desirable from national economy point of view and guarantee energy stability.
Use of sensors to control loads based on occupancy, schedule and/or the availability of natural resources such as daylight or darkness is what that has been opted for fulfilling the objective of energy optimization. The system 192 should be designed in a manner that integrates and adapt new devices, so that these devices should not be a problem at a later stage. On the host side, the system should be user friendly, so that the devices can be monitored and controlled easily (1). In case of any problems in the future, the interface of the system should provide diagnostic services. Finally, the system should be cost-effective so that it can be widely used by anyone in the market. This paper is organized into four sections. Section 1 gives the Introduction of the present work. Section 2 describes the Methodology used. The Results and Observations are given in Section 3. Section 4 concludes and gives future scope of the presented work.

Methodology:-
The methodology of the present work has been described in the following subsections.

System Description:
First of all a prototype was made of the smart home products which includes an automatic lamp and automatic fan control and human detection system. All systems were processed using Arduino UNO microcontroller (2).A microcontroller is used to obtain values of physical conditions through sensors connected to it. The automatic lamp system required sensor to detect the light of the room. The sensor used is the LDR (Light Dependent Resistor) sensor. For the automatic fan system to detect the room temperature DHT11 sensor is used. The DHT11 is a basic, low-cost digital temperature and humidity sensor. To detect the number of people in the room ultrasonic sensors are used. The ultrasonic sensor is also a basic, low-cost digital sensor which is used for distance measurement. The PIR sensor is used to select the light and fan of the room, to be controlled, according to the presence of the human. The PIR motion sensor is used to sense motion or to detect a human presence (3). Finally an AC dimmer circuit is prepared for the whole system for real life application (4). The proposed system is shown below in Fig

Automatic Lamp Design:
In the automatic lamp system, the input is obtained from the LDR sensor. The purpose of the LDR sensor is to provide information about the intensity of light around us. This information is used by the micro-controller to make a decision whether the lights are to be turned on or off. In this process the lamp will light up when the room is dark (the light intensity is less than equal to 500) and the lamp will be off again when the light is bright (the light 193 intensity is greater than 500). This is connected through a relay to a LED bulb operation at 220V to turn it on or off. The circuit for automatic Lamp Design is shown in Fig. 2

Automatic Fan Control:
In this automatic fan system, the input is obtained from DHT1 sensor. The DHT11 is a dual temperature and humidity sensor, where both temperature and humidity can be sensed. Microcontroller will receive input data from the sensor and will process it into output on the fan. The input of this sensor is the amount of temperature in the room, which is then processed to control the fan output speed limits, for different desired temperatures. If the sensor's read temperature is less than 25°C then the fan will off or will not rotate. If the temperature reading of the sensor is between 26°C -29°C, then the fan will spin slowly. If the temperature reading of the sensor is between 30°C -34°C, then the fan will spin at medium speed. If the temperature reading exceeds 35°C then the fan will spin rapidly. The circuit for Automatic Fan Design is shown in Fig. 2.3.

Detection of number of persons leaving or entering a room:
This circuit is used as a switch to turn on the whole automation system connected inside the room if someone enters 194 the room. This circuit has been used to detect the number of people entering or leaving the room using the microcontroller. For this purpose, the HC-SR04 ultrasonic sensor is used. This sensor is a very popular and used in many applications, where measuring of distance or sensing of objects is required. Here, an ultrasonic sensor is placed in the door which is used as a device to increase the count if someone enters the room and decrease the count if someone leaves the room. Single ultrasonic sensor is used for bi-directional visitor counter. Within 0.5m range it will count the number of visitors entering into the room. From 0.5m to 1m range it will count the number of visitors leaving the room. The range of the sensor depends on the width of the door. The door should be set such that the entry on visitors is allowed between 0m to 0.5m width of the door and exit is allowed in the next 0.5m to 1m. The circuit for visitor's count is shown in Fig. 2.4.

Detection of the person position inside the room:
This feature is optional because this will detect the presence of the person in different parts of the room. This is because if the room is large enough and has multiple numbers of fans and lights than it will be more efficient to turn on the lights and fans of that part of the room where the person is present. In the present work the PIR sensors have been used for this purpose. As the PIR sensor is a motion detecting sensor, it detects presence of human in different parts of a room. As soon as it detects any motion or presence of human it turns on the LDR circuit as well as the fan circuit to operate based on the light intensity and temperature of the room respectively. This circuit is shown in Fig.  2.5.

AC Load Control Using Dimmer Circuit:
The aim of the setup which is shown in Fig. 2.6 is to build home appliances control system such as the controlling brightness of lamps and speed of fans at lowest prices using dimmer circuit with Arduino Uno. Dimmers are devices which are designed to control the light and fan output and adjusting (low or high) of the brightness of load. In this circuit, Leading Edge Phase Dimming Method is used to lower down the output power. In the circuit one zero cross detector is used which gives signal to the Arduino board whenever the signal crosses the zero value. Zero cross detector is used as a reference to change the phase of the signal. In this circuit two 47k 1W resistors are used in the power input (220V supply) to limit the current coming from the source. Then a bridge rectifier is attached whose output is attached to the Opto-Coupler IC (PC817). This Opto-coupler IC has a LED in the input and a transistor at the output. So whenever the LED glows the current flows from the collector to the emitter of the internal transistor. In this connection whenever the input ac signal reaches to zero volt, the internal led will be off and signal to the Arduino will be given as digital one due to the pull-up resistor(10k). As soon as the signal crosses the zero Volt, the led will turned on and the signal to the Arduino will be given as digital zero. So, pulses will generatein every time the signal crosses the zero value. This circuit is also known as zero cross detector circuit. Here Arduino pin 2 is connected to pin5 of PC817 which is called as zero voltage crossing or ZVC. Here a triac (BT 136) is also used. In this triac if signal is applied to the gate terminal then it allows the current to flow in both directions, so it is perfect to control ac current using triac. To drive the triac one driving IC is used which is MOC3021. This IC will take a signal from the Arduino board and drive the triac accordingly.

Results and Observations:-
The observations and results have been shown as the following outputs from Fig.3.1 to Fig.3.5:

Automatic Light Control:
The result of automatic light control circuit shows the screenshots of the serial monitor of Arduino IDE. As mentioned earlier, after implementing the circuit the results are being checked on the serial monitor of the arduino platform. The light intensity has been set such that, when the room is darker the LDR circuit gives an output reading less than 500, and this automatically turns the connected LED on. On the other hand, when the room is rather brighter the LDR circuit gives an output greater than 500 and when this happens the LED is automatically switched off. The readings of the LDR are set after testing it under practical conditions. 196 A B  Fig 3.1 A and B:-Output for Automatic Lamp Control in the serial monitor.

Automatic Fan Control:
The result of automatic fan control circuit shows the screenshots of the serial monitor of Arduino IDE. As mentioned earlier, after implementing the circuit the results are being checked on the serial monitor of the Arduino platform. The fan speed has been set such that, when DHT11 sensor reads the room temperature to be higher than 30°C, the fan is automatically turns ON, running at its fastest speed. On the other hand, when the room temperature lies between 27°C-30°C the Fan rotates at medium speed and when the room temperature is low then the Fan is automatically turns OFF. The readings of the DHT11 are set after testing it under practical conditions. 197

Detection of human entering or leaving the room:
The result of total number of person left in the room is shown in the screenshots of the serial monitor of arduino ide. As mentioned earlier, after implementing the circuit the results are being checked on the serial monitor of the Arduino platform. These results are based on the readings of the ultrasonic sensor upon practical implementation on a door.

AC Load Control using AC Dimmer Circuit:
The tested results of the AC dimmer circuit by intentionally creating the illumination level to which the LDR is exposed, to vary and check the brightness of the light bulb are shown below. 198

Significance of the study:
This study will be undertaken to create a home automation system at low cost and easy to create which will benefit both the manufacturer and the consumer. The most important advantage is that it will make the house a much more convenient place for the clients especially for the elders and the handicapped.
Also the golden rule for saving electricity is to keep minimal load on, hence the dimmer circuit is going to reduce electricity consumption and so increase the energy usage efficiency. This system allows one to adjust light and temperature automatically depending on the temperature and light intensity in the room.
The technology used for smart home (which is a promising area) can be considered as the important tools that deal with the demands of appliances power consumption. Nowadays, regarding the population growth and the decrease of energy resources, problems resulting from environment pollution and energy security, optimized use of energy are one of the most essential issues. The home automation system is working satisfactorily when the Arduino code is uploaded to the circuit made. The present work proposes the design and construction of home automation for energy optimization using an adaptive and optimal arrangement, comprising of different sensors like LDR, PIR Sensor, Ultrasonic Sensor, and the DHT11 Sensor. Along with it, the associated dimmer circuit works well in regulating the voltage of ac loads and helping to achieve the desired output.
There is a scope, for future extension of the present work. There is a possibility of the development of a mobile application. Here these data values i.e. energy consumption values for different electrical appliances can be updated in a way that the amount of energy consumption from time to time can be known. This in turn is going to help the individuals decide on where and when the energy consumption should be reduced so that optimization is also 199 possible from the consumer's end. As the presently developed arrangement is adaptive in nature for optimal energy consumption, the development of the application will serve as a handy tool for the consumers to plan out their own energy expenditure and control measures. In the present era, where digital prepaid meters are becoming popular, this application will help the consumer to plan out their energy consumption and energy saving pattern.