1 End-Semester Project Report AUTOMATIC ROOM LIGHTS CONTROLLER USING ARDUINO AND PIR SENSOR By: ANKIT KUMAR CHAUDHARY (15/IEE/055) Under The Guidance Of Dr. M.A. ANSARI Department of Electrical Engineering School of Engineering Gautam Buddha University Gautam Budh Nagar UP,India
2 ABSTRACT In this project, we will see the Automatic Room Lights using Arduino and PIR Sensor, where the lights in the room will automatically turn ON and OFF by detecting the presence of a human. Such Automatic Room Lights can be implemented in your garages, staircases, bathrooms, etc. where we do not need continuous light but only when we are present. Also, with the help of an automatic room light control system, you need not worry about electricity as the lights get automatically off when there is no person. So, in this DIY project, we have implemented Automatic Room Lights using Arduino and PIR Sensor.
3 ACKNOWLEDGEMENT I wish to express my profound gratitude and indebtedness to Dr. M.A. ANSARI SIR, Department of Electrical Engineering , Gautam Buddha University for introducing the present Automatic Room Lights Controller Using Arduino And PIR Sensor and for their inspiring guidance , constructive criticism and valuable suggestion throughout the project work. Last but not least, my sincere thanks to all our friends who have patiently extended all sorts of help for accomplishing this undertaking.
4 INDEX Contents 1 INTRODUCTION 2 SYSTEM COMPONENTS DESCRIPTION 3 CIRCUIT DIAGRAM 4 CONNECTION DIAGRAM 5 PROGRAM CODE 6 WORKING OF THE SYSTEM 7 CONCLUSION 8 FUTURE WORK 9 REFERENCES
5 INTRODUCTION Intelligent Energy Saving System, the aim of the project is to save the energy. In this project we are using various sensors, controlling and display. However, in this project work the basic signal processing of various parameters which are temperature, LDR, Smoke sensor. For measuring various parameters values, various sensors are used and the output of these sensors are converted to control the parameters. The control circuit is designed using micro-controller. The outputs of all the three parameters are fed to micro- controller. The output of the micro-controller is used to drive the LCD display, so that the value of each parameter can be displayed. In addition to the LCD display micro-controller outputs are also used to driver a relay independently. This relay energizes and de- energizes automatically according to the condition of the parameter. LITRRATURE SURVEY Literature survey is the study of already established systems and collection of information which helps in doing new tasks. Vibhuti et al [1] proposed a system which operates with control of relays and with the use of WAGO PLC (Programmable Logic Controller) and Arduino Uno. Switching operation of devices such as tube light, fan, AC, etc. can be operated spontaneously by using PIR sensor and on the basis of environmental conditions. In real-time implementation, automatic control is done by sensor data and manual control is done by android application. But, difficulty in this paper is the controlling and monitoring of devices done by WAGO PLC and Arduino Uno both. These operations can be done by using only Arduino Uno. Maslekar et al [2] proposed a smart lighting system in which Raspberry Pi has used. Raspberry Pi is monitoring lights and fans simultaneously. In the absence of person room lights and fans will automatically turns OFF. Energy is preserved by using this smart lighting system. The experimental results of this system have shown that 50% energy is conserved. But the difficulty is Raspberry Pi is more expensive than Arduino Uno. Automatic Lighting and Control System for Classroom in which electrical light is controlled by Bluetooth, PIR sensor and relay. To switch ON or OFF the light Bluetooth module is connected to Arduino Uno which sends voice command from Arduino Uno by using the mobile android application. The experimental results have shown the 50% energy is conserved. But this paper can be implemented by removing the Bluetooth module as well [3]. In [4], the disquisitions speak about automatic room light system by using visitor counters operation. Depending upon the human presence, the room lights ON or OFF. There is no need of manual operation for switching. The PIR sensor is used to the human presence which is at the entrance of room. As
6 visitor counter is used, there is increment in the counter when person enters in the room and this leads to turn ON the room light which is controlled by microcontroller program. If person exits the room, the counter decremented and this leads to turn OFF the lights. When all persons left the room then only lights in the room switched OFF. The difficulty in this system is that the door of room should not allow more than one person at a time. Vahid et al [5] proposed a system whose control is depend on Arduino microcontroller, network communications and Modbus industrial protocol. Arduino Ethernet shield and a wireless router device is used to built the network communication. The specific Android application is used to load the Modbus program into mobile or Windows software named "mypro" and on Arduino board, Arduino code loaded through USB (Universal Serial Bus) cable. There is interconnection between Arduino Ethernet Shield and mobile through Ethernet cable and router. By connecting to router, user can control and monitor the appliances easily. The Table 1 summarizes the available methods in Literature survey. SYSTEM COMPONENTS DESCRIPTION The automatic room lights control system consists of different hardware components that can be used for sensing, processing and controlling of appliances. These hardware components are discussed below: PIR Sensor as Sensing Unit The sensing unit is used to get input parameters from surrounding which is required for automation. For particular area of room, the following points must be kept in mind to perform operation in good order. Continuous changes in human motion Capability Sparing (Economical) Here, the sensing unit used is PIR (Passive Infrared) sensor which is as shown in given Figure 1.
7 This PIR sensor is "Passive Infrared", which is also called as "Pyroelectric", or "IR motion"sensors. The working of PIR sensor is to detect the motion of a person when person comes in the sensing range of the sensor. The specialtyof this sensor is it is little, affordable, low power, easy to use and do not exhaust. Hence, this sensor is used in many home automation appliances. Arduino Uno As Processing Unit Arduino Uno is a microcontroller in which ATmega328 microprocessor is used which is shown in the Figure 2.
8 It has 6 analog input pins and 14 digital input or output pins which can be used as PWM(Pulse Width Modulation) outputs. It has its own programming language. The crystal oscillator frequency of this microcontroller is 16MHz. It has USB cable which can simply connect with computer, power barrel jack, reset button and ICSP (In Circuit Serial Programming). Each pin of the Arduino Uno is operated at 5V.The programming language of this microcontroller is not complex. Relay as Controlling Unit A relay is an electrically operated device as shown in Figure 3. A relay is a digital switch that controls much higher currents and voltages. This device is widely used in power protection. The benefits of this device are small in size, stability and long-time reliable and it can be also used for both ac and dc systems. Relay has three terminals that are normally closed terminal, normally open terminal and common terminal. It has three pins GND, VCC and input signal. Software Used Software used to control this system is Arduino IDE (Integrated Development Environment). This software is used to write the program and compile it to the Arduino Uno board. Therefore, the arduino software commands control the arduino board, sensing devices and another circuitry.
9 Circuit Diagram
1 Connection Diagram
1 Program Code Int in1=9; int sensor = 8; int led = 13; unsigned long t=0; void setup() { Serial.begin(9600); pinMode(in1, OUTPUT); pinMode(sensor, INPUT); pinMode(led, OUTPUT); digitalWrite(in1,HIGH); digitalWrite(led,LOW); while(millis()<13000) { digitalWrite(led,HIGH); delay(50); digitalWrite(led,LOW); delay(50); } digitalWrite(led,LOW); } void loop() { digitalWrite(in1,HIGH); digitalWrite(led,LOW); if(digitalRead(sensor)==HIGH) { t=millis(); while(millis()<(t+5000)) { digitalWrite(in1,LOW); digitalWrite(led,HIGH); if((millis()>(t+2300))&&(digitalRead(sensor)==HIGH)) { t=millis(); } } } }
1 WORKING OF THE SYSTEM Arduino is a microcontroller which provides open source platform to perform software and hardware operations. This is an advantageous project as Arduino Uno and PIR Sensor is used thereby lights in the room will turn ON automatically by detecting a human motion and stay turned ON as long as the person remain present in the room. At the beginning, when no human is present in the room, the PIR Sensor’s OUT pin is in the LOW mode. Hence, light of the room is OFF. The output of the PIR Sensor goes HIGH as the person enters the room. PIR Sensor detects the Infrared (IR) radiation in the room. The Digital pin 8 of Arduino Uno is used to connect the Data OUT pin of PIR Sensor. When this becomes HIGH, the activation of relay takes place by Arduino Uno. So that relay pin is in the LOW mode; because relay is an active LOW device. Now, the lights will turn ON. This light maintains its state as ON as far as there is motion in the room. If the person exits the room or takes a nap, the motion in front of sensor stops and there will be no changes in the IR radiations. Therefore, Data OUTpin of PIR sensor will be in LOW mode. This leads to turn OFF the relay. So, relay now is in the HIGH mode. Hence, room light will be turned OFF. CONCLUSION The paper has introduced the idea of automated homes and proposed a method which saves power consumption by system. This Automated Gadget Control System having the interconnections between the home appliances and sensors for controlling and monitoring the device. Automated home is a vast system that having multiple technologies and its applications that can be used to provide control and security of the homes easily. FUTURE WORK There are many technologies that can be used in automatic lighting systems to make the system more accurate.To make the system more professional GSM (Global System for Mobile) module can be used to get notifications. There are some sensors that can be used to control and secure the home. For example, pressure sensor used to detect the occupancy which will be placed outside the door. Image processing can also be used to detect a person’s presence by using digital camera.
1 REFERENCES 1) Vibhuti and Shimi S.L., “Implementation of Smart Class Room Using WAGO PLC”, Proceedings of the Second International Conference on Inventive Systems and Control (ICISC) 2018, Coimbatore, pp. 807-812. 2) A. Maslekar, K. Aparna, K. Mamatha and T.Shivakumara, “Smart Lighting System using Raspberry Pi”,International Journal of Innovative Research in Science and Technology, Vol.4(7), 2015, pp.5113-5121I. 3) Suresh S, H.N.S.Anusha, T.Rajath, P.Soundarya and S.V,PrathyushaVudatha. “Automatic Lighting And Control System For Classroom” 2016 International Conference on ICT in Business Industry & Government (ICTBIG). 4) Vahid Hassanpour, Sedighe Rajabi, Zeinab Shayan, Zahra Hafezi, Mohammad Mehdi Arefi , “Low-Cost Home Automation Using Arduino and Modbus Protocol”, 5th International Conference on Control, Instrumentation and Automation (ICCIA), Shiraz, 2017, pp. 284-289. 5) https://components101.com/microcontrollers/arduino-Uno

