automatic visitor counter and light switching

81
CHAPTER ONE 1.0 INTRODUCTION The need for a device that can automatically control the lightening system of a room and capability of taking count of number of people in a room on its own has been long overdue. Fire outbreaks that occur in various homes originate when the occupant are either sleeping or not even at home at all. In big environments such as petrochemical industries, whenever there is fire outbreak, it turns out to be so fierce that people run away for the sake of their lives. 1.1 OBJECTIVE OF PROJECT 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 fan and lighting point are kept on even if there are nobody in the room or area and passage. This happens due to negligence or because we forgot to turn lights off or we are in a hurry. To avoid all such situations this project called “Automatic room light controller with visitor counter” is designed. This project has two modules, first one is known as “Digital Visitor counter” and second module is known as “Automatic room light 1

Upload: lea-jean-consigo

Post on 10-Dec-2015

46 views

Category:

Documents


2 download

DESCRIPTION

automatic bidirectional

TRANSCRIPT

Page 1: automatic visitor counter and light switching

CHAPTER ONE

1.0 INTRODUCTION

The need for a device that can automatically control the lightening system of a room and

capability of taking count of number of people in a room on its own has been long overdue. Fire

outbreaks that occur in various homes originate when the occupant are either sleeping or not even

at home at all. In big environments such as petrochemical industries, whenever there is fire

outbreak, it turns out to be so fierce that people run away for the sake of their lives.

1.1 OBJECTIVE OF PROJECT

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 fan and lighting point are kept on even if there are nobody

in the room or area and passage. This happens due to negligence or because we forgot to turn

lights off or we are in a hurry. To avoid all such situations this project called “Automatic room

light controller with visitor counter” is designed. This project has two modules, first one is known

as “Digital Visitor counter” and second module is known as “Automatic room light controller”.

Main concept behind this project is known as “Visitor counter” which measures the number of

persons entering in any room like seminar hall, conference room, hotel rooms. This function is

implemented using a pair of Infrared sensors. The microcontroller does the above job. It receives

the signals from the sensors, and this signal is operated under the control of software which is

stored in the ROM.

LCD display placed outside the room displays this value of person count. This person count will

be incremented if somebody enters inside the room and at that time lights are turned on. And in

reverse way, person count will be decremented if somebody leaves the room. When number of

persons inside the room is zero, lights inside the room is turned off using a relay interface. In this

1

Page 2: automatic visitor counter and light switching

way Relay does the operation of “Automatic room light controller”. Since this project uses 2

infrared sensors, it can be used as Bidirectional person counter as well.

1.2 SIGNIFICANCE OF THE PROJECT

1. This project can be used in various rooms like seminar hall, conference hall where the

capacity of room is limited and should not be exceeded. This Project will display the

actual number of persons inside the room.

2. This design and project can be used in Hotel rooms to monitor the number of persons that

enters the room when a guest lodges, so to make sure they don’t exceed number of

visitors that are allowed to lodge in a room.

3. “Automatic Room light Controller with Visitor Counter” can be used in class rooms,

study rooms in colleges, to take count the accurate number of students in the classroom.

4. This project can also be used in our homes because many times we come out of our

bedroom or any other room and we forgot to turn off the room light.

5. This project can be used in Cinema halls, multiplex, malls as well as in temples to count

the number of person entering inside. So that these places should not get over crowded to

avoid congestion.

6. This project helps to ascertain the exact number of people in a particular room

7. It would be very difficult to lock in someone in a room, airplane when trying to evacuate

a place. Man falls asleep on flight making connection in Houston; wakes up in dark,

empty plane.

2

Page 3: automatic visitor counter and light switching

Advantages:

1. Main advantage of this project is that it helps in energy conservation. Because when there is

nobody inside the room then lights are turned off.

2. Human efforts to count the number of person is eliminated. Since this project does the

automatic person counting with the help of two sensors installed on door frame.

3. In terms of Security it helps to check unauthorized entrances and exits. The display helps to

alert and show the number of persons present.

Future Development:

1. Voice alarm system can be added to indicate that room is full & persons can’t enter inside.

2. We can increase the maximum number of persons that can be counted by implementing the

external EEPROM IC.

3. We can send this data to a remote location using mobile or internet.

1.3 SCOPE OF THE PROJECT

The following are the scope for the project made:

The display unit interface must always be monitored

The sensors must be active to count whenever an obstruction of the Infrared light is

blocked

The user is familiar with numerical counting.

The receiver and the transmitting sections, i.e. the entrance and exit must be in

synchronization for perfect counting.

The controlled appliances will have to have an electrical interface in order to be

controlled by microcontroller

The audience reading this document will have a familiarity with engineering terms

3

Page 4: automatic visitor counter and light switching

All measurements for frequency, voltage and temperature will be in the standard scale

1.4 LIMITATIONS OF THE PROJECT

Listed below are client-specified limitations:

If someone goes out from the entrance it would count as one, also if someone goes comes

in through the exit it would decrement one. So entrance and exit doors must strictly be

abided.

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

when two person crossing simultaneously

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

receptionist and security units.

Only devices with electrical controlling input ports will be possible targets for control

The receiver must have a power source (220V) attached at all times

1.5 PROJECT REPORT ORGANIZATION

Chapter 1 serves as the introductory chapter where we try to relay the concept and

acceptable reasons why the project should be implemented for the intending user of the work.

Chapter 2 deals with the literature review of all possible related or closely related work of

the design. The evolutionary trend in automatic room light controller operations and design,

specification will also be looked at. The use and importance of this project design will also be

mentioned here. It will be looking at the best place where this project design can be use and where

it cannot. 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.

4

Page 5: automatic visitor counter and light switching

Chapter 3 treats the methodology of this project design. It comprises of the information

gathering, the source of 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;

the possible way to tackled the project design from scratch, bottom-up; it will treat how the

practical detail was gotten before considering about the general principle of the system design,

choice of design system; it focuses on why the project design was done using a microcontroller

rather than using only digital logic.

In chapter 4, it presents the detail design work and discusses the system, test carried out,

Expected results, and Performance evaluation. The schematic diagram of the design and the source

code (in Assembly language) used in programming the microcontroller were also outlined.

Summary and conclusion of the design will be presented in Chapter 5. 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.

5

Page 6: automatic visitor counter and light switching

CHAPTER TWO

2.0 LITERATURE REVIEW

2.1 BASIC HISTORICAL BACKGROUND OF AUTOMATIC ROOM LIGHT

CONTROLLER

2.1.1 Historical Background:

As a result of the fast growing trend in instrumentation engineering, a good number of electronic

instruments that exists in advanced countries should also exist in our country Nigeria.

Industrial electronics is a holistic aspect of modern world technology; as such, most of the

electronically advanced countries like USA, Japan, Russia, etc cannot sustain their technological

advancement without the above mentioned subject.

The advent of microelectronics in 1959 by jack kilby, gave rise to the birth of both linear and

digital circuits like Operational Amplifiers, Voltage Regulators, IC Timers, Combinational

Logic, Structural and Sequential Logic ICs among a host of other digital system components.

The control and automation of human counters for hotel room processes can be realized using a

microcontroller integrated with an infrared sensor which senses the passage of human beings and

