Project Report (Instrumentation & Measurement) : Energy Management System With Acknowledgement Feature
Project Report (Instrumentation & Measurement) : Energy Management System With Acknowledgement Feature
Project Report (Instrumentation & Measurement) : Energy Management System With Acknowledgement Feature
Submitted to:
Sir Maaz Hassan
Submitted by:
15-ME-148 M. Mujtaba Rehman
15-ME-156 M. Rehan Ashraf
15-ME-164 Zeeshan Khan
Contents
COMPONENTS: ......................................................................................................... 3
BACKGROUND: ......................................................................................................... 3
CIRCUIT EXPLANATION: ............................................................................................ 4
1. Sensor section: ................................................................................................ 4
2. Control Section: ............................................................................................... 5
3. Display section: ................................................................................................ 5
4. Relay Driver section: ........................................................................................ 5
AUTOMATION SYSTEM CIRCUIT DIAGRAM: .............................................................. 6
CODING: ................................................................................................................... 6
COMPONENTS:
Arduino UNO
Relay (5v)
Resisters
IR Sensor module
16x2 LCD display
Bread Board
Connecting Wires
Led
BC547 Transistor
BACKGROUND:
This project is divided into four parts: sensors, the controller, counter display and
gate. The sensor would observe an interruption and provide an input to the
controller which would run the counter increment or decrement depending on
entering or exiting of the person. And counting is displayed on a 16x2 LCD through
the controller.
When anyone enters the room, IR sensor will get interrupted by the object then
another sensor will not work because we have added a delay for a while.
CIRCUIT EXPLANATION:
There are some sections of whole people counter circuit that are sensor section, a
control section, the display section and driver section.
1. Sensor section: In this section, we have used two IR sensor modules which
contain IR diodes, potentiometer, Comparator (Op-Amp) and leds. The
potentiometer is used for setting reference voltage at comparator’s one
terminal and IR sensors sense the object or person and provide a change in
voltage at comparator’s second terminal. Then comparator compares both
voltages and generates a digital signal at the output. Here in this circuit we
have used two comparators for two sensors. LM358 is used as comparator.
LM358 has inbuilt two low noise Op-amp.
2. Control Section: Arduino UNO is used for controlling whole the process of
this people counter project. The outputs of comparators are connected to
digital pin number 14 and 19 of Arduino. Arduino read these signals and send
commands to relay driver circuit to drive the relay for light bulb controlling. If
you find any difficulty in working with a relay, check out this tutorial on
Arduino relay control to learn more about operating relay with Arduino.
3. Display section: Display section contains a 16x2 LCD. This section will
display the counted number of people and light status when no one will in
the room.
4. Relay Driver section: Relay driver section consist a BC547 transistor and a 5-
volt relay for controlling the light bulb. Transistor is used to drive the relay
because Arduino does not supply enough voltage and current to drive the
relay. So we added a relay driver circuit to get enough voltage and current
for relay. Arduino sends commands to this relay driver transistor and then
light bulb will turn on/off accordingly.
AUTOMATION SYSTEM CIRCUIT DIAGRAM:
The outputs of IR Sensor Modules are directly connected to Arduino digital pin
number 14(A0) and 19(A5). And Relay driver transistor at digital pin 2. LCD is
connected in 4-bit mode. RS and EN pin of LCD is directly connected at 13 and 12.
Data pin of LCD D4-D7 is also directly connected to Arduino at D11-D8 respectively.
Rest of connections are shown in the below circuit diagram.
CODING:
#include<LiquidCrystal.h>
LiquidCrystallcd(12,11,5,4, 3,2);
#define in6
#defineout7
#define relay9
#define relay28
intrealy2= 8;
intcount=0;
voidIN()
{ count++;
lcd.clear();
lcd.print("PersonInRoom:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);}
voidOUT()
{ count--;
lcd.clear();
lcd.print("PersonInRoom:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);}
voidsetup()
{ lcd.begin(16,2);
lcd.print("VisitorCounter");
delay(2000);
pinMode(in,INPUT);
pinMode(out,INPUT);
pinMode(relay,OUTPUT);
pinMode(relay2,OUTPUT);
lcd.clear();
lcd.print("PersonInRoom:");
lcd.setCursor(0,1);
lcd.print(count);}
voidloop()
{ if(digitalRead(in))
IN();
if(digitalRead(out))
OUT();
if(count<=0)
{ lcd.clear();
digitalWrite(relay,LOW);
digitalWrite(relay2,LOW);
lcd.clear();
lcd.print("NobodyInRoom");
lcd.setCursor(0,1);
lcd.print("LightIsOff");
delay(200); }
else{
digitalWrite(relay,HIGH);
digitalWrite(relay2,HIGH);}}