SAVING MODULE
BY
ID: 29935
November, 2018
CERTIFICATION
ii
DEDICATION
iii
ACKNOWLEDGEMENT
Writing this project has had a big impact on me. I would like to reflect on the
people who have supported and helped me so much throughout this period.
I would particularly like to single out my supervisor Dr. Maurice Sesay, I want
I owe special debt of gratitude to Dr. Samba Sesay (H.O.D) and lecturers for
In addition, I would like to thank my parents for their wise counsel and
Dr. Halket Baker, Pst. Paul Winner for your valuable support.
Finally, there are my friends, Francess Adama Munu, Halket Baker, Shuaib
iv
ABSTRACT
As a developing country, power sources in Sierra Leone are limited. We know, a major part of
our electricity is being wasted, due to negligence we come outside the room or hall and forget
to turn off the lights, fans, etc. thus the electricity is wasted.
The main aim of this project Bidirectional visitor counter with an energy saving module is to
minimize the wastage of electricity. It also aim at counting the number of person’s entering
and exiting a room. If one person enters the room the counter will be incremented and if a
person leaves the room the counter will be decremented. When somebody enters the room, the
system automatically turns ON the light and fan. After the last person leaves the room the value
of the counter will be zero and the load will be turned OFF. Total number of person’s inside
the room is displayed in the LCD (Liquid Crystal Display). Arduino microcontroller has been
used in this project as a control circuit. Infrared sensors are placed at the doors and used to
The project has been completed and tested. It works properly, and its performance is
other institution to save energy and to provide an automated lifestyle at will ease the complexity
of life.
v
TABLE OF CONTENTS
CERTIFICATION ......................................................................... ii
DEDICATION............................................................................... iii
ACKNOWLEDGEMENT ........................................................... iv
ABSTRACT .................................................................................... v
vi
2.2. Components Used in the System ............................................................. 8
2.2.4. LM393.............................................................................................................. 13
Introduction .................................................................................. 15
4.1. Automatic On-Off switching for Light and Fan Load ............................ 27
CONCLUSIONS .......................................................................... 30
REFERENCES ............................................................................. 33
viii
LIST OF FIGURES
Figure 4.3: Visitor Counter when there is someone inside the room…………….………….28
ix
x
CHAPTER 1: INTRODUCTION
Background of Study
In today’s world, there is a continuous need for automatic appliances. With the increase in
standard of living, there is a sense of urgency for developing circuits that would ease the
complexity of life. Although not same but many related work have been done by many
researchers. Some of the papers have been studied and described below.
Sonali Gopal Umbre [2016] has done “MICROCONTROLLER BASED ENERGY SAVING
MODULE” [1]. The main purpose of the project is to use smart mechanize devices, saving
electricity, increasing appliance life span and yet providing a desired output.
Subhankar Chattoraj, Aditya Chakraborty [2016] has done a “Bidirectional Visitor Counter
with Automatic Room Light Controller and Arduino as the master controller [2]”. This paper
gives the basic idea of how to control the bidirectional visitor counter and room light counter
using Arduino Mega and Arduino (IDE). The cost of this technology is very economical to be
Sonali K. Pawar [2016] has done an “AUTOMATIC ROOM LIGHT CONTROLLER USING
very advanced and we prefer things to be done automatically without any human efforts. This
project also helps to reduce human efforts. Also it is very useful to conserve resources.
My project compacts with the usage of the energy in this competitive world of electricity. This
project is well organized enough to let someone knows when someone enters and leaves a
room. I got the motivation from the aforementioned successful projects. It will therefore build
and expand on some of the concepts with a primary goal to make our day-to-day routines much
easier.
1
Statement of Problem
Most times out of negligence or when we are in a hurry we forget to turn off the lights or fan
in our homes, colleges, or industries which brings about the problem we are facing nowadays
which is Electricity Wastage. Electricity is one of the most important resources in this century.
Also in most cases switches of lights and fans are located inside the room and one may have to
search for them in the dark. This becomes more difficult if a guest wants to access such a
facility. Similarly, a lot of safety concerns arise after events such as meetings, seminars and
others are held and someone is trapped inside the hall and the security guards closed the
building because they were unaware of the total number of people inside the hall. Moreover,
they could not analyse the feedback of people and number of people attending the seminar or
event as there was not any registration process. To avoid all such situation this project called
This project is aimed at designing a Bidirectional Visitor Counter with an Energy Saving
Module which will automatically count the arrival and departure of visitors entering any room
such as offices, auditorium, conference hall, malls, hotel rooms etc. Wastage of electricity is
one of the main problems which we are facing now-a-days. In our home, school, colleges or
industry we see that fans and lights are kept on even if there are nobody in the room or area
and passage. This happens due to negligence or because we forget to turn lights off or we are
in a hurry. To avoid all such situations this project is designed. This project has three objectives,
first one is known as “Bidirectional Visitor Counter” and second is known as “Energy Saver”.
It overcomes the problem of manual switching. If this system is implemented, then automation
in the switching the product can be achieved and the third is the “Buzzer”. Main concept behind
this project is known as “Visitor counter” which keeps track of the number of persons entering
any room such as seminar hall, conference room, and hotel rooms depending on where the
2
counter is placed. This circuit consist of IR Sensors which are used to sense the entry and
exiting visitor. The Arduino microcontroller receives signals from the sensors, and this signal
LCD Display accurately display the number of persons counted. When someone enters the
room the counter will increase by one value and the room light will automatically come on and
when anyone exit the room the counter will decrease by one value. When the number of persons
inside the room is zero, lights and fans inside the room are automatically turned off. The buzzer
will buzz when the count has reached it limit to tell the other visitors that the space is already
filled. The circuit which we have designed is simple and compact. With the help of some
software tools, we were able to develop the required coding and burn it to the Integrated circuit.
This project covers the design, development, experiments and result of the bidirectional visitor
counter using Arduino Uno microcontroller and the Arduino IDE programming software.
However, to implement the physical hardware design there is a shortage of material and other
connecting wires, fault in LCD display. The following are the scope of the project to make:
The receiver and transmitting sensor of entrance and exit must be synchronized for
perfect counting
The project can be deployed at any entry or exit point which requires monitoring over
3
Project Report Organisation
Chapter 1 serves as the introductory chapter and Theory literature review where we try to
relay the concept and acceptable reasons why the project should be implemented for the
intending user of the work. This chapter will also make room for adding additional
information on past works in the area that will help in the actualization of this project design.
Chapter 2 explain an overview of the design and also treats system component description of
this project design. It comprises of the information gathering, the materials used in designing
and writing the project report. The components and devices used in the course of designing
this project will be analyzed to know their basic means of operation and how they will help in
In chapter 3, it presents the detail design work both hardware and software design, and
discusses the system. The schematic diagram of the design and the source code (in C
language) used in programming the microcontroller were also outlined with the algorithm
and flowchart.
Chapter 4, explains test carried out, expected results, and Performance evaluation.
Chapter 5. Summary and conclusions of the design will be presented. It will be looking at the
problems encountered in designing the project and possible solutions to them. From the
problems and solutions of this work, the suggestion for further improvement will be stated.
4
CHAPTER 2: OVERVIEW OF DESIGN
The basic block diagram of the bidirectional visitor counter with Energy Saving Module is
Power supply
LCD Display
Led Light
Fan
Buzzer (Speaker)
5
2.1.1. Power Supply
Here +9v battery is used to provide the required amount of voltage to essential circuits. The
battery has two terminals both positive and negative terminals on one end.
This block is used to detect the number of people going inside or coming outside upon an
interrupt from the sensors. A pair of IR Transmitter and IR receiver is used as sensor which
work on the principle of light reflection. IR signal (radiation) is transmitted in a direction and
a signal is received at the IR receiver (photodiode) when the IR radiation bounces back from a
surface of the object. The frequency range of this IR sensor can detect up to 38 kHz [4]. By
using this sensors and its related circuit diagram we can count the persons.
Arduino Uno R3 being the latest in a series of Arduino board is the “brain” of the Visitor
Counter. It handles essentially all the functionalities, from interfacing with the sensor to sense
a person, and the LCD display to display the count values. This microcontroller board is based
on the ATmega 328 processor. It has 14 Digital input/output pins, 6 Analog inputs, a 16 mhz.
6
crystal oscillator, a USB connection, a power jack and a reset button. It can also be connected
Liquid crystal display is a thin, flat panel used for electronically displaying information such
as text, images, and moving pictures etc., LCD (Liquid Crystal Display) display number of
individuals in a room. LCD here is preferred over seven segments. The reasons being: LCDs
are economical; easily programmable; have no limitation of displaying special & even custom
characters, animations and so on. A 16x2 LCD means it can display 16 characters per line and
there are 2 such lines. It is very thin technology based on combination of liquid and crystal.
A type of diode that illuminates when electricity passes through it. Like all diodes, electricity
Here the Direct current electrical energy will be converted into mechanical energy by DC
motor. It belongs to a class of rotary electrical machine. Mostly DC Motors are used for
the forces produced by the magnetic fields. The internal mechanism helps the DC Motor to
periodically change the direction of current flow in part of the motor. Coils of wire inside the
motor become magnetized when current flows through them. These magnetic fields attract and
repel magnets, causing the shaft to spin the fan. In our circuit, a 100µF capacitor is used
between the DC motor and the Arduino to smoothen the rapid rise and fall of voltage.
2.1.7. Buzzer
An electrical component that can be used to produced sound. The sound production is being
7
2.2. Components Used in the System
To design the project most of the component used were purchased on the internet through
Amazon which cost $94 in total and some were collected from the department.
So the overall implementation cost is very cheap and is affordable by a common person. This
low cost system is designed to improve the living standard and complexity of visitors counting.
IR Sensor Module
LCD display
LM 393
Potentiometer
Resistors
Capacitor
Power Supply
Buzzer
Led light
Fan
8
2.2.1. IR Sensor Module
In this section we have used IR sensors used to produce Infrared waves. IR sensors consist of
IR Transmitter and IR receiver. IR1 detects the numbers of individuals entering a room. IR2
detects the number of individuals leaving a room. So, two IR sensors was used in this project
for bidirectional counting of visitors. The frequency range of IR sensors is 38 kHz. Also
potentiometer, Comparator (OpAmp) and LED’s are used. The potentiometer is used for setting
reference voltage at comparator’s one terminal and IR sensors sense the object or person and
supply and fixed on one side of the door frame. The receiver has a RX at the front
end. Then comparator compares both voltages and generates a digital signal at output
one for enter sensor & second for exit sensor circuit. Here in this circuit we have used two
comparators for two sensors. LM393 is used as comparator. LM393 has inbuilt two low noise
Op-amp.
9
FEATURES:
The Arduino Uno R3 is a microcontroller bases board. It contains the 8-bit ATmega 328
microcontroller. This board contains 14 digital input/output pins. Among these pins, 6 pins can
be used as PWM outputs. It has 6 Analog inputs, a USB connection, a power jack, an ICSP
header and a reset button. It has 16 MHz of clock speed. It can simply be connected to a
computer with a USB cable or with an AC-to-DC adapter or battery to get it started. The main
functioning component of this board is the ATmega 328 microcontroller. The ATmega 328
FEATURES:
Microcontroller ATmega328
Operating Voltage 5V
10
DC Current for 3.3V Pin 50 mA
SRAM 2 kB (ATmega328)
EEPROM 1 kB (ATmega328)
11
2.2.3. 16x2 LCD Display
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of
applications. A 16x2 LCD display is very basic module and is very commonly used in various
devices and circuits. These modules are preferred over seven segments and other multi segment
LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of
displaying special & even custom characters, animations and so on. A 16x2 LCD means it can
display 16 characters per line and there are 2 such lines. This LCD has two registers, namely,
Command and Data. The command register stores the command instructions given to the LCD.
A command is an instruction given to LCD to do a predefined task like initializing it, clearing
its screen, setting the cursor position, controlling display etc. The data register stores the data
to be displayed on the LCD. The data is the ASCII value of the character to be displayed on
the LCD.
FEATURES:
Built-in controller
Ground (0V)
Supply voltage; 5V
Figure 2.6(a): 16x2 LCD display Figure 2.6(b): LCD module pin diagram
12
2.2.4. LM393
This devices consist of two independent voltage comparators that are designed to operate from
a single power supply over a wide range of voltages. Operation from dual supplies also is
possible as long as the difference between the two supplies is 2 V to 36 V, and VCC is at least
Features:
Potentiometers also known as POT, are nothing but variable resistors. They can provide a
variable resistance by simply varying the knob on top of its head. It can be classified based on
two main parameters. One is their Resistance (R-ohms) itself and the other is its Power (P-
Watts) rating.
13
The value or resistance decides how much opposition it provides to the flow of current. The
greater the resistor value the smaller the current will flow.
Features:
Type: Rotary
14
CHAPTER 3: SYSTEM DESIGN AND DEVELOPMENT
Introduction
This chapter describes the methodologies used for the design of the hardware and software
parts. It begins by giving an overview of the design and then describes how the specific
To achieve this, the IR Sensors were used. These sensors were connected directly to the
For notification purposes, LCD display was employed to indicate room occupancy. The display
was connected to pin 4, 5, 6,7,8,9, GND and +5V of Arduino Uno R3 microcontroller. A
complete diagram of the system is shown in (figure 3.1). It is made up of Arduino Uno R3
The sensor comprises a pair of infrared transmitter and receiver. The two sets are aligned such
that the light pulse from each transmitter falls on the receiver. The outputs are interfaced to A0
and A1 of microcontroller which under the control program stored in its memory displays the
room occupancy on the LCD and makes decision on when to switch on/off the light and fan.
15
Figure 3.1: Circuit diagram of Bidirectional Visitor Counter.
It focuses on the building process of the Bidirectional Visitors Counter. It gives a list of all the
components that were used in the design, and the reason for choosing them. Assembling the
circuit has many short comings. However, most of the challenges faced in the building phase
came from interfacing the microcontroller with the sensors and the LCD. All in all, building
This section talks about how the different components interface with each other. It further
explains the specific pin descriptions for all input and output components in the circuit
development.
16
3.2.1.1. LCD Display Connections With Microcontroller
We use 16 x 2 LCD and that have a parallel interface, meaning that the microcontroller has to
manipulate several interface pins at once to control the display. The Enable pin that enables
writing to the registers .The 8 data pins (D0 -D7). The states of these pins (high or low) are the
bits that we write to a register. There is also a display contrast pin (Vo) connecting with a 10 k
potentiometer, power supply pins (+5 V and Ground) and LED Backlight (Led+ and Led-) pins
that we use to power the LCD, control the display contrast, and turn on and off the LED
backlight, respectively.
Because we will only be writing, pin 5 will be dropped to ground to show that there
will be no reading. We use the backlight, connect LCD pin 16 to GND and LCD pin 15
to +5 v.
17
Connect one side of the potentiometer to Arduino GND, the opposite to Arduino 5v,
and the center to LCD pin 3. The pin 7, 8,9,10 are not used in the Arduino.
We use 220 ohm resistor connected to the LED pin D2 of the Arduino microcontroller and 100
µF capacitor connected with the DC motor of the fan to pin D1 of Arduino microcontroller.
The 220 ohm resistor is to protect the LED and the 100 µF capacitor is to smoothen voltage
surges when the motor start rotating otherwise the motor will tend to draw more current which
could damage the Arduino microcontroller pin. However, if it was with heavy wattage, we
would have used a relay. The main operation of a relay comes in places where only a low-
18
Figure 3.3: Connections to load with power source
Two IR sensors were used in the circuit namely Sensor 1 (Entry) and Sensor 2 (Exit).The
sensors have three pins; Ground, power (5 v), and data pin. The data pin of sensor 1 goes to
A0 and sensor 2 goes to A1 of Arduino microcontroller. They are both power by 5 v supply
19
Figure 3.4: IR sensors interfaced with Arduino microcontroller
Fritzing
Arduino IDE
3.3.1. Fritzing
Basically fritzing is a simulating software, it helps you attach many components like resistors,
capacitors, LEDs, LCDs, keypads, ICs etc. with the Arduino Microcontroller. It has a complete
library of electronics modules that you will ever need for circuit development. You can design
your complete circuit and then simulate it to view the final output. Fritzing has proven its ability
20
to provide useful support in this project. Fritzing also serves as a tool for documentation.
Fritzing has also proven to be a useful tool in teaching electronics to people without an
engineering background. Both Arduino and Data Processing have a number of features in
common, and these commonalities have been a strong influence in the development of Fritzing.
Fritzing offers three alternative views on the circuit: A real-world-like breadboard view, a
classical schematic diagram view, and a PCB design view (Figure 3.6).
21
3.3.1.2. Steps to draw schematic diagram
When the Fritzing starts up, you should be in the Welcome view. You will want to go
to Breadboard view.
Check for Pre-made Parts. If you are just updating a board in Fritzing, first check to see
if there is a part that is closely related to the Fritzing part you are trying to create. You
There are 6 main sections of the Fritzing Parts Editor in which you will need to make
Breadboard
Schematic
PCB
Icon
Metadata
Connectors
Before you continue on, it is a good idea to save as a new part first. Go to File. Then,
When working in the main Fritzing application, you connect different Fritzing parts
with colored wires to show how the parts connect to one and another. In order for
Fritzing to know where connector pins are on a board or part, you will need to tell
Delete component by right clicking on the component and select delete from the
Move component by clicking left to select and drag it to the editing window
Open the code tab and import your code and simulate
22
Figure 3.7: Schematic view of Visitor counter in fritzing
The Arduino Integrated Development Environment (IDE) is the software. This software design
is divided into two parts. First we write the Arduino program in Arduino software. Then we
compile it to the Arduino hardware. This Arduino command is control the Arduino hardware
The choice of using Arduino for this project is because it is beginner-friendly, easy to develop
routines for, and has lots of examples and online tutorials. It is best to keep in mind that one of
the aims of this project in addition to its engineering achievement is to design something that
Arduino runs on Windows and other operating systems. Go to the Arduino software web site
23
Figure 3.8: Arduino IDE interface
The Arduino language is implemented in C/C++ and based in Wiring with a simplified
structure. The Arduino Uno can be programmed once the Arduino IDE is installed on the
computer, connecting the board with computer using USB cable. Select “Arduino Uno from
the tools> Boards menu, and choose the correct port by selecting tools > ports.
The ATmega 328 on the Arduino Uno comes preburned with a bootloader that allows you to
upload new code to it without the use of an external hardware programmer. It communicates
The language is divided into three main parts, the Structure, Function, and Value (Variable and
Constants).
24
Structure
The structure of an Arduino language is divided into two main functions in the sketch:-the
Setup () and Loop () functions. The Setup () is called at the start of the program or at reset of
the Arduino board. The codes in the Setup () section are executed once by the program. Under
the Setup () section s where all serial connections are initialized, initialization of variables, pin
On the other hand, the Loop () function is called repeatedly until the Arduino board is reset.
Codes in this section are continuously executed, allowing the program to change and respond.
Function
Functions in Arduino are used to define tasks and they return to the region of the code from
which the functions were called. As in C/C++, typical functions are created when one needs to
execute the same action many times in a program. As mentioned earlier, the Arduino sketch
requires two main functions by default, Setup () and Loop (). However, other functions can be
Variable
Variables are used for naming and storing values for later use in the program. In setting up a
variable, the variable type is first declared with a recognized syntax of the Arduino language.
Once a variable has been set, you can either use it directly or test to meet certain conditions.
In order to write the code to control the microcontroller operations, the following algorithm
which is illustrated in (figure 3.9) in the form of a flow chart was used.
25
Algorithm
If the sensor 1 is interrupted first then the microcontroller will look for the sensor 2,
and if it is interrupted then the microcontroller will increment the count and switch on
If the sensor 2 is interrupted then the microcontroller will look for the sensor 1, and if
When the visitors exceed the number of count the buzzer will alarm.
When the last person leaves the room then counter goes to 0 and that time the light and
Flowchart
26
CHAPTER 4: IMPLEMENTATION AND RESULTS
prototype that represents the system. Thus the whole system that is being developed is given
When neither sensor 1 nor sensor 2 is interrupted the microcontroller understand that no one
has entered the room which results the LCD display value to be zero and the light and fan are
off.
27
Figure 4.2: Visitor counter when there is no person in the room.
When sensor 1 and sensor 2 are interrupted the microcontroller understand that someone has
entered the room which results the count in the LCD display to be incremented by one value
Figure 4.3: Visitor counter when there is someone inside the room
28
Case 3. When the room capacity is full.
When the room has reached it maximum capacity as designed the buzzer will alarm whenever
system that is used to take count of the number of people in a particular room upon entering
and exiting the room, so that when there is no person in the room the lights, fans and gadgets
are turned off automatically. With this system the user do not need to press any switch, once
he/she enters the room, the room the light turns on. The expected test results were obtained as
the IR Sensor 1 (entrance) communicated successfully with the IR Sensor 2 (exit) section of
the control system. The signal received was then able to activate the load and control the
29
CHAPTER 5: DISCUSSIONS, RECOMMENDATIONS AND
CONCLUSIONS
5.1. DISCUSSION
This is a very basic circuit and has many shortcomings. For example, this system will not
differentiate between a person and any other obstacle interrupting the sensors. Also this circuit
is good enough for only one person entering at a time. Initially when the system is powered on
and the counting begins the whole circuit board will go off because the DC motor voltage is
greater than the Arduino +5v specification, for overcoming these and many other problems
with this system after troubleshooting, further improvements are being done by adding 100 µF
capacitor to the motor which is to smoothen voltage surges when the motor start rotating
otherwise the motor will tend to draw more current which could damage the Arduino
microcontroller pin.
Low cost because human-based data collection comes with great expense
Counting the visitors helps to maximize the efficiency and effectiveness of employees,
It saves large amount of energy and also saves money. Human efforts to count the
number of person are eliminated. It automatically counts the number of people inside a
Also, there is no hazardous elements used in the circuit and hence it can be used even
30
Disadvantages of this project:
It is used only when one person cuts the rays of the sensor hence, cannot be used when
The only person who can communicate with the control module is the person who is in
5.2. RECOMMENDATION
Initially for the limitation of time and required fund we were able to develop just a visitor
counter with an energy saving module. In the future the system will also work using:
The system can be upgrade to allow the users to configure the intensity of light in real
time.
Voice alarm system can be included to indicate that the room is full & persons cannot
enter inside.
Addition of cameras through with not only counting but also the image can be stored
precisely.
This is a short range system with an IR sensor. For long range, we use lasers.
5.3. CONCLUSION
We just took up this project as we were interested in electronics and wanted to learn about it.
Through this project, we learnt a lot about the functioning and use of different electronic
components and their applications in real life. We fix the entire problem that we have. Finally,
31
we successfully achieve our primary goals. We were able to correlate what we studied in our
course to real life. Also this is very simple and effective idea which can be used in many places
to save energy.
improve not only energy consumption but also a comfortable living can be achieved by room
automation technique. This concept is use in many developing countries in order to save their
limited power. It ensures that our work will not only be usable in the future but also provides
the flexibility to adapt and extend, as technologies are growing day by day there will be more
advanced automation techniques which can improve current life style and can save more
energy will capture our market. Also in this digital world, Technology is very advanced and
we prefer things to be done automatically without any human efforts. This project also helps
to reduce human efforts. It is very useful in Schools, hospitals, malls, offices, auditoriums.
32
REFERENCES
[1] Sonali Gopal Umbre, Komal Dipak Yadav, “MICROCONTROLLER BASED ENERGY
SAVING MODULE”, International Journal For Technology Research In Engineering.
Volume 3, Issue 6, February-2016. ISSN (Online): 2347-4718
[2] Subhankar Chattoraj, Aditya Chakraborty,” Bidirectional Visitor Counter with Automatic
Room Light Controller and Arduino as the master controller ”, International Journal of
Scientific and Research Publications, Vol. 6, Issue 7, July 2016.
[4] Imperial Journal of Inter Disciplinary Research (IJIR) vol.3, Issue-4, 2017
ISSN: 2454-1362, http:// www.onlinejournal.in
[5] https://arduino.cc/en/tutorial
[6] www.elegoo.com
[7] https://circuitdigest.com/microcontroller-projects/
[8] www.bm-es.com
[9] https://fritzing.org
33
Appendix A: PROGRAMMING CODE
34
35
36
Appendix B: MODEL IMAGES
37