detects them and counts.

The discovery of the microcontroller in 1972 marked the beginning of micro program control in

electronics. Microprocessors like 8080, 8086, 8088; Pentium, etc were employed for micro

program control of batch counters in the 20th century but microcontrollers became more preferable

for such embedded applications for control systems in contrast to the microprocessors which are

better for general purpose applications. Other devices which may be similarly used for such

control operations are programmable logic devices (PLDs) such as Complex Programmable Logic

Devices (CPLDs), Field Programmable Gate Array (FPGA) among a host of other devices. This

6

Page 7: automatic visitor counter and light switching

automatic room light controller with digital counter contains a Sensor–TSOP 1738 (Infrared

Sensor) formed with a combination of infrared diode and photo diode, while the digital readout

was formed with three de-multiplexed 7-segment display. The control mechanism of this

automatic room light controller with digital counter is realized through a micro program control.

The micro program which is the driving software is written in assembly language and flashed into

the 89c51 microcontroller. I have succeeded in replacing the random logic with microcontroller

control logic for sensing the person and light we are using the light dependent register (LDR). By

using this sensor and its related circuit diagram can count the persons in a given area, put ON/OFF

lights automatically, during this project research.

2.2 THEORIES AND MODELS RELEVANT TO THE DESIGN

The system designed was based on fundamental and principles of electromagnetism, electronic

devices, interfacing, intelligent control systems, and software systems.

2.2.1 THE 8051 FAMILY OF MICROCONTROLLERS

The basic architectural structure of the 8051 is given in figure 2.3 .The block diagram gives a

good picture of the hardware included in the 8051 IC. For internal memory it has a 4kx8 ROM

and 128x8RAM .It has two 16-bit counter /timer and interrupt control for five interrupt sources.

Serial I/O is provided by TxD and RxD (transmitter and receiver ), and it also has four 8-bit

parallel I/O ports(p0 p1 p2 p3).there is an 8052 series of microcontroller available that has an 8k

ROM, 256 RAM and three counters /timers.

Other version of the 8051 are the 8751 ,which has an internal EPROM for program storage in

place of the ROM, and the 8031 which has no internal ROM ,but instead accesses an external

ROM or EPROM for program instructions. Table 2.3 has an extra 4k of program space (except

7

Page 8: automatic visitor counter and light switching

the 8032), double the RAM area, an extra timer /counter, and one additional interrupt source. All

parts use the same CPU instruction set .The ROM-less version (8031 and 8032) are the least

expensive parts but requires an external ROM or EPROM such as a 2732 or 2764 for program

storage

2.2.2 8051 ARCHITECTURE

In other to integrate so many function on a single chip, the designers had to develop an

architecture that uses the same address space and external pins for more than one function. The

technique is similar to that used by the 8085A for the multiplexed AD0 –AD7 lines.

Microcontrollers have different manufacturers such as Atmel, Intel, Dallas Semiconductor,

Hitachi Semiconductor, etc. The first microcontroller manufactured was the 8051 by Intel

Corporation known as MCS-51. Later, Atmel Corporation manufactured other microcontrollers

which include AT89C2051, AT89C51, AT89C52, AT89C53, AT89C54, AT89C55, etc.

Fig 2.1 Block diagram of the 8051 microcontroller

8

Page 9: automatic visitor counter and light switching

INTERNAL MEMORY

Device

Number

Program Data Timers/event counters Interrupt sources

8051 4K x 8 ROM 128 x 8 RAM 2 x 16-bit 5

8751 H 4K x 8 EPROM 128 x 8 RAM 2 x 16-bit 5

8031 None 128x8 RAM 2 x 16-bit 5

8052AH 8Kx8ROM 256 x 8 RAM 3 xi e-bit 6

8752BH 8K x 8 EPROM 256 x 8 RAM 3 x 16-bit 6

8D32AH None 256 x 8 RAM 3 x 16-bit 6

Table 2.1 the 8051 Family of Microcontrollers

The 8051 is a 40-pin IC .thirty two pins are needed for the four I/O ports. To provide for the

other microcontroller control signal, most of the pins have alternate functions, which are

described in this section. Also in the section, we see how the 8051 handles the overlapping

address space used by the internal memory, external memory and the special function registers.

Port 0 is dual–purpose, serving as either an 8-bit bidirectional I/O port (P0.0-P0.7) or the low-

order multiplexed address/data bus (AD0-AD7).As an I/O port, it can sink up to 8 LS TTL load

in the low condition and is a float for the the HIGH condition (lol-3.2MA).The alternate port

designation, AD0-AD7 are used to access external memory .They are activated automatically

whenever reference is made to external memory. The AD lines are demultiplexed into A0-A7

and D0-D7 by using the Address Latch Enable (ALE) signal, the same way it was done with

8085A

9

Page 10: automatic visitor counter and light switching

Port 1 is an 8-bit bidirectional I/O port that can sink or source up to 4 LS TTL loads (lol=1.6MA

and loH= 80μA)

10

Page 11: automatic visitor counter and light switching

Figure 2.2 8051 pin configuration

Port2 is a dual purpose, serving a either an 8-bit bidirectional I/O port (p2.0-p2.7) or as the high

order address bus (A8-A15) for access to external memory. As an I/O port it can sink or source

up to 4LS TTL loads. The port becomes active as the high order address bus whenever reference

to an external memory is made.

Port 3 is a dual purpose, serving as an 8 bit bidirectional I/O port that can sink or source up to

4LS TTL load

Reset input, a HIGH on this pin reset the micro controller.

Address Latch Enable output pulse for latching the low order byte of the address during accesses

to external memory. This pin is also the program pulse input (PROG) during programming of the

EPROM parts.

Program Store Enable is a read strobe for external program memory. It will be connected to the

Output Enable (OE) of an external ROM.

11

Page 12: automatic visitor counter and light switching

External Access (EA) is tied LOW to enable the micro controller to fetch its program code from

an external memory IC. This pin also receives the 21-V programming supply voltage (VPP) for

programming the EPROM parts.

XTAL/XTAL 2 is connection for an external oscillator or a crystal.

2.2.3 Interfacing to External Memory

Up to 64k of code memory (ROM/EPROM) and 64K of data memory (RAM) can be added to

any of the 8051 family member. If you are using the 8031(ROMless) part, then you have to use

external code memory for storing you program instructions. As mentioned earlier, the alternative

function of port 2 is to provide the high –order addresses byte (A8-A15) and the alternate

function of port 0 is to provide the multiplexed low-order address /data byte (AD0-AD7).

If you are interfacing to a general –purpose EPROM like the 2732, then the ALE signal provided

by the 8031 is used to demultiplex the AD0-AD7 lines that are output on port 0 are

demultiplexed by the ALE signal and the address latch, the same way as they were in the 8084A

circuits studied earlier. The PSEN signal is asserted at the end of each instruction fetch cycle to

enable the EPROM outputs to put the addressed code byte on the data bus to be read by port

0.The EA line is tied LOW so that the 8031 knows to fetch all program code from external

memory.

The 8155 RAM accepts the ADO-AD7 lines directly and uses the ALE signal to internally

demultiplex, eliminating the need for an address latch IC. We have to use 11 of the 8051 pins to

