Anda di halaman 1dari 47

FOURAH BAY COLLEGE

UNIVERSITY OF SIERRA LEONE

BIDIRECTIONAL VISITOR COUNTER WITH ENERGY

SAVING MODULE

BY

MICHAELA AMINATA BLESSING KARGBO

ID: 29935

A Project Submitted to the Department of Electrical and


Electronics Engineering, Fourah Bay College, University of Sierra
Leone, in part fulfillment of the requirement for the Award of the
degree of Bachelor of Engineering in Electrical and Electronics
Engineering.

November, 2018
CERTIFICATION

This is to certify that MICHAELA AMINATA BLESSING KARGBO, with

Registration number 29935, has successfully completed this Dissertation

under my supervision, and I hereby approve of its submission to the

Department of Electrical and Electronic Engineering, Fourah Bay College,

University of Sierra Leone.

STUDENT’S SIGNATURE DATE

SUPERVISOR’S SIGNATURE DATE

Ing. DR MAURICE SESAY

ii
DEDICATION

This work is dedicated to my younger brother, Master James Favour Sesay,

all Female Engineers, Orphans and Homeless Children.

iii
ACKNOWLEDGEMENT

I wish to express my sincere gratitude to God Almighty who provided me this

opportunity for making me able to complete this present study successfully.

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

to thank you for your excellent cooperation.

I owe special debt of gratitude to Dr. Samba Sesay (H.O.D) and lecturers for

their constant support and guidance throughout the course work.

In addition, I would like to thank my parents for their wise counsel and

prayers. Also, Mr. Mohamed Ibrahim Bangura, Mr. Vincent Balogun,

Dr. Halket Baker, Pst. Paul Winner for your valuable support.

Finally, there are my friends, Francess Adama Munu, Halket Baker, Shuaib

Conteh, Ansu Coomber, Oliver Williams, Sarah M’bawa and well-wishers.

Thank you all.

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

detect the presence of human.

The project has been completed and tested. It works properly, and its performance is

satisfactory as it can be implemented in classroom, mall, seminar hall, auditorium, theatres, or

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

LIST OF FIGURES ...................................................................... ix

CHAPTER 1: INTRODUCTION .............................................. 1

Background of Study ................................................................................. 1

Statement of Problem ................................................................................ 2

Objective of the Project ............................................................................. 2

Scope of the project ................................................................................... 3

Project Report Organisation ..................................................................... 4

CHAPTER 2: OVERVIEW OF DESIGN.................................. 5

2.1. Block Diagram ............................................................................................ 5

2.1.1. Power Supply ..................................................................................................... 6

2.1.2. Enter and Exit Circuit ........................................................................................ 6

2.1.3. Arduino Uno R3 Microcontroller ...................................................................... 6

2.1.4. 16x2 LCD........................................................................................................... 7

2.1.5. Led Light (Light Emitting Diodes) .................................................................... 7

2.1.6. Fan With DC Motor ........................................................................................... 7

2.1.7. Buzzer ................................................................................................................ 7

vi
2.2. Components Used in the System ............................................................. 8

2.2.1. IR Sensor Module ............................................................................................. 9

2.2.2. Arduino Uno R3 Microcontroller .................................................................... 10

2.2.3. 16x2 LCD Display ........................................................................................... 12

2.2.4. LM393.............................................................................................................. 13

2.2.5. 10k Potentiometer ............................................................................................ 13

CHAPTER 3: SYSTEM DESIGN AND DEVELOPMENT ... 15

Introduction .................................................................................. 15

3.1. The Design ................................................................................................ 15

3.2. Hardware Design Development .............................................................. 16

3.2.1. Circuit Design Development............................................................................ 16

3.2.1.1. LCD Display Connections With Microcontroller ............................................ 17

3.2.1.2. Connection To Load With Power Source ........................................................ 18

3.2.1.3. Infrared Sensor Interface to Microcontroller ................................................... 19

3.3. Software Design Development ................................................................ 20

3.3.1. Fritzing ............................................................................................................. 20

3.3.1.1. Current Design Workflow................................................................................ 21

3.3.1.2. Steps to draw schematic diagram ..................................................................... 22

