Professional Documents
Culture Documents
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
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
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 cant 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
The sensors must be active to count whenever an obstruction of the Infrared light is
blocked
The receiver and the transmitting sections, i.e. the entrance and exit must be in
synchronization for perfect counting.
1.4
The audience reading this document will have a familiarity with engineering terms
All measurements for frequency, voltage and temperature will be in the standard scale
LIMITATIONS OF THE PROJECT
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.
1.5
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
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.
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.
CHAPTER TWO
2.0
LITERATURE REVIEW
2.1
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
automatic room light controller with digital counter contains a SensorTSOP 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.
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.
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
INTERNAL MEMORY
Device
Program
Data
Timers/event counters
Interrupt sources
8051
4K x 8 ROM
128 x 8 RAM
2 x 16-bit
8751 H
4K x 8 EPROM
128 x 8 RAM
2 x 16-bit
8031
None
128x8 RAM
2 x 16-bit
8052AH
8Kx8ROM
256 x 8 RAM
3 xi e-bit
8752BH
8K x 8 EPROM
256 x 8 RAM
3 x 16-bit
256 x 8 RAM
3 x 16-bit
Number
8D32AH None
10
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
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
11
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
memorymapped 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.
12
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
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)
13
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.
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
1
1
=
R
R1
1
+
R2
1
Rn ...
(5)
R1
14
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
15
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. Its 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)
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.
16
C3
Figure 2.5 Capacitors Connected In Parallel
C1
C2
If more than two capacitors are connected in series, then the following formular can be for
numbers of capacitors connected in series.
1
C= C1
1
1
+
C2
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.
17
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.
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 .
18
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 bandgap 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
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.
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 .
19
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 transformers 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
load .in an ideal transformer, the induced voltage in the secondary winding (V s) 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 N p or stepped down by making Ns less
20
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
21
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
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.
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.
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
22
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
The bipolar transistor is the commonly used switch in digital electronic circuits .It is a threeterminal 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
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
collector to-emitter junction to short (this is called turning the transistor ON)
23
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
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
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.
24
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 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 threestate 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.
25
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
3.1
METHODOLOGY
Systems Analysis is the process of investigation of a systems 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
26
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
i.
ii.
iii.
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
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
27
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.
3.2.3
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.
Signal Conditioning
Relay Driver
Signal Conditioning
Light
Exit
5
2
28
7-Segment Display
Transmission Circuit:-
29
.
Fig. 3.1 Transmitter circuit
30
3.4
CIRCUIT DESCRIPTION
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'.
31
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
32
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 7Segment 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
555 Timer
Relay
33
34
3.5.3
Description of Components
Microcontroller 8051:
The 8051 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of insystem programmable Flash memory. The device is manufactured using Atmels high-density
nonvolatile memory technology and is compatible with the Industry-standard 80C51 instruction
35
set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or
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/Counter3.
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
36
3.5.4
Features:
Block Diagram:
Application Circuit:
38
3.5.5
Applications:
3.5.6
Precision timing
Pulse generation
Sequential timing
Time delay generation
Pulse width modulation
Pulse position modulation
Linear ramp generator
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.
3.5.7
Common Anode
0.52 Inch Digit Height
Continuous Uniform Segments
Low power Requirement
Excellent Characters Appearance
High Brightness & High Contrast
Wide Viewing Angle
Output Current up to 1A
41
3.5.8
RELAY CIRCUIT:
42
3.6
DESIGN CALCULATIONS
1
2 2 Fr Kr RL
. (1)
R . M . S Dc Voltage
Dc Output Voltage
. (2)
500 10
10
3
= 50 10
CF =
1
2 2 100 50 103 200
43
CF= 3500F
*Available market value = 3300F 25V
51.5
15 X 1000
RS =
3.5
15 X 1000
44
R1
VCC VF
IF
VCC = 15V
VF
= 2V
IF
= 20MA
R1
52
= 20 X 1000
R=
300
20
= 150
Turn On Light
3.6
Relay Turn O
Counter
Decremented
Counter
set to
0
Counter Increment
45
46
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.
47
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).
48
4.3
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
49
Component Failures
Short Circuitry
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.
50
4.6
PACKAGING
During the packaging of the system, the size of the case was determined after the consideration
of the under mentioned factors:
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
4.7
BILL OF QUANTITY
51
BILL OF QUANTITY
The table below shows the list of components purchased and their various price per
unit and quantity purchased:
S/N
1
2
3
4
5
6
7
8
9
10
11
12
Component
Resistors
Capacitors
Transistor
Quartz Crystal
Power Diodes
Light Emitting Diodes (LED) IR
7-Segment Display
Infrared Sensor
Crystal oscillator
555 Timer IC
Relay
7805 IC
(N) Unit
10
30
300
100
20
20
150
200
100
200
1000
50
13
BC 327 Transistor
14
Quantity
(N) Price
15
4
1
1
5
3
3
1
1
1
150
120
300
100
100
60
450
200
100
200
50
40
120
D438 Transistor
60
60
15
Soldering Lead
40
10yrds
400
16
17
18
19
20
20
Connecting Wire
Vero Board (Big Size)
Reset Switch
Casing
Micro controller 8051
Miscellanies
Grand Total
20
100
50
1000
1000
10,000
13,490
20yrds
1
1
1
1
400
100
50
1000
1000
10,000
15,960
67
CHAPTER FIVE
5.0
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.
52
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 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.
53
5.3
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
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.
By using this circuit and proper power supply we can implement various applications Such
By modifying this circuit and using two relays we can achieve a task of opening and
54
55
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, FLASHDisk-Based DASVol. 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 Conferenceon 5-7 (Sept. 2005) Page(s):208 212.
Lee Tat Man, Recording power demand characteristics and harmonic pollution by a generalpurpose 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
56
www.philipsemiconductors.com
www.howstuffworks.com
www.alldatasheets.com
www.efyprojects.com
www.thomson.com/learning
57