interface to the 8155, but the 8155 provides an additional 22 I/O lines, giving us a net gain of 11.

The addresses of the external RAM locations are 0000H to 00FFH, overlapping the addresses of

the internal data memory. There is not a conflict ,however ,because all instruction ignores

12

Page 13: automatic visitor counter and light switching

internal memory and instead ,activates the appropriate control signal ,RD or WR via port 3 .The

LOW RD or WR signal allows the 8155 to send or receive data to or from port 0 of the 8051.

The I/O port on the 8155 are accessed by making the I/OM line HIGH .this is done by using

memory–mapped I/O and specifying an address whose bit A15 is HIGH(800H or higher).

2.2.4 The 8051 Instruction Set

All the members of the 8051 family use the same instruction set. Several new instructions in the

8051 make it especially well-suited for control application. The discussion that follows assumes

that you are using a commercial assembler software package.

Hand assembly of the 8051 instructions into executable machine code is very difficult and misses

out on several of the very useful features available to the ASM51 programmer

2.2.5 Addressing Modes

The instruction set provides several different means to address data memory locations

We will use the MOV instruction to illustrate several common addressing modes. For example,

to move data into the accumulator, any of the following instructions could be used:

MOV A, Rn: Register addressing, the contents of register Rn (where n=0-7) is moved to the

accumulator.

MOV A, @ Ri: Indirect addressing, the contents of memory whose address is in Ri(where I=0 or

1) is moved to the accumulator.(Note: only registers RO and R1 can be used to hold addresses

for the indirect addressing instruction )

MOV A 20H; Direct addressing ,move the content of RAM location 20H to the

accumulator .I/O ports can also be accessed as a direct addresses as shown in the following

instruction.

13

Page 14: automatic visitor counter and light switching

MOVA, P3: Direct addressing, move the contents of port 3 to the accumulator .Direct addressing

allows you to specify the addresses by giving it actual hex address (e.g. BOH) or by giving its

abbreviated name (e.g. p3)

MOV A, #64H: Immediate constant, move the number 64h into the accumulator

In each of the instruction, the destination of the above was the accumulator. The destination in

any of those instructions could also have been registered a direct address location, a direct

address location or an indirect address location.

2.3 SYSTEM COMPONENT DESCRIPTION

The components used are described below;

2.3.1 The Resistor

A resistor is a device that restricts the flow of electricity. It opposes the low of current. Resistors

can limit or divide the current, reduce the voltage, protect an electric circuit, or provide large

amount of heat or light. Its unit is ohm. Alternatively, ohm can be defined as the resistance of a

circuit in which a current of 1 ampere generates heat at a rate of 1 watt. If V represents the

potential difference in volts across the circuit having resistance R ohm, carrying a current in

amperes, the relationship is thus;

V = IR………………………………… (1)

Hence, R = V/I………………………………… (2)

Where; R is resistance

V is voltage I is current (amperes)

14

Page 15: automatic visitor counter and light switching

Resistors can be connected either in series or parallel in an electrical circuit. When resistors are

connected in series, their combined resistance is equal to the sum individual resistors connected

together. For example, if R1 and R2 are connected as shown below.

Resistors connected in series

Then effective resistance R = R1 + R2. This can be applied for any number of resistors

connected in series i.e. R = R1 + R2 + … + Rn; …………………..(3)

for n number of resistors.

Note that the combined resistances in series will always be greater than any of the individual

resistances connected together. For example, if R1 and R2 are connected in parallel as shown

below

R1 R2Fig2.3: Resistor Connected In Series

Resistors connected in parallel

Then effective resistance can be calculated thus;

R = R1 x R2

R1 + R2 ……………………………… (4)

If more than two resistors are connected in parallel, then the following formular can be applied

for n number of resistors connected in parallel

1R

=1

R 1 +

1R 2

+¿ 1

Rn……... …………………………… (5)

R1

15

Page 16: automatic visitor counter and light switching

R2

Figure 2.4 Resistors connected in parallel

The inverse of the reciprocal of the effective resistance is the effective resistance R.

Note that the combined resistance in parallel will always be less than any individual resistance.

SYMBOL REPRESENTATION

Fixed resistor

Variable resistor

Current

Potentiometer

Table 2.2 Symbols of some different resistors and what they represent.

The resistance of a resistor is linear, if the resistor is proportional to the potential difference (PD)

across its terminal. For linear resistors, their resistance remains constant provided the

temperature is constant. All resistors have power rating as a result of the heat they give out when

operating.

The values of resistors are normally shown using colour bands. Each of the colour represents a

number shown in the table below.

COLOR NUMBER

16

Page 17: automatic visitor counter and light switching

REPRESENTATION

BLACK 0

BROWN 1

RED 2

ORANGE 3

YELLOW 4

GREEN 5

BLUE 6

VIOLET 7

GREY 8

WHITE 9

Table 2.4 Resistor Color Code

2.3.2 The Capacitor

A capacitor is an electrical device that stores electrical charges. It’s a passive electronic

component consisting of a pair of conductors separated by a dielectric (insulator). When there is

a potential difference (voltage) across the conductors, a static electric field develops in the

dielectric that stores energy and produces mechanical force energy and produces a mechanical

force between the conductors. An ideal capacitor is characterized by a single constant value,

capacitance, measured in farads (f). This is the ratio of the electric charge on each conductor to

the potential difference between them.

The mathematical expression of capacitance is

C = QV………………………….. (6)

Where C = capacitance (farads)

Q = charge (coulombs)

17

Page 18: automatic visitor counter and light switching

V = Voltage (volts)

One farad can be defined as the charge of one coulomb developed when a potential difference of

one volt is passed through two parallel plates. Capacitors can be connected either in series or in

parallel, this combined capacitance is equal to the sum of individual resistors connected together.

For example if C1 and C2 are connected as shown below

C2

C3

Figure 2.5 Capacitors Connected In Parallel

The effective capacitance can be evaluated thus;

C = C1 + C2…………………………. (7)

For a number of capacitors, the following are the general formular;

C = C1 + C2 + …….Cn…………………………. (8)

Note the combined capacitance in parallel will always be greater than any of the individual

capacitance. When capacitors are connected in series, their combined capacitance is less than any

individual resistances connected together. For example, if C1 and C2 are connected in series as

shown below;

C1 C2

Fig2.6: Capacitors in series

18

Page 19: automatic visitor counter and light switching

If more than two capacitors are connected in series, then the following formular can be for

numbers of capacitors connected in series.

C =1

C 1 +

1C 2

+…1

Cn…………………………….. (9)

The inverse of the reciprocal of the effective capacitance is the effective capacitance R.

The combined resistance in series will always be less than any individual capacitance.

There are basically two types of capacitors namely;

a) Polarized capacitors (electrolytic capacitors)

b) Non-polarized capacitor (non-electrolytic capacitors)

2.3.3 The Diodes

A diode is a two- terminal electronic component that conducts electric current in only one

direction. The term usually refers to a semiconductor diode, the most common type today. This is

a crystalline piece of semiconductor material connected to two electrical terminals. A vacuum

tube diode (now little used except in some high-power technologies) is a vacuum tube with two