3.3.2. Arduino IDE..................................................................................................... 23

3.3.2.1. Installing Arduino ............................................................................................ 23

3.3.2.2. Arduino Language ........................................................................................... 24

3.3.2.3. Flowchart for the system software ................................................................... 25

CHAPTER 4: IMPLEMENTATION AND RESULTS .......... 27

4.1. Automatic On-Off switching for Light and Fan Load ............................ 27

4.2. Conclusion of Operation ......................................................................... 29


vii
CHAPTER 5: DISCUSSIONS, RECOMMENDATIONS AND

CONCLUSIONS .......................................................................... 30

5.1. DISCUSSION ............................................................................................. 30

5.2. RECOMMENDATION ................................................................................ 31

5.3. CONCLUSION ........................................................................................... 31

REFERENCES ............................................................................. 33

Appendix A: PROGRAMMING CODE .................................. 34

Appendix B: MODEL IMAGES ................................................ 37

viii
LIST OF FIGURES

Figure 2.1: Block diagram of Visitor Counter...............................................................….....5

Figure 2.2: Entry and Exit block diagram……………………………………………...........6

Figure 2.3: Circuit diagram of IR Sensor…………………………………………….…..….9

Figure 2.4: IR Sensor with LM393 Comparator……………………………………..….….10

Figure 2.5(a): Arduino Uno R3 Microcontroller………………………………….….….….11

Figure 2.5(b): Pin Configuration of ATmega328…………………………………………...11

Figure 2.6(a): 16x2 LCD Display……………………………………………………..…….12

Figure 2.6(b): LCD module pin diagram……………………………………………………12

Figure 2.7(a): LM393 Comparator…………………………………………………....…….13

Figure 2.7(b): Pin diagram of LM393………………………………………………………13

Figure 2.8: 10 k Potentiometer…………………………………………………….………..14

Figure 3.1: Circuit diagram of Bidirectional Visitor Counter……………………….…...…16

Figure 3.2: LCD display connections with Arduino Microcontroller………………………18

Figure 3.3: Connections to load with power source………………………………...………19

Figure 3.4: IR sensors interfaced with Microcontroller…………………………………….20

Figure 3.5: Fritzing Interface……………………………………………………….…….…21

Figure 3.6: Fritzing’s synchronized views: breadboard, schematic and PCB……….….…..21

Figure 3.7: Schematic view of Visitor Counter in Fritzing…………………..……….…….23

Figure 3.8: Arduino IDE …………………………………………………………………....24

Figure 3.9: Flowchart of Circuit Operation…………….……………………………….…..26

Figure 4.1: Complete Circuit System………………………………………………………..27

Figure 4.2: Visitor Counter when there is no person in the room……………….…………..28

Figure 4.3: Visitor Counter when there is someone inside the room…………….………….28

Figure 4.4: Visitor Counter when room capacity is full…………………………………….29

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

what users have to be deprived from in their absence.

Sonali K. Pawar [2016] has done an “AUTOMATIC ROOM LIGHT CONTROLLER USING

MICROCONTROLLER AND VISITOR COUNTER” [3].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. 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

“Bidirectional Visitor Counter with Energy Saving Module” is designed.

Objective of the Project

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

is operated under the control of Arduino software stored in the ROM.

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.

Scope of the project

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

resources. Some risks faced include, malfunctioning of microcontroller or sensor, loosening of

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

extended period of time for counting visitors

 The sensor must be active to detect whenever there is an obstruction

 The display unit interface must always be monitored

 The user must be familiar with numerical counting.

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

putting up this design, system design approach.

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

Figure 2.1: Block diagram of visitor counter.

2.1. Block Diagram

The basic block diagram of the bidirectional visitor counter with Energy Saving Module is

shown in the figure above.

This block diagram mainly consist of the following essential blocks:

 Power supply

 Entry and exit circuit

 Arduino UNO R3 microcontroller

 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.

2.1.2. Enter and Exit Circuit

Figure 2.2 Entry and Exit block diagram

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.

2.1.3. Arduino Uno R3 Microcontroller

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

to a computer with a USB cable or power it with AC-DC adapter or a 9v battery.

