CAPSTONE PROJECT WORK REPORT
(Project Term Aug-Dec, 2014)
Automatic Control of Electrical Appliances
Shubham Sachan Registration Number: 11104846
B. Gopal Reddy Registration Number: 11106503
Amit Sharma Registration Number: 11108860
Saurabh Patel Registration Number: 11103372
Course Code: ELE 500
Under the Guidance of
(Mr. Sanjeev Kumar Bhalla)
School of Electrical and Electronics Engineering
We hereby declare that the project work entitled “Automatic Control of Electrical Appliances” is
an authentic record of our own work carried out as requirements of Capstone Project for the award
of B.Tech degree in Electrical and Electronics Engineering from Lovely Professional University,
Phagwara, under the guidance of (Mr. Sanjeev Kumar Bhalla), during August to December 2014.
All the information furnished in this capstone project report is based on our own intensive work
and is genuine.
Project Group Number:
Name of Student 1: Shubham Sachan
Registration Number: 11104846
Name of Student 2: B.Gopal Reddy
Registration Number: 11106503
Name of Student 3: Amit Sharma
Registration Number: 11108860
Name of Student 4: Saurabh Patel
Registration Number: 11103372
Signature of Student 1
Signature of Student 2
Signature of Student 3
Signature of Student 4
This is to certify that the declaration statement made by this group of students is correct to the best
of my knowledge and belief. They have completed this Capstone Project under my guidance and
supervision. The present work is the result of their original investigation, effort and study. No part
of the work has ever been submitted for any other degree at any University. The Capstone Project
is fit for the submission and partial fulfillment of the conditions for the award of B.Tech degree in
Electrical and Electronics Engineering from Lovely Professional University, Phagwara.
Signature and Name of the Mentor
School of Computer Science and Engineering,
Lovely Professional University,
First and foremost, we are deeply indebted to our mentor Mr. Sanjeev Kumar Bhalla who
inspiration has been unfailingly available to us at all stages of our project. This has fueled our
enthusiasm even further and encouraged us to boldly step into what was a totally dark and
unexplored expanse before for us.
We would like to thank for our teachers for his efforts, who was always ready with a positive
comment, whether it was an off-hand comment to encourage us or constructive piece of criticism.
In course of present work it has been our privilege to receive help and assistance of my friends. I
take great pleasure in acknowledge my debt to them.
At last but not the least I want to thank my friends who appreciated us for our work and motivate
us and finally to God who made all the things possible.
3.1.7) SOLDERING 21
3.1.8) VOLTAGE REGULATOR 23
3.1.9) LAMP HOLDER 24
3.1.10) LAMPS 24
3.1.11) SWITCH 25
3.1.12) LED 26
3.1.13) CRYSTAL OSCILLATOR 26
3.1.14) TRANSFORMER 27
3.1.15) MICROCONTROLLER 28
3.1.16) IR SENSOR 37
3.1.17) LIQUID CRYSTAL DISPLAY 41
RESULT AND CONCLUSION 42
ADVANTAGES AND FUTURE DEVELOPMENT 43
In this project, we controlled room light intensity using microcontroller. We used infrared
transmitter and receiver for this purpose. Infrared sensors are available in the market. In this circuit,
we get signal from the sensor when a person enter or exit the room then there will be the variation
in intensity of the room appliances. We used 89S52 microcontroller for this purpose which is
programmed using assembly language. In this project receiver senses the signal from transmitter
as changing in pulse while entering and leaving persons in the room occurs microcontroller will
increase or decrease the intensity of light in the room. This project is useful in many applications
like Room Lights, Air Conditioner, Controlling of machine etc.
We used two set of IR Sensors, one will count the number of persons entering and other will count
the number of persons leaving.
We used 12 MHz crystal to provide clock pulse to the microcontroller. We also used voltage
regulator and capacitor for filtering the signal.
List of Figures:
Figure-No. Name of Figure Page-No
Fig No 1 Block Diagram of project 03
Fig No 2 Project Flow Chart 04
Fig No 3 Circuit Overview 05
Fig No 4 Circuit Diagram of Project 09
Fig No 5 LCD Interfacing 10
Fig No 6 BJT 13
Fig No 7 Capacitors 14
Fig No 8 Diodes 16
Fig No 9 Relay 17
Fig No 10 Resistances 19
Fig No 11 Soldering Iron 21
Fig No 12 Voltage Regulator 24
Fig No 13 Lamp Holder 24
Fig No 14 Lamps 25
Fig No 15 Switch 25
Fig No 16 LED’s 26
Fig No 17 Crystal Oscillator 26
Fig No 18 Transformer 27
Fig No 19 Microcontroller 29
Fig No 20 Architecture of 8051 32
Fig No 21 Block diagram 89S52 34
Fig No 22 IR Sensor 37
Fig No 23 Types of sensor 40
Fig No 24 LCD Screen 41
LIST OF TABLES:
Table-No. Name of Table Page-No.
Table No 1 COMPONENT USED 12
Electricity can be generated from many sources like Renewable and Non-renewable sources in
India 70% of electricity is generated through coal. After Generation, Transmission & Distribution
process is to be done through this consumer’s electricity and use it for their basic need, but the task
is not over here generated electricity we need to be saved. It is said that “Electricity conserved is
electricity generated”. This was the rationale to select this project.
To save Energy is our main project. The basic purpose of this project is to regulate the wastage of
room light as well as electricity. In this project we have controlled ‘Room light intensity’ by the
use of microcontroller, Infrared transmitter and receiver. Infrared sensors that, we will be using
are easily available in the market. In this circuit input signal will be generated from the sensors in
accordance with the logic that, the number of persons entering in the room will increase intensity.
We will be using AT89S52 microcontroller for this purpose. Moreover we will program
microcontroller with assembly language i.e. the programming has been done in assembly language.
In this project we have sensed the signal from infrared sensor then according to increasing number
of persons in the room microcontroller will increase the intensity of the room. In the real life
scenario, this project will help in controlling many applications like Room lights, Fan, Air
conditioner etc. Usually basic things can be controlled by this project because sometimes we forget
to turn off these appliances.
In our project, two set of IR sensors are used. One count the number of persons in increasing order
while other will decrease the number of count.
Our project has been divided into various parts, namely
1) Power supply
3) IR sensors
4) LCD area
5) Relay area
In our project we use 220 volt of AC supply, this 220V has been step down to 12V which is further
converted into 5 volts DC with the help of voltage regulator, as microcontroller also works on 5
Volt of DC. An LCD is also used for display the counter. The IR sensors are used at the input side
for automatic enter and exit purpose. Relays are used at the output side. When a person will enters
then one relay will be on and when it will be exit then that relay will be off. The relay works on
+12 volt DC. There are different types of relays like, SPDT, DPDT, DPST, SPST etc.
The main challenge we face in this project is that when any one stand in front of the sensor, then
the counter continuously increased, to overcome this problem, we decided to modify the sensor in
such a manner as it will sense or count 1 until it reach to the high pulse again.
This project is based for entry of five person first and for next five the next bulb glow we can
increase the counter from five to 10 or 20 it’s depending on requirement as the no. of persons
increases and depend on this lights will glow. Same logic has been applied for exit also and light
1.2 BLOCK DIAGRAM:
Fig(i): Block Diagram of project
1.4 CIRCUIT OVERVIEW:
Fig (iii): Overview of project
Fig(iv): Fully Operated project
Fig(v): When 1 person enter into the room
Fig(vi): When counter reaches to ‘5’
Fig(vii): When counter reaches to ‘10’
Fig(viii): When counter reaches to ‘15’
2.1PROCREDURE TO MAKE PROJECT:
A) IDEA OF PROJECT:
At this stage we select the topic of the project. It’s the main stage of project work. It’s the area
where students shows their innovative ideas. We selected this project because we want to do
something in with our own hands. We use main electronics components used in the industry. First
of all we selected the LDR based project. Then we drop idea because it is light dependent and as
the light will on due to this light LDR will operate and our main moto will fail here.
B) STUDY MATERIAL AND CIRCUIT DIAGRAM:
In this section we collected the study material. We searches about our project on google.com,
www.yahoo.com and www.youtube.com. As we find many circuits and theory materials for our
project. We were not sure about the circuits so we first decide to design our circuit step by step on
C) TESTING OF MAIN CIRCUIT:
Then we collected the components of project. It was not an easy task. Because no shop in our area
have all the components. Then after collection of components we test the circuit on bread board
step by step. Because we want to sure about the circuit. We checked it in different steps because it
was a big project and was not possible to check it in a single step.
D) PCB DESIGNING:
After Testing and finishing the circuit. First of all we designed the layout on PCB, and we assemble
our circuit. There are various process for PCB designing. They are described below:
After mounting components we solder the components one by one. And carefully we soldered the
equipment as they did not joint with each other.
F) FINAL TESING:
Final testing, we did it in my hostel as, we place entry sensor in my room and with the output wire
of this circuit, we connect the CFL of my room as the first person enter then CFL will glow, some
of my friend make it’s fun as its magic this was most interesting part of our project.
Then we tried to troubleshoot the errors in the project. As the most defaulting and complicated part
is when any one is standing between the sensor for long time the counter will increases
continuously it take lots of time to resolve. Then with the help of internet those who made this
project previously we contact them and ask to them as how they resolve this problem then one of
them will tell me until and unless the pulse will not get again high it will not count it 1. So we
implement it and finally “Eureka” we did it and we remove this problem.
2.2 CIRCUIT DIAGRAM:
Fig(ix): Circuit Diagram of project
Fig(x): LCD interfacing with microcontroller
2.3 STEPS TO FABRICATE:
1) We are using a PCB design for our project.
2) In our project we can make a +5volt supply for microcontroller.
3) For power supply to the circuit we have used a 12-0-12 V step down transformer.
4) Then we have used a rectifier circuit for make a DC circuit.
5) We have used a filtering circuit by using electrolyte capacitor.
6) We have used a voltage regulator.
7) For output we have used bulb.
8) We have used a 40 pin IC base for microcontroller.
9) We are using a crystal oscillator for oscillations.
10) We have used a reset circuit.
11) We have used a variable resistance.
12) We have used relay circuits using transistors and resistance at the output side of the
13) We are using SPDT relays which will be work at +12 volt DC.
In this project we used different electrical and electronics component such as
transistors, transformers, resistors, microcontroller, diodes etc.
These components are described below:
3.1 COMPONENT USED:
S.NO. COMPONENT USED QUANTITY
1 TRANSFORMER 12-0-12 1
2 DIODES IN4007 2
3 ELECTROLYTE CAP 3
4 LED 1
5 IR SENSOR PAIR 2
6 RESISTORS 20
7 AT89S52 MICROCONTROLLER 1
8 RELAYS 4
9 TRANSISTORS 8
10 CRYSTAL 1
11 CERAMIC CAP 2
12 WIRES 50m
13 MAIN LEAD 1
14 HOLDER 4
A transistor is semi-conductor device consisting of three regions separated by two P-N junctions.
The three regions are Base, Emitter & Collector.
The base may be of N- type or P- type. The emitter and collector have same impurities but different
from that of base. Thus if base is of N- type then emitter and collector are of P- type then transistor
is called P-N-P transistor and vice versa transistor is called N-P-N transistor.
The base is made thin and number density of majority carriers is always less than emitter and
collector. The base provides junction for proper interaction between emitter and collector.
Electrons are majority charge carriers in N- region and in P-region, holes are the majority charge
carriers. Thus two types of charge carriers are involved in current flow through N-P-N or P-N-P
A) SYMBOLS FOR TRANSISTORS:
In schematic symbols, the emitter is always represented by an arrow indicating the direction of
conventional current in the device. In case of N-P-N transistor arrow points away from base and
in case of P-N-P transistor it points towards base.
When transistor is used in circuit, emitter - base junction is always forward biased while base -
collector junction is always reverse biased.
B) CHARACTERISTICS OF TRANSISTOR:
The two junctions can be biased in four different ways:
Both junctions may be forward biased. It causes large current to flow across junctions.
Transistor is to be operated in “SATURATION REGION”.
Both junctions may be reversed biased. It causes very small current to flow across
junctions. Transistor is to be operated in “CUT OFF REGION”.
E-B junction is forward biased and C-B junction is reverse biased. The transistor is said to
be operated in “ACTIVE REGION”. Most of the transistors work in this region.
E-B junction is reversed biased and C-B junction is forward biased. The transistor is said
to be operated in “INVERTED MODE”.
A capacitor can store charge, and its capacity to store charge is called capacitance. Capacitors
consist of two conducting plates, separated by an insulating material (known as dielectric). The
two plates are joined with two leads. The dielectric could be air, mica, paper, ceramic, polyester,
polystyrene, etc. This dielectric gives name to the capacitor. Like paper capacitor, mica capacitor
3.1.3 TYPE OF CAPACITORS:
Capacitors can be broadly classified in two categories, i.e., Electrolytic capacitors and Non-
Electrolytic capacitors as shown if the figure above.
A) ELECTROLYTIC CAPACITOR:
Electrolytic capacitors have an electrolyte as a dielectric. When such an electrolyte is charged,
chemical changes takes place in the electrolyte. If it’s one plate is charged positively, same plate
must be charged positively in future. We call such capacitors as polarized. Normally we see
electrolytic capacitor as polarized capacitors and the leads are marked with positive or negative on
the can. Non-electrolyte capacitors have dielectric material such as paper, mica or ceramic.
Therefore, depending upon the dielectric, these capacitors are classified.
B) MICA CAPACITOR:
It is sandwich of several thin metal plates separated by thin sheets of mica. Alternate plates are
connected together and leads attached for outside connections. The total assembly is encased in a
plastic capsule or Bakelite case. Such capacitors have small capacitance value (50 to 500pf) and
high working voltage (500V and above). The mica capacitors have excellent characteristics under
stress of temperature variation and high voltage application. These capacitors are now replaced by
C) CERAMIC CAPACITOR:
Such capacitors have disc or hollow tabular shaped dielectric made of ceramic material such as
titanium dioxide and barium titanate. Thin coating of silver compounds is deposited on both sides
of dielectric disc, which acts as capacitor plates. Leads are attached to each sides of the dielectric
disc and whole unit is encapsulated in a moisture proof coating. Disc type capacitors have very
high value up to 0.001uf. Their working voltages range from 3V to 60000V. These capacitors have
very low leakage current. Breakdown voltage is very high.
D) PAPER CAPACITOR:
It consists of thin foils, which are separated by thin paper or waxed paper. The sandwich of foil
and paper is then rolled into a cylindrical shape and enclosed in a paper tube or encased in a plastic
capsules. The lead at each end of the capacitor is internally attached to the metal foil. Paper
capacitors have capacitance ranging from 0.0001uf to 2.0uf and working voltage rating as high as
Diodes are polarized, which means that they must be inserted into the PCB the correct way round.
This is because an electric current will only flow through them in one direction (like air will only
flow one way through a tire valve). Diodes have two connections, an anode and a cathode. The
cathode is always identified by a dot, ring or some other mark.
The PCB is often marked with a +sign for the cathode end. Diodes come in all shapes and sizes.
They are often marked with a type number. Detailed characteristics of a diode can be found by
looking up the type number in a data book. If you know how to measure resistance with a meter
then test some diodes. A good one has low resistance in one direction and high in other. They are
specialized types of diode available such as the zener and light emitting diode (LED).
A relay is an electrically operated switch. The relay contacts can be made to operate in the pre-
arranged fashion. For instance, normally open contacts close and normally closed contacts open.
In electromagnetic relays, the contacts however complex they might be, they have only two
position i.e. OPEN and CLOSED, whereas in case of electromagnetic switches, the contacts can
have multiple positions.
A) NEED OF THE RELAY:
The reason behind using relay for switching loads is to provide complete electrical isolation. The
means that there is no electrical connection between the driving circuits and the driven circuits.
The driving circuit may be low voltage operated low power circuits that control several kilowatts
of power. In our circuit where a high fan could be switched on or off depending upon the output
from the telephone.
Since the relay circuit operated on a low voltage, the controlling circuit is quite safe. In an
electromagnetic relay the armature is pulled by a magnetic force only. There is no electrical
connection between the coil of a relay and the switching contacts of the relay. If there are more
than one contact they all are electrically isolated from each other by mounting them on insulating
plates and washers. Hence they can be wired to control different circuits independently.
B) TYPES OF RELAY:
1. Electromagnetic relay
2. Power Relay
3. Time Delay Relay
4. Latching Relay
5. Crystal Can Relay
6. Co-axial Relay
1. Electromagnetic relay:
An electromagnetic relay in its simplest form consists of a coil, a DC current passing through
which produces a magnetic field. This magnetic field attracts an armature, which in turn operates
the contacts. Normally open contacts close and normally closed contacts open. Electromagnetic
relays are made in a large variety of contacts forms.
2. Power relays:
Power relays are multi-pole heavy duty lapper type relays that are capable of switching resistive
loads of up to 25amp. These relays are widely used for a variety of industrial application like
control of fractional horse power motors, solenoids, heating elements and so on. These relays
usually have button like silver alloy contacts and the contact welding due to heavy in rush current
is avoided by wiping action of the contacts to quench the arc during high voltage DC switching
thus avoiding the contact welding.
3. Time Delay Relay:
A time delay relay is the one in which there is a desired amount of time delay between the
application of the actuating signal and operation of the load switching devices.
4. Latching Relay:
In a Latching Relay, the relay contacts remain in the last energized position even after removal of
signal in the relay control circuit. The contacts are held in the last relay-energized position after
removal of energisation either electrically or magnetically. The contacts can be released to the
normal position electrically or mechanically.
5. Crystal Can Relay:
They are so called, as they resemble quartz crystal in external shapes. These are high performance
hermetically sealed miniature or sub-miniature relay widely used in aerospace and military
application. These relays usually have gold plated contacts and thus have extremely low contact
resistance. Due to low moment of inertia of the armature and also due to statically and dynamically
balanced nature of armature, these relays switch quite reliably even under extreme condition of
shock and vibration.
6. Co-axial Relay:
A Co-axial Relay has two basic parts, an actuator which is nothing but some kind of a coil and a
cavity, housing the relay contacts. The co-axial relay are extensively used for radio frequency
switching operations of equipment.
Resistor is a two-terminal electronic component that produces a voltage across its terminals that is
proportional to the electric current passing through it in accordance with Ohm's law:
Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most
electronic equipment. Practical resistors can be made of various compounds and films, as well as
resistance wire (wire made of a high-resistivity alloy, such as nickel/chrome).
The primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Other characteristics include temperature coefficient, noise, and
inductance. Less well-known is critical resistance, the value below which power dissipation limits
the maximum permitted current flow, and above which the limit is applied voltage. Critical
resistance is determined by the design, materials and dimensions of the resistor.
Resistors can be integrated into hybrid and printed circuits, as well as integrated circuits. Size, and
position of leads (or terminals) are relevant to equipment designers; resistors must be physically
large enough not to overheat when dissipating their power.
A) TYPE OF RESISTANCE:
1. Carbon composition type resistors
2. Wire wound resistors
3. Metalized resistors
4. Variable resistors
1. Carbon composition type resistors:
This is the most common type of low wattage resistor. The resistive material is of carbon-clay
composition and the leads are made of tinned copper. These resistors are cheap and reliable and
stability is high.
2. Wire wound resistors:
These resistors are a length of wire wound an insulating cylindrical core. Usually wires of material
such as constantan (60% copper and 40% nickel) and manganin which have high resistivities and
low temperature coefficients are employed. The completed wire wound resistor is coated with an
insulating material such as baked enamel.
3. Metalized resistors:
It is constructed using film deposition techniques of depositing a thick film of resistive material
onto an insulating substrate. Only approximate values of resistance can be had by this method.
4. Variable resistors:
For circuits requiring a resistance that can be adjusted while it remains connected in the circuit,
variable resistors are required. They usually have 3 lead two fixed and one movable.
The ohm (symbol: Ω) is the SI unit of electrical resistance, named after Georg Simon Ohm.
Commonly used multiples and submultiples in electrical and electronic usage are the milliohm
), kilo ohm (1x103
), and mega ohm (1x106
Soldering is the process of joining two metallic conductors the joint where two metal conductors
are to be joined or fused is heated with a device called soldering iron and then as allow of tin and
lead called solder is applied which melts and converse the joint.
Fig(xvi): Soldering Iron & Flux
Quickly to ensure is good and durable connection between the jointed metal converting the joint
solder also present oxidation.
A) SOLDERING AND DE-SOLDERING TECHNIQUES:
There are basically two soldering techniques:
I. Manual soldering with iron.
II. Mass soldering.
The iron consist of an insulated handle connected via a metal shank to the bit the function of bit is
1. Stare host & convey it to the component.
2. To store and deliver molten solder flux.
3. To remove surplus solder from joints.
Soldering bit are made of copper because it has good heat capacity & thermal conductivity. It may
erode after long term use to avoid it coating of nickel or tin is used.
B) SOLDERING WITH IRON:
The surface to be soldered must be cleaned & fluxed. The soldering iron switched on & bellowed
to attain soldering temperature. The solder in form of wire is allied hear the component to be
soldered & heated with iron. The surface to be soldered is filled, iron is removed & the joint is
cold without disturbing.
Solder joint are supposed to:
1. Provide permanent low resistance path.
2. Make a robust mechanical link between PCB & leads of components.
3. Allow heat flow between component, joining elements & PCB.
4. Retain adequate strength with temperature variation.
5. The following precaution should be taken while soldering.
6. Use always an iron plated copper core tip for soldering iron.
7. Slightly for the tip with a cut file when it is cold.
8. Use a wet sponge to wipe out dirt from the tip before soldering instead of asking the iron.
9. Tighten the tip screw if necessary before iron is connected to power supply.
10. Clean component lead & copper pad before soldering.
11. Use proper tool for component handling instead of direct handling.
12. Apply solder between component leads, PCB pattern & tip of soldering iron.
13. Iron should be kept in contact with the joint s for 2-3 second s only instead of keeping for very
long or very small time.
3.1.8 VOLTAGE REGULATOR:
A regulated power supply is very much essential for several electronic devices due to the
semiconductor material employed in them have a fixed rate of current as well as voltage. The
device may get damaged if there is any deviation from the fixed rate. The AC power supply gets
converted into constant DC by this circuit. By the help of a voltage regulator DC, unregulated
output will be fixed to a constant voltage. The circuit is made up of linear voltage regulator 7805
along with capacitors and resistors with bridge rectifier made up from diodes. From giving an
unchanging voltage supply to building confident that output reaches uninterrupted to the
appliance, the diodes along with capacitors handle elevated efficient signal conveyed.
As we have made the whole circuit till now to be operated on the 5V DC supply, so we have to
use an IC regulator for 5V DC. And the most generally used IC regulators get into the market for
5V DC regulation use is 7805. So we are connecting the similar IC in the circuit as U1.
IC 7805 is a DC regulated IC of 5V. This IC is very flexible and is widely employed in all types
of circuit like a voltage regulator. It is a three terminal device and mainly called input, output and
ground. Pin diagram of the IC 7805 is shown in the diagram below.
Fig(xvii): Voltage Regulator
3.1.9 LAMP HOLDER:
Lamps are usually inserted in lamp holder sockets which provide electrical connections to the lamp
and support it in the lighting fixture. The use of sockets allows lamps to be safely and conveniently
replaced (re-lamping) at the end of life, or to change power, color, lighting technology or etc. There
are many different standards for these lamp holders.
Fig(xviii): Lamp Holder
An incandescent light bulb, incandescent lamp or incandescent light globe is an electric light which
produces light with a wire filament heated to a high temperature by an electric current passing
through it, until it glows.
The hot filament is protected from oxidation with a glass or quartz bulb that is filled with inert gas
or evacuated. In a halogen lamp, filament evaporation is prevented by a chemical process that
redeposit metal vapor onto the filament, extending its life. The light bulb is supplied with electrical
current by feed-through terminals or wires embedded in the glass. Most bulbs are used in a socket
which provides mechanical support and electrical connections.
A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for
controlling some aspect of a machine or process. Buttons are typically made out of hard material,
usually plastic or metal.
We use push button in our project for reset purpose. If the system will hang due to any reason so
with this switch we can reset our system so it can operate normally again.
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a basic pn-
junction diode, which emits light when activated. When a fitting voltage is applied to the
leads, electrons are able to recombine with electron holes within the device, releasing energy in
the form of photons.
3.1.13 CRYSTAL OSCILLATOR:
One of the most important features of any oscillator is its frequency stability, or in other words its
ability to provide a constant frequency output under varying load conditions. Some of the factors
that affect the frequency stability of an oscillator generally include: variations in temperature,
variations in the load as well as changes to its DC power supply voltage to name a few.
Frequency stability of the output signal can be improved by the proper selection of the components
used for the resonant feedback circuit including the amplifier but there is a limit to the stability
that can be obtained from normal LC and RC tank circuits.
Fig(xxii): Crystal Oscillator
Transformer works on the principle of mutual inductance. We know that if two coils or windings
are placed on the core of iron, and if we pass alternating current in one winding, back emf or
induced voltage is produced in the second winding. We know that alternating current always
changes with the time. So if we apply AC voltage across one winding, a voltage will be induced
in the other winding. Transformer works on this same principle. It is made of two windings wound
around the same core of iron. The winding to which AC voltage is applied is called primary
winding. The other winding is called as secondary winding.
In this project we need 12 volt supply as for relay so we step down 230V to 12V with the help of
step down transformer and further we need 5V for micro controller for this we use voltage regulator
because it operate only on 5V. We use 12-0-12 V transformer which means ‘12V’ on one side and
‘12V’ on one side and ‘0V’ means earth or ground.
A) VOLTAGE AND CURRENT RELATIONSHIP:
Let V1 volts be input alternating voltage applied to primary winding. I1 Amp is input alternating
current through primary winding. V2 volt is output alternating voltage produced in the secondary.
I2 amp be the current flowing through the secondary.
Then relationship between input and output voltages is given by
V1/V2 = N1/N2
Relationship between input and output currents is
I1/I2 = N2/N1
(Where N1 is no. of turns of coil in primary and N2 is number of turns in secondary)
We know that Power = Current X Voltage. It is to be noted that input power is equal to output
power. Power is not changed. If V2 is greater than V1, then I2 will be less than I1. This type of
transformer is called as step up transformer. If V1 is Greater than V2, then I1 will be less than I2.
This type of transformer is called as step down transformer.
For step up transformer, N2>N1, i.e., number of turns of secondary winding is more than those in
primary. For step down transformer, N1>N2, i.e., numbers of turns of primary winding is more
than those in secondary.
The AT89S52 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
by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-
system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many embedded
The AT89S52 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.
1. 8 KB Reprogrammable flash
2. 32 Programmable I/O lines
3. 16 bit Timer/Counter 3
4. 8 Interrupt sources
5. Power range: 4V – 5.5V
6. Endurance: 1000 Writes / Erase cycles
7. Fully static operation: 0 Hz to 33 MHz’s
8. Three level program memory lock
9. Power off flag
10. Full duplex UART serial channel
11. Low power idle and power down modes
12. Interrupt recovery from power down modes
13. 256 KB internal RAM
14. Dual data pointer
The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2 Kbytes of
Flash programmable and erasable read only memory (PEROM). The device is manufactured using
Atmel’s high density nonvolatile memory technology and is compatible with the industry standard
MCS-51Ô instruction set and pin out.
By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a
powerful microcomputer which provides a highly flexible and cost effective solution to many
embedded control applications.
The AT89s52 provides the following standard features: 8 Kbytes of Flash, 128 bytes of RAM, 15
I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex
serial port, a precision analog comparator, 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 contents but freezes the oscillator disabling all other chip functions until the next
C) 8051 MICRO CONTROLLER:
Intel 8051 is CISC architecture which is easy to program in assembly language and also has a good
support for High level languages. The memory of the microcontroller can be extended up to 64k.
This microcontroller is one of the easiest microcontrollers to learn.
The 8051 microcontroller is in the field for more than 20 years. There are lots of books and study
materials are readily available for 8051.
The best thing done by Intel is to give the designs of the 8051 microcontroller to everyone. So it
is not the fact that Intel is the only manufacture for the 8051 there more than 20 manufactures,
with each of minimum 20 models. Literally there are hundreds of models of 8051 microcontroller
available in market to choose. Some of the major manufactures of 8051 are:
The Philips‘s 8051 derivatives has more number of features than in any microcontroller. The costs
of the Philips microcontrollers are higher than the Atmel’s which makes us to choose Atmel more
often than Philips.
Dallas has made many revolutions in the semiconductor market. Dallas’s 8051 derivative is the
fastest one in the market. It works 3 times as fast as a 8051 can process. But we are unable to get
more in India.
These people were the one to master the flash devices. They are the cheapest microcontroller
available in the market. Atmel’s even introduced a 20pin variant of 8051 named 2051. The Atmel’s
8051 derivatives can be got in India less than 70 rupees. There are lots of cheap programmers
available in India for Atmel. So it is always good for students to stick with 8051 when you learn a
Architecture is must to learn because before learning new machine it is necessary to learn the
capabilities of the machine. This is something like before learning about the car you cannot become
a good driver. The architecture of the 8051 is given below.
Fig(xxv): Architecture of 8051
1. Fully Static Operation: 1 MHz to 24 MHz’s
2. 32 Programmable I/O Lines
3. Two 16-Bit Timer/Counters
4. Six Interrupt Sources (5 Vectored)
5. Programmable Serial Channel
6. Low Power Idle and Power Down Modes
The 8051 has an 8-Bit CPU that means it is able to process 8 bit of data at a time. 8051 has 235
Let’s now move on to a practical example. We shall work on a simple practical application and
using the example as a base, shall explore the various features of the 8051 microcontroller.
E) PIN CONFIGURATION OF IC 89S52:
VCC pin of this IC is pin no 40. Normally we apply a 5 volt regulated dc power supply to this pin.
For this purpose either we use step down transformer power supply or we use 9 volt battery with
GND pin of this IC is pin no 20. Pin no 20 is normally connected to the ground pin normally
negative point of the power supply.
XTAL is connected to the pin no 18 and pin no 19 of this IC. The quartz crystal oscillator
connected to XTAL1 and XTAL2 PIN. These pins also needs two capacitors of 30 pf value. One
side of each capacitor is connected to crystal and other pin is connected to the ground point.
Normally we connect a 12 MHz or 11.0592 MHz crystal with this IC. But we use crystal up to 20
MHz to this pins.
RESET PIN no 9 is the reset pin of this IC. It is an active high pin. On applying a high pulse to
this pin, the micro controller will reset and terminate all activities. This is often referred to as a
power on reset. The high pulse must be high for a minimum of 2 machine cycles before it is allowed
to go low.
PORT 0 occupies a total of 8 pins. Pin no 32 to pin no 39. It can be used for input or output. We
connect all the pins of the port 0 with the pull up resistor (10kohm) externally. This is due to fact
that port 0 is an open drain mode. It is just like an open collector transistor.
PORT1 ALL the ports in microcontroller is 8 bit wide pin no 1 to pin no 8 because it is an 8 bit
controller. All the main register are mainly 8 bit wide. Port 1 is also occupies an 8 pins. But there
is no need of pull up resistor in this port. Upon reset port 1 act as an input port. Upon reset all the
ports act as an input port.
PORT2 It also have an 8 pins. It can be used as an input or output. There is no need of any pull
up resistor to this pin.
PORT 3 It occupies a total 8 pins from pin no 10 to pin no 17. It can be used as input or output.
Port 3 does not require any pull up resistor. The same as port 1 and port2. Port 3 is configured as
an output port on reset. Port 3 has the additional function of providing some important signals such
as interrupts. Port 3 also use for serial communication.
ALE It is an output pin and is active high. When connecting an 8031 to external memory, port 0
provides both address and data. In other words, the 8031 multiplexes address and data through port
0 to save pins. The ALE pin is used for DE multiplexing the address and data by connecting to the
IC 74ls373 chip.
PSEN stands for program store enable. In an 8031 based system in which an external rom holds
the program code, this pin is connected to the OE pin of the rom.
EA In 89c51 8751 or any other family member of the Atmel 89c51 series all come with on-chip
rom to store programs, in such cases the EA pin is connected to the Vcc. For family member 8031
and 8032 is which there is no on chip rom, code is stored in external memory and this is fetched
by 8031. In that case EA pin must be connected to GND pin to indicate that the code is stored
F) BLOCK DIAGRAM:
Fig(xxvi): Block diagram of 89S52
G) SPECIAL FUNCTION REGISTER (SFR) ADDRESSES:
ACC ACCUMULATOR 0E0H
B B REGISTER 0F0H
PSW PROGRAM STATUS WORD 0D0H
SP STACK POINTER 81H
DPTR DATA POINTER 2 BYTES
DPL LOW BYTE OF DPTR 82H
DPH HIGH BYTE OF DPTR 83H
P0 PORT0 80H
P1 PORT1 90H
P2 PORT2 0A0H
P3 PORT3 0B0H
TMOD TIMER/COUNTER MODE CONTROL 89H
TCON TIMER COUNTER CONTROL 88H
TH0 TIMER 0 HIGH BYTE 8CH
TLO TIMER 0 LOW BYTE 8AH
TH1 TIMER 1 HIGH BYTE 8DH
TL1 TIMER 1 LOW BYTE 8BH
SCON SERIAL CONTROL 98H
SBUF SERIAL DATA BUFFER 99H
PCON POWER CONTROL 87H
Keil compiler for programming.
Window xp exists which allows us to communicate with the vast 3 control lines as well as either
4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit
data bus or an 8-bit data bus. If a 4-bit data bus is used, the LCD 44780 standard requires 3 control
lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to
operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used, the LCD will require
a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus is used,
the LCD will require a total of 11 data lines (3 control lines plus the 8 lines for the data bus).
The three control lines are referred to as EN, RS, and RW.
Will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data
bus is used, the LCD will require a total of 11 data lines (3 control lines plus the 8 lines for the
The three control lines are referred to as EN, RS, and RW. The EN line is called "Enable." This
control line is used to tell the LCD that you are sending it data. To send data to the LCD, your
program should first set this line high (1) and then set the other two control lines and/or put data
on the data bus. When the other lines are completely ready, bring EN low (0) again. The 1-0
transition tells the 44780 to take the data currently found on the other control lines and on the data
bus and to treat it as a command.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a command
or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data
being sent is text data which should be displayed on the screen. For example, to display the letter
"T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write
commands--so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the
user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4,
DB5, DB6, and DB7.
3.1.16 IR SENSOR:
Infrared radiation is the portion of electromagnetic spectrum having wavelengths longer than
visible light wavelengths, but smaller than microwaves, i.e., the region
Fig(xxvii): IR Sensor
Roughly from 0.75µm to 1000 µm is the infrared region. Infrared waves are invisible to human
eyes. The wavelength region of 0.75µm to 3 µm is called near infrared, the region from 3 µm to 6
µm is called mid infrared and the region higher than 6 µm is called far infrared. (The demarcations
are not rigid; regions are defined differently by many).
There are different types of IR sensors working in various regions of the IR spectrum but the
physics behind "IR sensors" is governed by three laws:
A) PLANCK’S RADIATION LAW:
Every object at a temperature T not equal to 0 K emits radiation. Infrared radiant energy is
determined by the temperature and surface condition of an object. Human eyes cannot detect
differences in infrared energy because they are primarily sensitive to visible light energy from 400
to 700 nm. Our eyes are not sensitive to the infrared energy.
B) STEPHEN BOLTZMANN LAW:
The total energy emitted at all wavelengths by a black body is related to the absolute temperature
C) WEIN’S DISPLACEMENT LAW:
Wein’s Law tells that objects of different temperature emit spectra that peak at different
wavelengths. It provides the wavelength for maximum spectral radiant emittance for a given
The relationship between the true temperature of the black body and its peak spectral existence or
dominant wavelength is described by this law.
The world is not full of black bodies; rather it comprises of selectively radiating bodies like rocks,
water, etc. and the relationship between the two is given by emissivity (E).
Emissivity depends on object color, surface roughness, moisture content, degree of compaction,
field of view, viewing angle & wavelength.
D) ELEMENT OF INFRARED DETECTION SYSTEM:
A typical system for detecting infrared radiation is given in the following block diagram:
1. Infrared Source:
All objects above 0 K radiate infrared energy and hence are infrared sources. Infrared sources also
include blackbody radiators, tungsten lamps, silicon carbide, and various others. For active IR
sensors, infrared Lasers and LEDs of specific IR wavelengths are used as IR sources.
2. Transmission Medium:
Three main types of transmission medium used for Infrared transmission are vacuum, the
atmosphere, and optical fibers.
The transmission of IR radiation is affected by presence of CO2, water vapor and other elements
in the atmosphere. Due to absorption by molecules of water carbon dioxide, ozone, etc. the
atmosphere highly attenuates most IR wavelengths leaving some important IR windows in the
electromagnetic spectrum; these are primarily utilized by thermal imaging/ remote sensing
E) TYPE OF SENSOR:
1. BREAK BEAM SENSORS:
This type of sensors consists of a pair of light emitting and light detecting elements. Infrared source
transmits a beam of light towards a remote IR receiver creating an “electronic fence”. Once a beam
is broken/interrupted due to some opaque object, output of detector changes and associated
electronic circuitry takes appropriate actions.
Typical applications of such sensors are intrusion detection, shaft encoder (for measurement of
rotation angle/rate of rotation)
Fig(xxviii): Break beam sensor
2. REFLECTANCE SENSORS:
This type of sensors house both an IR source and an IR detector in a single housing in such a way
that light from emitter LED bounces off an external object and is reflected into a detector. Amount
of light reflected into the detector depends upon the reflectivity of the surface.
This principle is used in intrusion detection, object detection (measure the presence of an object in
the sensor’s FOV), barcode decoding, and surface feature detection (detecting features painted,
taped, or otherwise marked onto the floor), wall tracking (detecting distance from the wall).
Fig(xxix): Reflectance sensor
It can also be used to scan a defined area; the transmitter emits a beam of light into the scan zone,
the reflected light is used to detect a change in the reflected light thereby scanning the desired
F) APPLICATION OF IR SENSOR:
1. Radiation thermometers.
2. Moisture analyzers.
3. Gas Analyzers.
4. IR Imaging devices.
5. Remote sensing.
6. Missile Guidance.
7. Human body detection.
3.1.17 LIQUID CRYSTAL DISPLAY:
Liquid Crystal Display is made use in various kinds of devices from small display screen in
calculator and to large screens in televisions. There are lots of advantages in using the LCD
displays in systems like power efficiency, thin size, low cost etc. LCD based small display modules
are normally found in all kinds of embedded devices. The LCD even though looks simple, but it
is actually difficult to make it work.
Fig(xxx): LCD Screen
The LCD works with voltage pulses only and that with precise timing and voltage levels. Hence
special kinds of LCD drivers are developed to drive the LCD. Two or more of this kind of driver
ICs together with the LCD screen forms LCD modules which are normally found in embedded
systems. The LCD module makes a system stand-alone which can take input and display the
corresponding output. This particular project demonstrates how to interface a 16x2 LCD display.
RESULT AND CONCLUSONS
The result of this project is to operate our home appliances in the ON and OFF condition by using
IR SENSORS. Firstly we give the input to the microcontroller through IR sensors. When we enter
the room, it will on the room light. When we exit from the room then room light will be off.
As the intensity of the room increases number of operated bulb will increases and same things
happen when the people will leave the room means the bulb will OFF as the counter tends to zero.
In this project basically happen that when the person will cut the sensor then the counter will count
and depend on this the room light will ON vice versa as the person left the light will be OFF
automatically, this will happen with the help of microcontroller.
In this industrialized world of 21st
century one thing that is becoming most precious after food, air
and water is ‘Electricity’. So along with production, regulation of consumption also becomes an
important aspect. We can regulate consumption by various means. In this particular project we
have implemented a system using different electronics and electrical devices for the regulation of
electricity consumption within a room.
In this project with the help of IR Sensor we can control the room lights. As the number of persons
enters the room, intensity of the room increases and intensity of the room will decreases when they
leaves the room. With the entering and exit procedure we can control the room lights and other
“Electricity Conserved is Electricity Generated”
1. There are several areas for application of voice recognition technology.
2. Automatic controlled appliances and toys.
3. In Banks.
4. In our residential areas.
5. Our Offices.
6. On Road.
7. To control room light intensity acc. To manpower.
8. To controlling parking light intensity acct. to no of cars.
9. To change the motor speed according to increasing material in a machine.
ADVANTAGES AND FUTURE DEVELOPMENT:
1. It can be used in various rooms like seminar halls, where the capacity of the room is limited and
should not be exceeded.
2. It can be used in our homes because we often forget to switch off our room lights.
3. It helps in energy conservation.
4. In future, we can send this data to remote areas using mobile or internet.
5. Voice alarm system can be used to indicate that room is full & person can’t enter inside.
If more than one person crosses the sensor at a time it can only detect as one person entered or
leaved. So while using this project there should be a certain delay between two persons crossing
; New energy saver
m1 equ p2.0
m2 equ p2.1
m3 equ p2.2
m4 equ p2.6
RS BIT P2.5
RW BIT P2.4
E BIT P2.3
FL BIT P0.7
LCD EQU P0
C1 EQU 31H
C2 EQU 32H
C3 EQU 33H
MOV LCD, #00H
MOV C1, #0
MOV C2, #0
MOV C3, #0
; MOV R0, #100
; MOV R1, #00 ; AMOUNT
; MOV R2, #01H
; MOV R3, #1
MOV A, #38H ; 2*16 MATRIX
MOV A, #02 ; RETURN HOME
MOV A, #01 ; CLEAR DISPLAY SCREEN
MOV A, #0CH ; DISPLAY ON CURSOR OFF
MOV A, #80H ; MOVE CURSOR TO FIRST LINE SECOND COLOUMN
MOV DPTR, #TABLE1 ; DISPLAY ERP
MOV r1, #00
mov r0, #10
MOV A, #80H
MOV DPTR, #TABLE2
MOV A, #0C0H
MOV DPTR, #TABLE4
MOV A, R1
MOV A, #01H ; CLEAR DISPLAY SCREEN
RET; DISPLAY DATA ON LCD
MOV LCD, A
MOV LCD, A
MOV R6, #255
AGAIN: MOV R7, #255
BACK: DJNZ R7, BACK
DJNZ R6, AGAIN
TABLE1: DB 'ENERGY SAVER', 0
TABLE2: DB 'ENERGY SAVER', 0
TABLE3: DB '***', 0
TABLE4: DB 'C.ST.', 0
1. HAND BOOK OF ELECTRONICS A.K. MAINI.
2. LET US C YASHWANT KANITKAR.
3. SHYAM SERIES TATA MC GRILL.
4. DIGITAL SYSTEMS PRINCIPLES AND APPLICATION RONALD LTOCCI.
5. ELECTRONICS FOR YOU (MARCH 1998).
6. DIGITAL DESIGN MORIS MANO.
7. MODERN ALL ABOUT MOTHERBOARD LOTHIA, M.
8. OWER SUPPLY FOR ALL OCCASION SHARMA, MC.
9. CMOS DATA BOOK (74SERIES) ECA.
10. PRACTICAL TRANSFORMER DESIGN HAND BOOK LABON. E.
 Retrieved from Jacob Millman & Christos C. Halkias, Electronic Devices & Circuits McGraw-
 Retrieved from Robert L. Boylestad, Electronic Devices & Circuits, Pearson publication; Tenth
 Fergal Grimes. Microsoft .NET for Programmers. Manning Publications Co., 2002.
 Retrieved from Paranaiba D., Principles of Electronic Instrumentation, PHI publication, 2008
 Retrieved from cse.iitkgp.ac.in/~soumya/.../the-8051-microcontroller-0314772782.pdf.
 [Gri02] Fergal Grimes. Microsoft .NET for Programmers. Manning Publications
 [Lam03] Leslie Lamport. LATEX - A document preparation system. Pearson
Education, 2 edition, 2003.
 [Mic03] Microsoft. MSDN Documentation, 2003.
 [Sta02] William Stallings. Cryptography and Network Security. Pearson Education
Asia, 2 edition, 2002.
 [Tan00] Andrew S. Tanenbaum. Computer Networks. Prentice Hall of India,