electrodes: a plate and a cathode.

The most common function of a diode is to allow an electric current to pass in one direction (i.e.

the forward direction being that it is forward biased) while blocking current in the opposite

direction (i.e. the reverse direction). Thus, the diode can be thought as an electronic version of a

check valve. This unidirectional behavior is called rectification and is used in converting an

alternating current to a direct current and to extract modulation from radio signal to radio

receivers.

However, diode can have more complicated behavior than this simple on-off action.

19

Page 20: automatic visitor counter and light switching

This is due to their complex non-linear electrical characteristics, which can be tailored by

varying the construction of their p-n junction .these are exploited in special purpose diode that

performs many different function .For example ,specialized diode are used as voltage regulators

(zener diode),to electronically tune radio as TV receives (Varactor diode),to generate radio

frequency oscillation (tunnel diode),and to produce light (light emitting diodes ).Tunnel diodes

exhibit negative resistance ,which makes them useful in some types of circuits .diode were the

first semiconductor electronic devices .

A few schematic symbols for diode are

Figure 2.7 (a) (b) (c) (d)

The first diode in fig 2.7 is a light emitting diode (LED) which is a diode formed a direct band-

gap semiconductor ,such as gallium arsenide ,carriers that cross the junction emit photons when

they recombine with the majority carrier on the other side .depending on the material wavelength

(or colors)from the infrared to the near ultraviolet may be produced. The forward potential of

these diode depends on the wavelength of the emitted photon: 1.2 v corresponds to red, 2.4 v to

violet .The first LED were red and yellow and higher frequency diodes have been developed

over time. All LED produce incoherent ,narrow-spectrum light “white “LED are actually

combination of three LEDS of different colour ,or a blue LED with a yellow scintillated coating.

LEDs can also be used as low –efficiency photodiodes in signal applications .A LED may be

paired with a photodiode or phototransistor in the same package, to form an Opto-isolator.

20

Page 21: automatic visitor counter and light switching

The second of diodes in the schematic is the varactor or tuning diode .depicted here is actually

two varactor diode mounted back to back with the dc control voltage applied at the common

junction of the cathodes .these cathodes have the double bar appearance of capacitor to indicate

a Varactor diode .when a D.C control voltage is applied to the common junction of the cathode,

the capacitance exhibited by the diode (all diode and transistor exhibit some degree of

capacitance ) will vary in accordance with the applied voltage .

The third of the diodes is a Zener diode, which is fairly popular for the voltage regulation of low

current power supplies .whilst to obtain high current Zener diode most regulation today is done

electronically with the use of dedicated integrated circuits and pass transistors.

Finally a semiconductor diode could be a small signal diode of the type 1N914 type commonly

used in switching applications, a rectifying diode of the 1N4001 type or even one of the high

power, high current stud mounting type .you will notice the straight bar end has the letter “K”

this donate the cathode while the “A” denotes anode .current can only flow from the anode to the

cathode and not in reverse direction hence the “arrow” appearance .This is one importance

characteristics of diodes.

2.3.4 The Transformer

A transformer is a device that transfers electrical energy from one circuit to another through

inductively coupled conductors (the transformer’s coils). A varying current in the first or primary

winding creates a varying magnetic field through the secondary winding. This varying magnetic

field induces a varying electromotive force (EMF) or voltage in the secondary winding. This

effect is called mutual induction.

If a load is connected to the secondary, an electric current will flow in the secondary winding and

electrical energy will be transferred from the primary circuit through the transformer to the

21

Page 22: automatic visitor counter and light switching

load .in an ideal transformer, the induced voltage in the secondary winding (Vs) is in proportion

with to the primary voltage (Vp), and is giving by the ratio of the number of turns in the

secondary (Ns) to the number of turns in the primary (Np) as follows:

Vs /Vp=Ns/ Np ……………………………… ..(10)

By appropriate selection of the ratio of turns, a transformer thus allows an alternating current

(AC) voltage to be stepped up by making ns greater than Np or stepped down by making Ns less

than Np .in the vast majority of transformers, the winding are coils wound around a

ferromagnetic core transformer being a notable exception.

Transformers ranges in size from a thumbnail –sized coupling transformer hidden inside a stage

microphone to huge unit s of weighing hundreds of tons used to interconnect portions of power

grid .All operate with the basic principles ,although the range of designs is wide .while new

technologies have eliminated the need for transformers in some electronic circuits ,transformers

are still found in nearly all electronic device designed for household (‘’mains’’)

voltage .transformers for high voltage power transmission which makes long distance

economically practical .Transformers can be classified in many different ways ,some of which

include

By Power Capacity: From a fraction of a volt-ampere (VA) to over a thousand MVA

By frequency range: Power audio or radio frequency

By voltage class: From a few voltages to a hundred of kilovolts

By cooling type: Air cooled, oil filled, fan cooled or water cooled

By application: Such as power supply, impedance matching output voltage and current

stabilizer, or circuit isolation

By purpose: distribution, rectifier, arc furnace, amplifier output etc

22

Page 23: automatic visitor counter and light switching

By winding turn ratio: step up, step down isolating with equal or near equal ratio,

variable and multiple windings.

2.3.5 The Transistor

A transistor is a semiconductor device used to amplify and switch electronic signals .it is made

of a solid piece of semiconductor material, with at least three terminals for connection to external

circuit. A voltage or current applied to one pair of the transistor terminal changes the current

through another pair of terminals. Because the controlled(output) power can be much more than

the controlling (input)power, the transistor provides amplification of a signal .they are used in a

Varity of circuits and you will you will find that it is rare that a circuit built in a school

technology department does not contain one transistor. They are central to electronics and there

are two types; NPN and PNP

Transistor circuit symbol

Fig 2.8 (a) PNP TRANSISTORS (b) NPN TRANSISTORS

The advantages of transistors are:

Small size and minimal weight allowing the development of miniaturized electronic

devices

Highly automated manufacturing process resulting in low per unit cost

No warm up period for cathode heaters required after power application

Lower power dissipation and generally greater energy efficiency.

23

Page 24: automatic visitor counter and light switching

Extremely long life .some transistorized devices have been in service for more than 50

years

Insensitivity to mechanical shock and vibration, thus avoiding the problems of micro

phonics in audio applications.

Some limitations are:

Silicon transistors does not operate at voltage higher than about 1000volts (SiC devices

can be operated as high as high 3000 volts ).In contrast electron tubes have been

developed that can be operated at ten thousands of volts

High power, high frequency operation, such as that used in over the air television

broadcasting is better achieved in electron tubes due to improved electron mobility in a

vacuum

Silicon transistors are much more vulnerable than electron tubes to an electromagnetic

pulse generated by a high-altitude nuclear explosion.

2.3.6 Transistor as a Static Switch

The bipolar transistor is the commonly used switch in digital electronic circuits .It is a three-

terminal semiconductor component that allows an input signal at one of its terminal to cause the

other two terminals to become short or an open circuit .the transistors is most commonly made of

silicon that has been altered into N-type material and P-type materials. N-type silicon is made by

24

Page 25: automatic visitor counter and light switching

bombarding pure silicon with atoms having structures with one more electrons that the silicon