2.1.4. 16x2 LCD

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.

Liquid state produces an image for display.

2.1.5. Led Light (Light Emitting Diodes)

A type of diode that illuminates when electricity passes through it. Like all diodes, electricity

only flows in one direction through these components.

2.1.6. Fan With DC Motor

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

controlled by the embedded program on the Arduino.

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.

We use following component:

IR Sensor Module

Arduino Uno R3 Microcontroller Board

LCD display

LM 393

Potentiometer

Resistors

Capacitor

Power Supply

Buzzer

Led light

Fan

8
2.2.1. IR Sensor Module

Figure 2.3: Circuit diagram of IR Sensor

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

provide a change in voltage at comparator’s second terminal. It is powered with 5 volt DC

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:

 IR transmitter / receiver pair

 LM393 comparator circuit for clean detection

 LED indicator of detection

 3.3 and 5V compatible

Figure 2.4: IR sensor with LM393 comparator

2.2.2. Arduino Uno R3 Microcontroller

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

microcontroller has 2 kB of SRAM, 1 kB of EEPROM and 32 kB of flash memory [5].

FEATURES:

 Microcontroller ATmega328

 Operating Voltage 5V

 Digital I/O Pins 14 (of which 6 provide PWM output)

 Analog Input Pins 6

 DC Current per I/O Pin 40 mA

10
 DC Current for 3.3V Pin 50 mA

 Flash Memory 32 kB (ATmega328)

 SRAM 2 kB (ATmega328)

 EEPROM 1 kB (ATmega328)

 Clock Speed 16 MHz

Figure 2.5(a): Arduino Uno R3 Microcontroller

Figure 2.5(b): pin configuration of 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:

 2-line x16 characters display; 5x8 dots with cursor

 Built-in controller

 Ground (0V)

 Supply voltage; 5V

 Contrast adjustment; through a variable resistor

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

1.5 V more positive than the input common-mode voltage.

Features:

 Wide Single−Supply Range: 2.0 Vdc to 36 Vdc

 Split−Supply Range: ±1.0 Vdc to ±18 Vdc

 Very Low Current Drain Independent of Supply Voltage: 0.4 mA

 Low Input Bias Current: 25 nA

 Low Input Offset Current: 5.0 nA

 Low Input Offset Voltage: 5.0 mV (max) LM293/393

 Input Common Mode Range to Ground Level

Figure 2.7(a): LM393 comparator Figure 2.7(b): Pin diagram of LM393

2.2.5. 10k Potentiometer

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

 Available in different resistance values like 500 Ω, 1 k, 2 k, 5 k, 10 k, 22 k, 47 k, 50

k, 100 k, 220 k, 470 k, 500 k, 1 M.

 Power Rating: 0.3 W

 Maximum Input Voltage: 200 Vdc

 Rotational Life: 2000 k cycles

Figure 2.8: 10 k Potentiometer

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

hardware and the software for the system were designed.

3.1. The Design


This project aimed at designing a Bidirectional Visitors Counter with an Energy saving module.

To achieve this, the IR Sensors were used. These sensors were connected directly to the

microcontroller input pins and acted as inputs to the system.

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

microcontroller, 16x2 LCD display, buzzer, fan, light and IR sensors.

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.

3.2. Hardware Design Development

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

the counter took us about three weeks.

3.2.1. Circuit Design Development

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.

We connect the LCD pins with Arduino in following steps:

 Pin 1 is connected to Arduino GND

 Pin 2 is connected to Arduino +5v

 Pin 3 is connected to wiper (this is the middle pin of the 10 k potentiometer)

 Pin 4 is connected to Arduino pin D4

 Pin 5 is connected to Arduino GND

 Pin 6 is connected to Arduino pin D5

 Pin 11 is connected to Arduino pin D6

 Pin 12 is connected to Arduino pin D7

 Pin 13 is connected to Arduino pin D8

 Pin 14 is connected to Arduino pin D9

 Pin 15 is connected to Arduino +5v with a 100 ohm resistor

 Pin 16 is connected to Arduino GND

 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.

Figure 3.2: LCD display connections with Arduino Microcontroller