Automatic Room Lights Controller Using Arduino & PIR Sensor

  • 1.
    1 End-Semester Project Report AUTOMATICROOM LIGHTS CONTROLLER USING ARDUINO AND PIR SENSOR By: ANKIT KUMAR CHAUDHARY (15/IEE/055) Under The Guidance Of Dr. M.A. ANSARI Department of Electrical Engineering School of Engineering Gautam Buddha University Gautam Budh Nagar UP,India
  • 2.
    2 ABSTRACT In this project,we will see the Automatic Room Lights using Arduino and PIR Sensor, where the lights in the room will automatically turn ON and OFF by detecting the presence of a human. Such Automatic Room Lights can be implemented in your garages, staircases, bathrooms, etc. where we do not need continuous light but only when we are present. Also, with the help of an automatic room light control system, you need not worry about electricity as the lights get automatically off when there is no person. So, in this DIY project, we have implemented Automatic Room Lights using Arduino and PIR Sensor.
  • 3.
    3 ACKNOWLEDGEMENT I wish toexpress my profound gratitude and indebtedness to Dr. M.A. ANSARI SIR, Department of Electrical Engineering , Gautam Buddha University for introducing the present Automatic Room Lights Controller Using Arduino And PIR Sensor and for their inspiring guidance , constructive criticism and valuable suggestion throughout the project work. Last but not least, my sincere thanks to all our friends who have patiently extended all sorts of help for accomplishing this undertaking.
  • 4.
    4 INDEX Contents 1 INTRODUCTION 2 SYSTEMCOMPONENTS DESCRIPTION 3 CIRCUIT DIAGRAM 4 CONNECTION DIAGRAM 5 PROGRAM CODE 6 WORKING OF THE SYSTEM 7 CONCLUSION 8 FUTURE WORK 9 REFERENCES
  • 5.
    5 INTRODUCTION Intelligent Energy SavingSystem, the aim of the project is to save the energy. In this project we are using various sensors, controlling and display. However, in this project work the basic signal processing of various parameters which are temperature, LDR, Smoke sensor. For measuring various parameters values, various sensors are used and the output of these sensors are converted to control the parameters. The control circuit is designed using micro-controller. The outputs of all the three parameters are fed to micro- controller. The output of the micro-controller is used to drive the LCD display, so that the value of each parameter can be displayed. In addition to the LCD display micro-controller outputs are also used to driver a relay independently. This relay energizes and de- energizes automatically according to the condition of the parameter. LITRRATURE SURVEY Literature survey is the study of already established systems and collection of information which helps in doing new tasks. Vibhuti et al [1] proposed a system which operates with control of relays and with the use of WAGO PLC (Programmable Logic Controller) and Arduino Uno. Switching operation of devices such as tube light, fan, AC, etc. can be operated spontaneously by using PIR sensor and on the basis of environmental conditions. In real-time implementation, automatic control is done by sensor data and manual control is done by android application. But, difficulty in this paper is the controlling and monitoring of devices done by WAGO PLC and Arduino Uno both. These operations can be done by using only Arduino Uno. Maslekar et al [2] proposed a smart lighting system in which Raspberry Pi has used. Raspberry Pi is monitoring lights and fans simultaneously. In the absence of person room lights and fans will automatically turns OFF. Energy is preserved by using this smart lighting system. The experimental results of this system have shown that 50% energy is conserved. But the difficulty is Raspberry Pi is more expensive than Arduino Uno. Automatic Lighting and Control System for Classroom in which electrical light is controlled by Bluetooth, PIR sensor and relay. To switch ON or OFF the light Bluetooth module is connected to Arduino Uno which sends voice command from Arduino Uno by using the mobile android application. The experimental results have shown the 50% energy is conserved. But this paper can be implemented by removing the Bluetooth module as well [3]. In [4], the disquisitions speak about automatic room light system by using visitor counters operation. Depending upon the human presence, the room lights ON or OFF. There is no need of manual operation for switching. The PIR sensor is used to the human presence which is at the entrance of room. As
  • 6.
    6 visitor counter isused, there is increment in the counter when person enters in the room and this leads to turn ON the room light which is controlled by microcontroller program. If person exits the room, the counter decremented and this leads to turn OFF the lights. When all persons left the room then only lights in the room switched OFF. The difficulty in this system is that the door of room should not allow more than one person at a time. Vahid et al [5] proposed a system whose control is depend on Arduino microcontroller, network communications and Modbus industrial protocol. Arduino Ethernet shield and a wireless router device is used to built the network communication. The specific Android application is used to load the Modbus program into mobile or Windows software named "mypro" and on Arduino board, Arduino code loaded through USB (Universal Serial Bus) cable. There is interconnection between Arduino Ethernet Shield and mobile through Ethernet cable and router. By connecting to router, user can control and monitor the appliances easily. The Table 1 summarizes the available methods in Literature survey. SYSTEM COMPONENTS DESCRIPTION The automatic room lights control system consists of different hardware components that can be used for sensing, processing and controlling of appliances. These hardware components are discussed below: PIR Sensor as Sensing Unit The sensing unit is used to get input parameters from surrounding which is required for automation. For particular area of room, the following points must be kept in mind to perform operation in good order. Continuous changes in human motion Capability Sparing (Economical) Here, the sensing unit used is PIR (Passive Infrared) sensor which is as shown in given Figure 1.
  • 7.
    7 This PIR sensoris "Passive Infrared", which is also called as "Pyroelectric", or "IR motion"sensors. The working of PIR sensor is to detect the motion of a person when person comes in the sensing range of the sensor. The specialtyof this sensor is it is little, affordable, low power, easy to use and do not exhaust. Hence, this sensor is used in many home automation appliances. Arduino Uno As Processing Unit Arduino Uno is a microcontroller in which ATmega328 microprocessor is used which is shown in the Figure 2.
  • 8.
    8 It has 6analog input pins and 14 digital input or output pins which can be used as PWM(Pulse Width Modulation) outputs. It has its own programming language. The crystal oscillator frequency of this microcontroller is 16MHz. It has USB cable which can simply connect with computer, power barrel jack, reset button and ICSP (In Circuit Serial Programming). Each pin of the Arduino Uno is operated at 5V.The programming language of this microcontroller is not complex. Relay as Controlling Unit A relay is an electrically operated device as shown in Figure 3. A relay is a digital switch that controls much higher currents and voltages. This device is widely used in power protection. The benefits of this device are small in size, stability and long-time reliable and it can be also used for both ac and dc systems. Relay has three terminals that are normally closed terminal, normally open terminal and common terminal. It has three pins GND, VCC and input signal. Software Used Software used to control this system is Arduino IDE (Integrated Development Environment). This software is used to write the program and compile it to the Arduino Uno board. Therefore, the arduino software commands control the arduino board, sensing devices and another circuitry.
  • 9.
  • 10.
  • 11.
    1 Program Code Int in1=9; intsensor = 8; int led = 13; unsigned long t=0; void setup() { Serial.begin(9600); pinMode(in1, OUTPUT); pinMode(sensor, INPUT); pinMode(led, OUTPUT); digitalWrite(in1,HIGH); digitalWrite(led,LOW); while(millis()<13000) { digitalWrite(led,HIGH); delay(50); digitalWrite(led,LOW); delay(50); } digitalWrite(led,LOW); } void loop() { digitalWrite(in1,HIGH); digitalWrite(led,LOW); if(digitalRead(sensor)==HIGH) { t=millis(); while(millis()<(t+5000)) { digitalWrite(in1,LOW); digitalWrite(led,HIGH); if((millis()>(t+2300))&&(digitalRead(sensor)==HIGH)) { t=millis(); } } } }
  • 12.
    1 WORKING OF THESYSTEM Arduino is a microcontroller which provides open source platform to perform software and hardware operations. This is an advantageous project as Arduino Uno and PIR Sensor is used thereby lights in the room will turn ON automatically by detecting a human motion and stay turned ON as long as the person remain present in the room. At the beginning, when no human is present in the room, the PIR Sensor’s OUT pin is in the LOW mode. Hence, light of the room is OFF. The output of the PIR Sensor goes HIGH as the person enters the room. PIR Sensor detects the Infrared (IR) radiation in the room. The Digital pin 8 of Arduino Uno is used to connect the Data OUT pin of PIR Sensor. When this becomes HIGH, the activation of relay takes place by Arduino Uno. So that relay pin is in the LOW mode; because relay is an active LOW device. Now, the lights will turn ON. This light maintains its state as ON as far as there is motion in the room. If the person exits the room or takes a nap, the motion in front of sensor stops and there will be no changes in the IR radiations. Therefore, Data OUTpin of PIR sensor will be in LOW mode. This leads to turn OFF the relay. So, relay now is in the HIGH mode. Hence, room light will be turned OFF. CONCLUSION The paper has introduced the idea of automated homes and proposed a method which saves power consumption by system. This Automated Gadget Control System having the interconnections between the home appliances and sensors for controlling and monitoring the device. Automated home is a vast system that having multiple technologies and its applications that can be used to provide control and security of the homes easily. FUTURE WORK There are many technologies that can be used in automatic lighting systems to make the system more accurate.To make the system more professional GSM (Global System for Mobile) module can be used to get notifications. There are some sensors that can be used to control and secure the home. For example, pressure sensor used to detect the occupancy which will be placed outside the door. Image processing can also be used to detect a person’s presence by using digital camera.
  • 13.
    1 REFERENCES 1) Vibhuti andShimi S.L., “Implementation of Smart Class Room Using WAGO PLC”, Proceedings of the Second International Conference on Inventive Systems and Control (ICISC) 2018, Coimbatore, pp. 807-812. 2) A. Maslekar, K. Aparna, K. Mamatha and T.Shivakumara, “Smart Lighting System using Raspberry Pi”,International Journal of Innovative Research in Science and Technology, Vol.4(7), 2015, pp.5113-5121I. 3) Suresh S, H.N.S.Anusha, T.Rajath, P.Soundarya and S.V,PrathyushaVudatha. “Automatic Lighting And Control System For Classroom” 2016 International Conference on ICT in Business Industry & Government (ICTBIG). 4) Vahid Hassanpour, Sedighe Rajabi, Zeinab Shayan, Zahra Hafezi, Mohammad Mehdi Arefi , “Low-Cost Home Automation Using Arduino and Modbus Protocol”, 5th International Conference on Control, Instrumentation and Automation (ICCIA), Shiraz, 2017, pp. 284-289. 5) https://components101.com/microcontrollers/arduino-Uno