does. The P-type silicon is made by bombarding pure silicon with atoms having structures with

one less electron than silicon does.

Three distinct region makes up a bipolar transistor: emitter, base and collector .they can be a

combination of N-P-N type material or P-N-P type material bounded together as a three

dimensional device .the figure below shows the physical layout and symbol for an N-P-N

transistor .In a PNP transistor, the emitter arrow point the other way.

In an electronic circuit, the input signal (0 or 1) is usually applied to the base of the transistor,

which causes the collection –emitter junction to become a short or an open circuit .The rules of

transistor switching are as follows:

1. In an NPN transistor, applying a positive voltage from base to emitter causes the

collector –to-emitter junction to short (this is called ‘’turning the transistor ON’’)

Applying a negative voltage or 0V from the base to the emitter causes the collector –to-emitter

junction to open (this is called turning the transistor OFF’’).

2. In a PNP transistor, applying a negative voltage from the base to emitter turns it ON.

Applying a positive voltage or 0v from base to emitter turns it OFF.

2.3.7 IC Linear Voltages Regulator

Inn electronics , a linear regulator is a voltage regulator based on an active device (such as a

bipolar junction transistor ,field effect transistor or vacuum tubes)operating in its linear region

‘’(in contrast , a switching regulator is based on transistor forced to act n on/off switch)or

passive device like zener diode operated in their breakdown region .the resulting device is made

to act like a variable resistor, continuously adjusting a voltage network to maintain a constant

25

Page 26: automatic visitor counter and light switching

output voltage .it is very inefficient compared to a switched mode power supply since it sheds

the difference voltage by dissipating heat

The transistor (or other devices) is used as one half of a potential divider to control the output

voltage and a feedback circuit compares the output voltage to a reference voltage in other to

adjust the input to the transistor, thus keeping the output voltage reasonably constant, this is

inefficient: since the transistor is acting like a resistor, it will waste electrical energy by

converting it to heat. In fact the power loss due to heating in the transistor is the current times the

voltage dropped across the transistor .the same function can be performed more effectively by a

switched mode power supply (SMPS), but it is more complex and the switching current in it

tends to produce electromagnetic interference .An SMPS can easily provide more than 30A of

current at voltages as low as 3v, while for the same voltage and current, a linear regulator would

be very bulky and heavy.

Linear regulators exist in two basic forms; Series regulators and Shunt regulators

Series regulator are the more common form .the series regulator works by providing a path from

the supply voltage to the load through a variable resistance (the main transistor is in the “top

half” of the voltage divider).The power dissipated by the regulating device is equal to the power

supply output current times the voltage drop in the regulating device.

The shunt regulator works by providing a path from the supply voltage to the ground through a

variable resistance (the main transistor is the’ ’bottom half’ of the voltage divider).The current

through the shunt regulator is diverted away from the load and flows uselessly to the

ground ,making this form even less efficient than the series regulator .it is ,however ,simpler

sometimes consisting of just a voltage-reference diode , and it is used in very low-powered

26

Page 27: automatic visitor counter and light switching

circuits were the wasted current is too small to be of concern .This form is very common for

voltage reference circuit.

All linear regulators require an input voltage at least some minimum amount higher than the

desired output voltage. That minimum amount is called the drop out voltage .for example; a

common regulator such as the 7805 has an output voltage of 5v, but can only maintain this if the

output voltage remains above about 7v, before the output voltage begins sagging below the rated

output. Its dropout voltage is therefore 7v-5v =2v .When the supply voltage is less than about 2v

above the desired output voltage ,as the case in low voltage microprocessor power supplies ,so

called low dropout regulators must be used .

2.3.8 555 Timer

The 555 timer is a semiconductor integrated circuit containing two blocks of buffers with three-

state non inverted output and common output controlling inputs for all four discrete circuits. The

555 timer is for general purpose use for example in industrial and consumer equipment.

The features of 555 timer are:

Low input load factor(PNP inputs)

Hysteresis provided(=400mv.typical)

High breakdown input voltage (ViO ≥15v)

Output controlled inputs having same phase for two circuits

High fan-out ,three-state output(Iol = 24mA ,IoH =-15mA)

Wide operating temperature range(Ta = -20∼+75)

27

Page 28: automatic visitor counter and light switching

The use of PNP transistors in the input circuit has enabled the achievement of all input load

factors .with hysteresis characteristics; it has a three state non inverted output with the high noise

margin.

When output control OC is low the output Y is low if input A is low and Y is high if A is

high .when OC is high all of Y1, Y2, Y3, and Y4 are in the high-impedance state, irrespective of

the status of A. By connecting 1OC with 2OC, it becomes possible to control the output of all 8

circuits simultaneously. Output can be terminated by a load resistor of 132Ω or over.

CHAPTER THREE.

3.0 THE SYSTEM DESIGN, ANALYSIS AND METHODOLOGY

3.1 METHODOLOGY

Systems Analysis is the process of investigation of a system’s operation with a view to changing

it to new requirements or improving its current working.

A block diagram of the envisaged circuit was achieved by the use of a methodological approach

known as “TOP DOWN approach “of the development process of microcontroller-based

systems. This phase constitutes an essential step of the development process and one of the

critical issues that determines the quality of the final product. The analysis phase sets the stage

for the whole project. The necessary groundwork for understanding what the project is all about

is completed in this phase. We take the strong position that the more effort you put into planning,

the smoother the rest of the project will go and the better the quality will be of your final product.

The total design and development of any microcontroller based system typically involves three.

Phases. They are as follows

28

Page 29: automatic visitor counter and light switching

i. Hardware design and development

ii. Software design and development

iii. Prototype implementation and diagnostic testing

Details of the procedure working principles of the various stages are briefly described. The

hardware part consist of the biscuit details, design and calculation of various components used in

the work including the values of the ones assumed too. While the software part is mainly the

programming implementation on the PIC. Summary details are contained in the flowchart block

diagram as show below in all, a total of twelve (12)geometrical block shapes were assembled

together to achieve the complete design.

3.2 ANALYSIS OF EXISTING SYSTEM

The existing system makes use of manual controllers, like switches, manual changeovers. This

system can only work as ON/OFF and cannot accertain the number of people in a particular

room

3.2.1 Information Gathering

A lot of research work consultations were carried out before and during this project. The research

work consultations include LINKSOFT COMMUNICATION SYSTEMS AWKA, past projects

of higher institution of learning in the country, journals, textbooks on electronics and

telecommunication and research papers gathered from the libraries and internet as well as

convesations with my project supervisor.

3.2.2 Data Analysis

As mentioned ealier, all collected data were used to verify whether the goal has been achieved

and if not, the kind of corrective actions to introduce for the system development.

29

Page 30: automatic visitor counter and light switching

3.2.3 Limitations of Existing System

Energy conservation and safety like prevention of fireoutbreaks from electronical appliances, in

this case where there is no automation of there are so many chances of having our electrical

apliances like the water heater, this can be very disastous, thereby causing fire outbreaks and

energy waste.

The circuit breakers rearly saves fire outbreaks

The existing system doesnot have counter, which can lead to so many security loopholes and

determination of the number of people in a room would be impossible.

3.3 DESCRIPTION OF THE SYSTEM’S BLOCK DIAGRAM