3.2.1.2. Connection To Load With Power Source

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-

power signal can be used to control a circuit.

18
Figure 3.3: Connections to load with power source

3.2.1.3. Infrared Sensor Interface to Microcontroller

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

and ground with the Arduino microcontroller.

19
Figure 3.4: IR sensors interfaced with Arduino microcontroller

3.3. Software Design Development


The software used in this project is:

 Fritzing

 Arduino IDE

3.3.1. Fritzing

Fritzing is a tool for advancing electronic prototyping for designers.

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.

Figure 3.5: Fritzing Interface

3.3.1.1. Current Design Workflow

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).

Figure 3.6: Fritzing’s synchronized views: breadboard, schematic and PCB

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

can type the part's name into the search bar.

 There are 6 main sections of the Fritzing Parts Editor in which you will need to make

changes. Those are:

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,

select Save as new part.

 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

Fritzing where those connectors are.

 Delete component by right clicking on the component and select delete from the

resulting context menu

 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

3.3.2. Arduino IDE

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

and other circuit and display connection.

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

is fun and appreciable and can be easily understood by anyone.

3.3.2.1. Installing Arduino

Arduino runs on Windows and other operating systems. Go to the Arduino software web site

at http://www.arduino.cc/en/Main/Software and download the version of the software

compatible with our system. We use Arduino 1.8.5 version.

23
Figure 3.8: Arduino IDE interface

3.3.2.2. Arduino Language

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

using the original STK500 protocol.

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

modes, and use of libraries.

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.

Figure 3.8 above shows the structure format of an Arduino program

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

created outside of those two functions.

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.

3.3.2.3. Flowchart for the system software

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

the light and fan, if it is first time interrupted.

 If the sensor 2 is interrupted then the microcontroller will look for the sensor 1, and if

it is interrupted then the microcontroller will decrement the count.

 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

fan will be turned off.

Flowchart

Figure 3.9: Flowchart of circuit operation

26
CHAPTER 4: IMPLEMENTATION AND RESULTS

In order to implement and demonstrate the system developed theoretically, we created a

prototype that represents the system. Thus the whole system that is being developed is given

below, (Figure 4.1).

Figure 4.1: Complete circuitry system

4.1. Automatic On-Off switching for Light and Fan Load

Case 1: When there is no person inside the room.

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.

Case 2: When there is a person inside 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

and the light and fan are turned on automatically.

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

another person tries to enter.

Figure 4.4: Visitor counter when room capacity is full

4.2. Conclusion of Operation


The design of the Bidirectional visitors counter with Energy saving module is meant to be a

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

lighting point successfully.

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.

Advantages of this project:

 Low cost because human-based data collection comes with great expense

 Counting the visitors helps to maximize the efficiency and effectiveness of employees,

floor area and sales potential of an organization.

 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

particular room or hall.

 Also, there is no hazardous elements used in the circuit and hence it can be used even

at hazardous atmospheres in an industrial area.

30
Disadvantages of this project:

 It is used only when one person cuts the rays of the sensor hence, cannot be used when

two or more persons cross the door simultaneously.

 The only person who can communicate with the control module is the person who is in

the receptionist or security unit.

5.2. RECOMMENDATION

Future Work Scope:

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:

 Smoke sensor to detect smoke automatically in any room.

 The system can be upgrade to allow the users to configure the intensity of light in real

time.

 Wireless connectivity can be added to system, by controlling the Wi-Fi modules.

 We can send the data to a distant location using mobile or internet.

 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.

Studies on energy consumption have shown that it is at a stage of retardation by the

involvement of government and due to advance technological growth. Such a mechanism to

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.

[3] Sonali K. Pawar “AUTOMATIC ROOM LIGHT CONTROLLER USING


MICROCONTROLLER AND VISITOR COUNTER”, IJICTRD – INTERNATIONAL
JOURNAL OF ICT RESEARCH AND DEVELOPMENT VOL-1 ISSUE-4, 6, August,
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

[10] DIY Visitor Counter Tutorial available at https://youtube.com

33
Appendix A: PROGRAMMING CODE

34
35
36
Appendix B: MODEL IMAGES

37

Anda mungkin juga menyukai