The microcontroller based automatic room light controller with digital counter is designed with

the aid of a block diagram which serves as a guideline for the development of system’s circuit

schematic diagram.

Basic Block Diagram

Enter Exit

30

Signal Conditioning

Relay Driver

Light

8

0

5

1Signal Conditioning

Power Supply

Exit Sensor

Entry Sensor

Page 31: automatic visitor counter and light switching

Fig. 2.1 Basic Block Diagram

Transmission Circuit:-

.

Fig. 3.1 Transmitter circuit

31

Page 32: automatic visitor counter and light switching

Fig. 3.2 Receiver circuit

32

Page 33: automatic visitor counter and light switching

3.4 CIRCUIT DESCRIPTION

There are two main parts of the circuits.

1. Transmission Circuits (Infrared LEDs)

2. Receiver Circuit (Sensors)

1. Transmission Circuit:

Fig. 3.3 Transmitter circuit

This circuit diagram shows how a 555 timer IC is configured to function as a basic monostable

multivibrator. A monostable multivibrator is a timing circuit that changes state once triggered,

but returns to its original state after a certain time delay. It got its name from the fact that only

one of its output states is stable. It is also known as a 'one-shot'.

33

Page 34: automatic visitor counter and light switching

In this circuit, a negative pulse applied at pin 2 triggers an internal flip-flop that turns off pin 7's

discharge transistor, allowing C1 to charge up through

R1. At the same time, the flip-flop brings the output (pin 3) level to 'high'. When capacitor C1 as

charged up to about 2/3 Vcc, the flip-flop is triggered once again, this time making the pin 3

output 'low' and turning on pin 7's discharge transistor, which discharges C1 to ground. This

circuit, in effect, produces a pulse at pin 3 whose width t is just the product of R1 and C1, i.e.,

t=R1C1.

IR Transmission circuit is used to generate the modulated 36 kHz IR signal. The IC555 in the

transmitter side is to generate 36 kHz square wave. Adjust the preset in the transmitter to get a 38

kHz signal at the o/p. around 1.4K we get a 38 kHz signal. Then you point it over the sensor and

its o/p will go low when it senses the IR signal of 38 kHz.

2. Receiver Circuit

Fig. 3.4 Receiver circuit

34

Page 35: automatic visitor counter and light switching

The IR transmitter will emit modulated 38 kHz IR signal and at the receiver we use TSOP1738

(Infrared Sensor). The output goes high when the there is an interruption and it return back to

low after the time period determined by the capacitor and resistor in the circuit. I.e. around 1

second. CL100 is to trigger the IC555 which is configured as monostable multivibrator. Input is

given to the Port 1 of the microcontroller. Port 0 is used for the 7-Segment display purpose. Port

2 is used for the Relay Turn On and Turn off Purpose. LTS 542 (Common Anode) is used for 7-

Segment display. And that time Relay will get Voltage and triggered so light will get voltage and

it will turn on. And when counter will be 00 that time Relay will be turned off. Reset button will

reset the microcontroller

3.5 HARDWARE DESIGN & DESCRIPTIONS

Hardware Design

Seven segment display

Infrared

8051 IC socket 555 Timer Relay

Fig 3.5: Hardware representation

35

Page 36: automatic visitor counter and light switching

Fig 3.6 SIMULATED CIRCUIT DIAGRAM

3.5.1 Procedure Followed While Designing:

The system circuit was designed with DIPTRACE software. Dip trace is a circuit

designing software. After completion of the designing the circuit layer was prepared.

The microcontroller was programmed using TOPVIEW SIMULATOR software using

hex file.

Then soldering process was done. After completion of the soldering process the circuit

was tested.

Still the desired output was not obtained and so troubleshooting was done. In the process

of troubleshooting it was noticed that the circuit aptly soldered and connected and hence

came to conclusion that there was error in programming section which was later rectified and

the desired results were obtained.

36

Page 37: automatic visitor counter and light switching

3.5.2 List of Components:

Following is the list of components that are necessary to build the assembly the project.

Microcontroller – 8051

Power regulator IC – 7805

LM555C(555 Timer)

Sensor – TSOP 1738 (Infrared Sensor)

Resistors

Transformer – 12-0-12, 500 mA

12v Relay

Preset( variable resistor) – 4.7K

Disc/ceramics capacitor – 104,33pF

Rectifier diode – IN4148

Infrared transmitter

Diode

Transistor – BC 547, CL 100

7-Segment Display

3.5.3 Description of Components

Microcontroller 8051:

The 8051 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-

system programmable Flash memory. The device is manufactured using Atmel’s high-density

nonvolatile memory technology and is compatible with the Industry-standard 80C51 instruction

set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or

37

Page 38: automatic visitor counter and light switching

by a conventional nonvolatile memory pro- grammar. By combining a versatile 8-bit CPU with

in-system programmable Flash on a monolithic chip, the Atmel AT8051 is a powerful

microcontroller which provides a highly-flexible and cost-effective solution to many embedded

control applications.

The AT8051 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32

I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level

interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition,

the AT89S52 is designed with static logic for operation down to zero frequency and supports two

software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,

timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode

saves the RAM con- tents but freezes the oscillator, disabling all other chip functions until the

next interrupt or hardware reset.

FEATURES:-

8 KB Reprogrammable flash.

32 Programmable I/O lines.

16 bit Timer/Counter—3.

8 Interrupt sources.

Power range: 4V – 5.5V

Endurance : 1000 Writes / Erase cycles

Fully static operation: 0 Hz to 33 MHz

Three level program memory lock

Power off flag

Full duplex UART serial channel

38

Page 39: automatic visitor counter and light switching

Low power idle and power down modes

Interrupt recovery from power down modes

256 KB internal RAM

Dual data pointer

3.5.4 TSOP1738 (INFRARED SENSOR)

Fig. 3.7 Infrared Sensor

Description:

The TSOP17-Series are miniaturized receivers for infrared remote control systems. PIN

diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter.

The demodulated output signal can directly be decoded by a microprocessor. TSOP17, Is the

standard IR remote control receiver series, supporting all major transmission codes.

39

Page 40: automatic visitor counter and light switching

Features:

Photo detector and preamplifier in one package

Internal filter for PCM frequency

Improved shielding against electrical field disturbance

TTL and CMOS compatibility

Output active low

Low power consumption

High immunity against ambient light

Continuous data transmission possible (up to 2400 bps)

Suitable burst length .10 cycles/burst

Block Diagram:

Fig. 3.8 Block Diagram of TSOP 1738

40

Page 41: automatic visitor counter and light switching

Application Circuit:

Fig. 3.9 Application circuit

3.5.5 555 (TIMER IC):

Fig. 3.10 Timer IC(555)

Description:

The LM555 is a highly stable device for generating accurate time delays or oscillation.

Additional terminals are provided for triggering or resetting if desired. In the time delay mode of

operation, the time is precisely controlled by one external resistor and capacitor. For astable

operation as an oscillator, the free running frequency and duty cycle are accurately controlled

41

Page 42: automatic visitor counter and light switching

with two external resistors and one capacitor. The circuit may be triggered and reset on falling

waveforms, and the output circuit can source or sink up to 200mA or drive TTL circuits.

Features:

Direct replacement for SE555/NE555

Timing from microseconds through hours

Operates in both astable and monostable modes

Adjustable duty cycle

Output can source or sink 200 mA

Output and supply TTL compatible

Temperature stability better than 0.005% per °C

Normally on and normally off output

Available in 8-pin MSOP package

Applications:

Precision timing

Pulse generation

Sequential timing

Time delay generation

Pulse width modulation

Pulse position modulation

Linear ramp generator

42

Page 43: automatic visitor counter and light switching

3.5.6 LTS 542 (7-Segment Display)

Description:

The LTS 542 is a 0.52 inch digit height single digit seven-segment display. This device utilizes

Hi-eff. Red LED chips, which are made from GaAsP on GaP substrate, and has a red face and

red segment.

Fig. 3.11 7 Segment Display

Features:

Common Anode

0.52 Inch Digit Height

Continuous Uniform Segments

Low power Requirement

Excellent Characters Appearance

High Brightness & High Contrast

Wide Viewing Angle

43

Page 44: automatic visitor counter and light switching

3.5.7 LM7805 (Voltage Regulator)

Fig. 3.12 Voltage Regulator

Description:

The KA78XX/KA78XXA series of three-terminal positive regulator are available in the TO-

220/D-PAK package and with several fixed output voltages, making them useful in a wide range

of applications. Each type employs internal current limiting, thermal shut down and safe

operating area protection, making it essentially indestructible. If adequate heat sinking is

provided, they can deliver over 1A output current. Although designed primarily as fixed voltage

regulators, these devices can be used with external components to obtain adjustable voltages and

currents.

Features:

Output Current up to 1A

Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V

Thermal Overload Protection

Short Circuit Protection

Output Transistor Safe Operating Area Protection

44

Page 45: automatic visitor counter and light switching

3.5.8 RELAY CIRCUIT :

Fig 3.13 Relay Circuit

A single pole dabble throw (SPDT) relay is connected to port RB1 of the microcontroller

through a driver transistor. The relay requires 12 volts at a current of around 100ma, which

cannot provide by the microcontroller. So the driver transistor is added. The relay is used to

operate the external solenoid forming part of a locking device or for operating any other

electrical devices. Normally the relay remains off. As soon as pin of the microcontroller goes

high, the relay operates. When the relay operates and releases. Diode D2 is the standard diode on

a mechanical relay to prevent back EMF from damaging Q3 when the relay releases. LED L2

indicates relay on.

45

Page 46: automatic visitor counter and light switching

3.6 DESIGN CALCULATIONS

Analysis and Design of the power Supply Unit

D1 – D4 IN4001 Silicon Diode

To calculate the value of the filter capacitor, we apply the equation:

CF = 1

2√2× Fr × Kr × RL…………………………………….… (1)

Fr = Frequency of the ripples = 100Hz (50 + 50)

RL = Minimum Load resistance for the output

Kr = R . M . S Dc VoltageDc Output Voltage

…………………………….… (2)

R.M.S Dc Voltage ≡ R.M.S Dc Current

500mV ≡ 500mA

(12 – 2 = 10 for proper percentage of regulation)

Kr = 500× 103

10

= 50×10−3

CF = 1

2 √ 2×100 ×50 ×10−3× 200

CF= 3500µF

*Available market value = 3300µF 25V

46

Page 47: automatic visitor counter and light switching

3.6.1 Analysis and Design of Seven Segment Display

The design display interface is a seven segment display (SSP) the calculation is obtained as

follows:

For SSP RS=Rq to R4

RS =VSIS

VS=VCC-VF

IS=IF

VCC = 5V, VF = 1.5V and IF = 15MA

RS = 5−1.5

15 X 1000

RS =3.5

15 X 1000

RS = 233Ω nearest 1s = 220Ω

3.6.2 The Sensor Calculation

R1 =VCC−VF

IF

VCC = 15V

VF = 2V

IF = 20MA

R1 =5−2

20 X 1000

47

Page 48: automatic visitor counter and light switching

3.6 PROCESS FLOW CHART

R = 30020

= 150Ω

Fig 3.14 Process Flow chart

48

Turn Off Light

Turn On Light

Relay Turn OffCounter set to 0

Counter Decremented

Counter Incremented

Turn On Relay Interrupted from Sensor 2Interrupted from Sensor1

Infrared Signal

Start

Page 49: automatic visitor counter and light switching

3.7 PRINCIPLE OF OPERATION

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 relay, if it is first time interrupted.

If the sensor 2 is interrupted first then the microcontroller will look for the sensor

1. And if it is interrupted then the microcontroller will decrement the count.

When the last person leaves the room then counter goes to 0 and that time the

relay will turn off. And light will be turn off.

49

Page 50: automatic visitor counter and light switching

CHAPTER FOUR

SYSTEM IMPLEMENTATION AND TESTING

4.0 INTRODUCTION

This chapter discusses the design implementation of the system which is the hardware

structure which comprises the infrared receiver, microcontroller and the electromechanical relay

circuit.

4.1 SOFTWARE DEVELOPMENT

The software structure is using the assembly language where a set of program based on

security system is assembled using ASEM 51 assembler. The ASEM 51 assembler takes an

assemble language source file created with a text editor and translate it into a machine language

object file. This translation process is done in two passes over the source file.

During the first pass, the assembler builds a symbolic table and labels that is used in the

source file while in the second pass, the assembler translate the source file into machine language

object file.

4.2 TESTING

Testing is a vital process in the development and realization of any design, be it hardware based,

software based or both. The various components and their circuitry have to be tested to ensure that

all the components on board are certified okay and in good working condition. The components

that did not give the required output specification where isolated and troubleshoot to determine the

nature and cause of the component failure through careful analysis, that is examination of the

working principles of the component(s).

50

Page 51: automatic visitor counter and light switching

4.3 EXPECTED TEST RESULTS

The design of the microcontroller based automatic room light controller with bidirectional

counter is meant to be a system that is used to take the number of people in a particular room on

entrance and exist, so that when there is no one in the room the lights, fans and gadgets are turned

off automatically. With this system the user do not need to press any button, once he/she enters the

room, the room the light turns on. To effectively carry out an intensive test, it is a good practice to

run or retest the project as many times as possible to make sure that the desired design

specification is met. The result that is expected is for the system, when the infrared rays is

blocked, the infrared sensor sends signals which will activate the relay and power the lights. The

expected test results were obtained as the infrared transmitter (entrance) communicated

successfully with the receiver on the receiver (exit) section of the control system.

The signal received was then able to activate the relay and control the lighting point successfully.

4.4 PERFORMANCE EVALUATION

The performance of the automatic room light controller with bidirectional counting system proved

satisfactory and is working according to expectations.

4.5 PROBLEMS ENCOUNTERED

In the course of the design and implementation of this project, some problems were encountered.

They are -

Low finance during Implementation.

Difficulty when writing programs, debugging and interfacing

51

Page 52: automatic visitor counter and light switching

Component Failures

Short Circuitry

Inadequate and epileptic power supply.

I had issues with better or correct result, which I desired. And also the software problem.

I also had some soldering issues which were resolved using continuity checks performed

on the hardware.

I had issues with better or correct result, which we desired. And also the software problem.

I also had some soldering issues which were resolved using continuity checks performed

on the hardware.

I started testing the circuit from the power supply. There we got over first trouble. After

getting 9V from the transformer it was not converted to 5V and the circuit received 9V.

As the solder was shorted IC 7805 got burnt. So we replaced the IC7805.also the circuit

part around the IC7805 were completely damaged. With the help of the solder we made the

necessary paths.

Construction of the circuit like this needs patient and diligence. The act of soldering must be

mastered and judiciously applied. It requires absolute concentration. Little mistake could

jeopardize the operation of the circuit. And it is usually difficult when one does not have

troubleshooting skills. It is refreshing as well as tedious. The connection of wires interwoven to

each other sometimes can cause discouragement, to say the least.

52

Page 53: automatic visitor counter and light switching

4.6 PACKAGING

During the packaging of the system, the size of the case was determined after the consideration

of the under mentioned factors:

The size of the circuit board (the control circuit

The space for envisaging modification and easy accessibility to the circuit board or

maintenance if the situation calls for such.

Consequently, the following materials were considered for packaging of the system which

includes:

Plastic packaging

Laminated plywood packaging

Packaging with metal sheet

For this project, the packaging was done using plastic packaging because of its durability,

portability, availability and adjustability. With the metal pack, the positioning and screwing for

various control knobs were very easy

53

Page 54: automatic visitor counter and light switching

4.7 BILL OF QUANTITY

BILL OF QUANTITYThe table below shows the list of components purchased and their various price per unit and quantity purchased:

S/N Component (N) Unit Quantity (N) Price

1 Resistors 10 15 150

2 Capacitors 30 4 120

3 Transistor 300 1 300

4 Quartz Crystal 100 1 100

5 Power Diodes 20 5 100

6 Light Emitting Diodes (LED) IR 20 3 60

7 7-Segment Display 150 3 450

8 Infrared Sensor 200 1 200

9 Crystal oscillator 100 1 100

10 555 Timer IC 200 1 200

11 Relay 1000

12 7805 IC 50 1 50

13 BC 327 Transistor 40 3 120

14 D438 Transistor 60 1 60

15 Soldering Lead 40 10yrds 400

16 Connecting Wire 20 20yrds 400

17 Vero Board (Big Size) 100 1 100

18 Reset Switch 50 1 50

19 Casing 1000 1 1000

20 Micro controller 8051 1000 1 1000

20 Miscellanies 10,000 10,000

Grand Total 13,490 67 15,960

54

Page 55: automatic visitor counter and light switching

CHAPTER FIVE

5.0 SUMMARY AND CONCLUSION

5.1 SUMMARY

For a project to be executed, one has to reason out what the design is and how the design can be

carried out and also be able to implement the design in order to achieve the aims and objectives of

the project.

In the design and implementation of this project, the 89C51 microcontroller is programmed to

coordinate the whole function of the design from the entrance when the infrared light is blocked,

the processing and sending of signals to the exit sensor from where this signals are processed

appropriately and transferred to the relay which are connected to outputs inform of our domestic

appliances, lighting points, etc. This project is designed primary to automatically switch on/off

lights once there is someone in the room and off when the counter counts zero, i.e no one is in the

room, but it could also be tailored so as to be able to control our domestic appliances using a

central controller.

5.2 CONCLUSION

The automated state of the system gives the product certain flexibility and the potential to be

integrated with some of the other household systems into a universal household and industrial

appliance. Eventually, one simple system like this has the capability to control air conditioners,

televisions, CCTV, lighten system, sockets, washing machine, and other home appliances. This

design began the framework for a more complex and more functional product. The concept of

an automatic room light controller and bidirectional counter can be built upon not just for

55

Page 56: automatic visitor counter and light switching

household usage but for such settings as hotels, schools, hospitals, industrial purpose or

businesses.

Eventually this designed product can be built using less expensive components thus making it an

affordable alternative for consumers. It is a simple upgrade to an existing standard product and it

has endless expansion possibilities.

In conclusion, this project is a design which should be encouraged and put into large scale

manufacturing because of its various advantages.

5.3 RECOMMENDATIONS FOR FURTHER IMPROVEMENT

This project is a viable one in the sense that it will go a long way in making it more convenient

easier for users to easily control their appliances, lighting points and even sockets automatically in

their homes, hotel, conference rooms, and classrooms. Because of its importance as a household

need, efforts must be geared towards designing a viable project like this one. I strongly

recommend that the department should see this project as a priceless possession and should

endeavor to provide financial assistance and more research works relating to this project to support

and encourage students embarking on this type of project so as to be used to be used not only in

homes but also in offices, schools etc.

5.4 SUGGESTED FUTURE WORK

With the level of advancement of design and technology, it is suggested that future works can be

voice activated. This can reduce the convenience of having a control point closely related to the

user.

56

Page 57: automatic visitor counter and light switching

• By using this circuit and proper power supply we can implement various applications Such

as fans, tube lights, Air conditioners etc.

• By modifying this circuit and using two relays we can achieve a task of opening and

closing the door examples like bank doors.

57

Page 58: automatic visitor counter and light switching

REFRENCES

Collins, J.; Pymm, P, “Replacement of the station data logger at Hunterston B nuclear power

station”,‘Retrofit and Upgrading of Computer Equipment in Nuclear

Engel berg, S.; Kaminsky, T.; Horesh, M.; “Instrumentation notes - A USB-Enabled, FLASH-

Disk-Based DAS”Vol. 10, Issue 2, (April 2007) Page(s):63 – 66. , Instrumentation &

Measurement Magazine, IEEE,

Erdem, H, “Design and implementation of data acquisition for fuzzy logic controller” ‘Industrial

Technology, (2002). IEEE ICIT ('02. 2002) IEEE International Conference’ on (11-14

Dec. 2002) Page(s):199 – 204 vol.1.

Kuchta, R.; Stefan, P.; Barton, Z.; Vrba, R.; Sveda, M, “Wireless temperature data logger”,

‘Sensors and the International Conference on new Techniques in Pharmaceutical and

Biomedical Research, (2005) Asian Conference’on 5-7 (Sept. 2005) Page(s):208 – 212.

Lee Tat Man, “Recording power demand characteristics and harmonic pollution by a general-

purpose data logger”, ‘Advances in Power System Control, Operation and Management,

1991. APSCOM-91., (1991) International Conference’ on 5-8 (Nov 1991) Page(s):737 -

743 vol.2.

Luharuka, E.; GAO, R.X., “A microcontroller-based data acquisition for physiological sensing”,

‘Instrumentation and Measurement Technology Conference, (2002.) IMTC/2002.

Proceedings of the 19th IEEE’, 21-23 May 2002 Page(s):175 - 180 vol.1

Power Stations, IEE Colloquium’ on (11 Mar 1991) Page(s):11 - 15.

WEBSITES

www.atmel.com

www.seimens.com

58

Page 59: automatic visitor counter and light switching

www.philipsemiconductors.com

www.howstuffworks.com

www.alldatasheets.com

www.efyprojects.com

www.thomson.com/learning

59