Project Final Report On Home Automation
Project Final Report On Home Automation
CONTENTS
1) Acknowledgement
2) Certficate
3) Abstract
4) Introduction
5) Concept
6) About Project
7) Hardware Part
8) Circuit Diagrams
9) Component Description
a) Resistors
b) Capacitor
c) Diode
d) Light emitting diode
e) Transistor
f) Battery
g) Crystal oscillator
h) Power supply
i) Relay
j) Transformer
k) Microcontroller (8051/8052)
l) Infrared remote control
m) Photodiode
n) Phototransistor
a) Transmitter program
b) Receiver program
11) Bibliography
Page |2
ABSTRACT
The HomeAutomation is a wireless home automation system that
is supposed to be implemented in existing home environments,
without any changes in the infrastructure. HomeAutomation let
the user to control the home from his or her computer and assign
actions that should happen depending on time or other sensor
readings such as light, temperature or sound from any device in
the HomeAutomation network.
INTRODUCTION
BACKGROUND
Most advanced home automation systems in existence today
require a big and expensive change of infrastructure. This
means that it often is not feasible to install a home
automation system in an existing building. The
HomeAutomation is a wireless home automation system that
is supposed to be implemented in existing home
environments, without any changes in the existing
infrastructure. HomeAutomation lets the user to control his
home from his or her computer. In the computer program the
user can create actions what should happen with electrical
Page |3
CONCEPT
Every HomeAutomation box is a stand-alone device. It is
connected to the mains and controls the power outlet of the
electrical device that is plugged into it. There will be a
receiver and transmitter in each of the box, so they can
exchange information with the master (a computer). People
can control power supply of electrical devices in order to
create an interactive home environment to facilitate the
control without changing any home appliance. People can
enjoy the high technology and simplicity modern life style.
Each device will be with standard setup and while adding it
into network; it can be given an address and tasks to do. All
the setting will be easily resettable to default value, so people
can move the devices between different electrical devices
and networks. HomeAutomation boxes will be put into
different rooms at home, depending on the needed
functionality. Various different sensors could be attached to
the boxes. The sensors are used as triggers for actions, that
user can set up in the computer program.
Page |4
ABOUT PROJECT
Home automation systems, or smart home technologies, are
systems and devices that can control elements of your home
environment — lighting, appliances, telephones, home security
and mechanical, entry and safety systems.
DESCRIPTION
Remote control
Automatic control
Features
HARDWARE PART
Remote control
Receiving circuit
Power supply
Microcontroller unit
Relay circuit
Fire alarm system
Appliances
• Fan
• Tubes
• A.C.
• T.V.
• Sockets
• Lightings
RESISTOR
A 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:
V = I*R
Units
Theory of operation
Ohm's law
V = I*R
The current through resistors in series stays the same, but the
voltage across each resistor can be different. The sum of the
potential differences (voltage) is equal to the total voltage. To find
their total resistance:
P a g e | 15
Power dissipation
The power dissipated by a resistor (or the equivalent resistance of
a resistor network) is calculated using the following:
All three equations are equivalent. The first is derived from joule's
first law. Ohm’s law derives the other two from that.
Note that the nominal power rating of a resistor is not the same
as the power that it can safely dissipate in practical use. Air
circulation and proximity to a circuit board, ambient temperature,
and other factors can reduce acceptable dissipation significantly.
Rated power dissipation may be given for an ambient
temperature of 25 °c in free air. Inside an equipment case at 60
°c, rated dissipation will be significantly less; if we are dissipating
a bit less than the maximum figure given by the manufacturer we
may still be outside the safe operating area, and courting
premature failure.
CAPACITOR
A capacitor or condenser is a passive electronic component
consisting of a pair of conductors separated by a dielectric
(insulator). When a potential difference (voltage) exists across the
conductors, an electric field is present in the dielectric. This field
stores energy and produces a mechanical force between the
conductors. The effect is greatest when there is a narrow
separation between large areas of conductor; hence capacitor
conductors are often called plates.
Theory of operation
A capacitor consists of two conductors separated by a non-
conductive region. The non-conductive substance is called the
dielectric medium, although this may also mean a vacuum or a
semiconductor depletion region chemically identical to the
conductors. A capacitor is assumed to be self-contained and
isolated, with no net electric charge and no influence from an
external electric field. The conductors thus contain equal and
opposite charges on their facing surfaces, and the dielectric
contains an electric field. The capacitor is a reasonably general
model for electric fields within electric circuits.
P a g e | 19
Energy storage
Current-voltage relation
D.C. Circuits
A.C. circuits
Networks
For capacitors in parallel
Applications
Energy storage
Large capacitor banks (reservoir) are used as energy sources for the exploding-
bridgewire detonators or slapper detonators in nuclear weapons and
other specialty weapons. Experimental work is under way using banks of
capacitors as power sources for electromagnetic armor and electromagnetic
railguns and coilguns.
P a g e | 27
Power Conditioning
Signal coupling
Decoupling
Motor Starters
In single phase squirrel cage motors, the primary winding within
the motor housing is not capable of starting a rotational motion
on the rotor, but is capable of sustaining one. To start the motor,
a secondary winding is used in series with a non-polarized starting
capacitor to introduce a lag in the sinusoidal current through the
starting winding. When the secondary winding is placed at an
angle with respect to the primary winding, a rotating electric field
is created. The force of the rotational field is not constant, but is
sufficient to start the rotor spinning. When the rotor comes close
to operating speed, a centrifugal switch (or current-sensitive relay
in series with the main winding) disconnects the capacitor. The
start capacitor is typically mounted to the side of the motor
housing. These are called capacitor-start motors, which have
relatively high starting torque.
Signal processing
The energy stored in a capacitor can be used to represent
information, either in binary form, as in drams, or in analogue
form, as in analog sampled filters and ccds. Capacitors can be
used in analog circuits as components of integrators or more
complex filters and in negative feedback loop stabilization. Signal
processing circuits also use capacitors to integrate a current
signal.
Tuned circuits
Capacitors and inductors are applied together in tuned circuits to
select information in particular frequency bands. For example,
radio receivers rely on variable capacitors to tune the station
frequency. Speakers use passive analog crossovers, and analog
equalizers use capacitors to select different audio bands.
Sensing
Most capacitors are designed to maintain a fixed physical
structure. However, various factors can change the structure of
the capacitor, and the resulting change in capacitance can be
used to sense those factors.
DIODE
In electronics, 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,
which is a crystal of semiconductor connected to two electrical
terminals, a p-n junction. A vacuum tube diode, now little used, is
a vacuum tube with two electrodes; a plate and a cathode.
Semiconductor diodes
A modern semiconductor diode is made of a crystal of
semiconductor like silicon that has impurities added to it to create
P a g e | 33
Current–voltage characteristic
A semiconductor diode’s behavior in a circuit is given by its
current–voltage characteristic, or i–v graph (see graph at right).
The shape of the curve is determined by the transport of charge
carriers through the so-called depletion layer or depletion region
that exists at the p-n junction between differing semiconductors.
When a p-n junction is first created, conduction band (mobile)
electrons from the n-doped region diffuse into the p-doped region
where there is a large population of holes (vacant places for
electrons) with which the electrons “recombine”. When a mobile
electron recombines with a hole, both hole and electron vanish,
leaving behind an immobile positively charged donor (dopant) on
the n-side and negatively charged acceptor (dopant) on the p-
side. The region around the p-n junction becomes depleted of
charge carriers and thus behaves as an insulator.
The second region, at reverse biases more positive than the piv,
has only a very small reverse saturation current. In the reverse
bias region for a normal p-n rectifier diode, the current through
the device is very low (in the µa range). However, this is
temperature dependent, and at sufficiently high temperatures, a
substantial amount of reverse current can be observed (ma or
more).
The third region is forward but small bias, where only a small
forward current is conducted.
The Shockley ideal diode equation or the diode law (named after
transistor co-inventor William Bradford Shockley, not to be
confused with tetrode inventor Walter h. Schottky) gives the i–v
characteristic of an ideal diode in either forward or reverse bias
(or no bias). The equation is:
Where
The Shockley ideal diode equation or the diode law is derived with
the assumption that the only processes giving rise to the current
in the diode are drift (due to electrical field), diffusion, and
thermal recombination-generation. It also assumes that the
P a g e | 37
For even rather small forward bias voltages (see figure 5) the
exponential is very large because the thermal voltage is very
small, so the subtracted ‘1’ in the diode equation is negligible and
the forward diode current is often approximated as
P a g e | 38
LIGHT-EMITTING DIODE
A light-emitting diode (led) is a semiconductor light source. LEDs
are used as indicator lamps in many devices, and are increasingly
used for lighting. Introduced as a practical electronic component
in 1962, early LEDs emitted low-intensity red light, but modern
versions are available across the visible, ultraviolet and infrared
wavelengths, with very high brightness.
Advantages
Efficiency: LEDs produce more light per watt than
incandescent bulbs. Their efficiency is not affected by shape
and size unlike fluorescent light bulbs or tubes.
Color: LEDs can emit light of an intended color without the
use of color filters that traditional lighting methods require.
This is more efficient and can lower initial costs.
Size: LEDs can be very small (smaller than 2 mm2) and are
easily populated onto printed circuit boards.
On/off time: LEDs light up very quickly. A typical red
indicator led will achieve full brightness in microseconds.
LEDs used in communications devices can have even faster
response times.
Cycling: LEDs are ideal for use in applications that are
subject to frequent on-off cycling, unlike fluorescent lamps
that burn out more quickly when cycled frequently, or hid
lamps that require a long time before restarting.
Dimming: LEDs can very easily be dimmed either by pulse-
width modulation or lowering the forward current.
Cool light: in contrast to most light sources, LEDs radiate
very little heat in the form of IR that can cause damage to
sensitive objects or fabrics. Wasted energy is dispersed as
heat through the base of the led.
P a g e | 40
Disadvantages
Some fluorescent lamps can be more efficient.
High initial price: LEDs are currently more expensive, price
per lumen, on an initial capital cost basis, than most
conventional lighting technologies. The additional expense
partially stems from the relatively low lumen output and the
drive circuitry and power supplies needed.
Temperature dependence: led performance largely depends
on the ambient temperature of the operating environment.
Over-driving the led in high ambient temperatures may
result in overheating of the led package, eventually leading
to device failure. Adequate heat-sinking is required to
maintain long life. This is especially important when
considering automotive, medical, and military applications
where the device must operate over a large range of
temperatures, and is required to have a low failure rate.
P a g e | 41
LED CIRCUIT
In electronics, the basic led circuit is an electric power circuit used
to power a light-emitting diode or led. It consists of a voltage
source powering two components connected in series: a current
P a g e | 42
The led used will have a voltage drop, specified at the intended
operating current. Ohm's law and Kirchhoff’s circuit laws are used
to calculate the resistor that is used to attain the correct current.
The resistor value is computed by subtracting the led voltage
drop from the supply voltage, and then dividing by the desired led
operating current. If the supply voltage is equal to the LED's
voltage drop, no resistor is needed.
Where:
TRANSISTOR
The name is transistor derived from ‘transfer resistors’ indicating
a solid state semiconductor device. In addition to conductor and
insulators, there is a third class of material that exhibits
proportion of both. Under some conditions, it acts as an insulator,
and under other conditions it’s a conductor. This phenomenon is
called semi-conducting and allows a variable control over electron
flow. So, the transistor is semi conductor device used in
electronics for amplitude. Transistor has three terminals, one is
the collector, one is the base and other is the emitter, (each lead
must be connected in the circuit correctly and only then the
transistor will function). Electrons are emitted via one terminal
and collected on another terminal, while the third terminal acts as
a control element. Each transistor has a number marked on its
body. Every number has its own specifications.
There are mainly two types of transistor (i) NPN & (ii) PnP
NPN transistors:
When a positive voltage is applied to the base, the transistor
begins to conduct by allowing current to flow through the
P a g e | 44
Pnp transistor:
It also does exactly same thing as above except that it has a
negative voltage on its collector and a positive voltage on its
emitter.
When the emitter current increases , most holes are injected into
the base region increasing the collector current. In this way
emitter is analogous to the control of plate current by small grid
voltage in a vacuum triode
Hence we can say that when the emitter is forward biased and
collector is negatively biased, a substantial current flows in both
the circuits. Since a small emitter voltage of about 0.1 to 0.5 volts
permits the flow of an appreciable emitter current the input power
is very small. The collector voltage can be as high as 45 volts.
Transistor curves
P a g e | 47
To make the base current flow, the base input terminal must be
made more positive than the emitter by increasing it above the
0.7 volts needed for a silicon device. By varying the base-emitter
voltage vbe, the base current is altered and which in turn controls
the amount of collector current flowing through the transistor as
previously discussed. When maximum collector current flows the
transistor is said to be saturated. The value of the base resistor
determines how much input voltage is required and
corresponding base current to switch the transistor fully "on".
Example no. 1.
the base resistor (rb) required to switch the load "on" when the
input terminal voltage exceeds 2.5v.
Example no. 2.
Again using the same values, find the minimum base current
required to turn the transistor fully "on" (saturated) for a load that
requires 200ma of current.
BATTERY (ELECTRICITY)
How batteries work
P a g e | 50
CRYSTAL OSCILLATOR
What are crystal oscillators?
Crystal oscillators are oscillators where the primary frequency
determining element is a quartz crystal. Because of the inherent
characteristics of the quartz crystal the crystal oscillator may be
held to extreme accuracy of frequency stability. Temperature
compensation may be applied to crystal oscillators to improve
thermal stability of the crystal oscillator.
computers, and cell phones. Quartz crystals are also found inside
test and measurement equipment, such as counters, signal
generators, and oscilloscopes.
Operation
A crystal is a solid in which the constituent atoms, molecules, or
ions are packed in a regularly ordered, repeating pattern
extending in all three spatial dimensions.
Quartz has the further advantage that its elastic constants and its
size change in such a way that the frequency dependence on
temperature can be very low. The specific characteristics will
depend on the mode of vibration and the angle at which the
quartz is cut (relative to its crystallographic axes).[7] therefore, the
P a g e | 54
Electrical model
Or,
P a g e | 56
Resonance modes
A quartz crystal provides both series and parallel resonance. The
series resonance is a few kilohertz lower than the parallel one.
Crystals below 30 MHz are generally operated between series and
parallel resonance, which means that the crystal appears as an
inductive reactance in operation. Any additional circuit
capacitance will thus pull the frequency down. For a parallel
resonance crystal to operate at its specified frequency, the
electronic circuit has to provide a total parallel capacitance as
specified by the crystal manufacturer.
Temperature effects
P a g e | 57
POWER SUPPLY
In alternating current the electron flow is alternate, i.e. the
electron flow increases to maximum in one direction, decreases
back to zero. It then increases in the other direction and then
decreases to zero again. Direct current flows in one direction only.
Rectifier converts alternating current to flow in one direction only.
When the anode of the diode is positive with respect to its
cathode, it is forward biased, allowing current to flow. But when
its anode is negative with respect to the cathode, it is reverse
biased and does not allow current to flow. This unidirectional
property of the diode is useful for rectification. A single diode
arranged back-to-back might allow the electrons to flow during
positive half cycles only and suppress the negative half cycles.
Double diodes arranged back-to-back might act as full wave
rectifiers as they may allow the electron flow during both positive
and negative half cycles. Four diodes can be arranged to make a
full wave bridge rectifier. Different types of filter circuits are used
to smooth out the pulsations in amplitude of the output voltage
from a rectifier. The property of capacitor to oppose any change
in the voltage applied across them by storing energy in the
electric field of the capacitor and of inductors to oppose any
change in the current flowing through them by storing energy in
the magnetic field of coil may be utilized. To remove pulsation of
the direct current obtained from the rectifier, different types of
combination of capacitor, inductors and resistors may be also be
used to increase to action of filtering.
Theory
Use of diodes in rectifiers:
Rectification
Since the two diodes have a common-cathode load resistor rl, the
output voltage across rl will result from the alternate conduction
of d1 and d2. The output waveform vout across rl, therefore has
no gaps as in the case of the half-wave rectifier.
Bridge rectifier
A more widely used full-wave rectifier circuit is the bridge
rectifier. It requires four diodes instead of two, but avoids the
need for a centre-tapped transformer. During the positive half-
cycle of the secondary voltage, diodes d2 and d4 are conducting
and diodes d1 and d3 are non-conducting. Therefore, current
flows through the secondary winding, diode d2, load resistor rl
and diode d4. During negative half-cycles of the secondary
voltage, diodes d1 and d3 conduct, and the diodes d2 and d4 do
not conduct. The current therefore flows through the secondary
winding, diode d1, load resistor rl and diode d3. In both cases, the
current passes through the load resistor in the same direction.
Therefore, a fluctuating, unidirectional voltage is developed
across the load.
Filtration
The rectifier circuits we have discussed above deliver an output
voltage that always has the same polarity: but however, this
output is not suitable as dc power supply for solid-state circuits.
This is due to the pulsation or ripples of the output voltage. This
should be removed out before the output voltage can be supplied
to any circuit. This smoothing is done by incorporating filter
networks. The filter network consists of inductors and capacitors.
The inductors or choke coils are generally connected in series
P a g e | 62
with the rectifier output and the load. The inductors oppose any
change in the magnitude of a current flowing through them by
storing up energy in a magnetic field. An inductor offers very low
resistance for dc whereas; it offers very high resistance to ac.
Thus, a series connected choke coil in a rectifier circuit helps to
reduce the pulsations or ripples to a great extent in the output
voltage. The fitter capacitors are usually connected in parallel
with the rectifier output and the load. As, ac can pass through a
capacitor but dc cannot, the ripples are thus limited and the
output becomes smoothed. When the voltage across its plates
tends to rise, it stores up energy back into voltage and current.
Thus, the fluctuations in the output voltage are reduced
considerable. Filter network circuits may be of two types in
general:
Circuit diagram
P a g e | 63
P a g e | 64
RELAY
Relay is a common, simple application of electromagnetism. It
uses an electromagnet made from an iron rod wound with
hundreds of fine copper wire. When electricity is applied to the
wire, the rod becomes magnetic. A movable contact arm above
the rod is then pulled toward the rod until it closes a switch
contact. When the electricity is removed, a small spring pulls the
contract arm away from the rod until it closes a second switch
contact. By means of relay, a current circuit can be broken or
closed in one circuit as a result of a current in another circuit.
Relays can have several poles and contacts. The types of contacts
could be normally open and normally closed. One closure of the
relay can turn on the same normally open contacts; can turn off
the other normally closed contacts.
Figure
Figure shows the basic relay driver circuit. As you can see an npn
transistor bc547 is being used to control the relay. The transistor
is driven into saturation (turned on) when logic 1 is written on the
port pin thus turning on the relay. The relay is turned off by
P a g e | 68
As you can see we have used a pull up resistor at the base of the
transistor. At8951/52/55 has an internal pull up resistor of 10k so
when the pin is pulled high the current flows through this resistor
so the maximum output current is 5v/10k = 0.5ma, the dc current
gain of bc547 is 100 so the maximum collector current we can get
is 0.5ma x 100 = 50ma, but most of the relays require more than
70ma-130ma current depending on the relay that we have
used, 0.5ma of base current is not suitable enough for turning on
the relay, so we have used an external pull up resistor. When the
controller pin is high current flows through the controller pin i.e.
5v/10k=0.5ma as well as through the pull up resistor. We have
used 4.7k pull up resistor so 5v/4.7k=1.1ma so maximum base
current can be 0.5ma + 1.1ma=1.6ma i.e. Collector current
=1.6ma x 100 = 160ma which is enough to turn on most of the
relays.
Note:
this relay driver circuit is to be used only with controllers for using
this circuit with other digital IC's like lm 555 use a resistor should
be used between that IC's output & the base of transistor. No
need of pull up resistor in that case.
Applications
Relays are used to and for:
TRANSFORMER
A transformer is a device that transfers electrical energy from one
circuit to another through inductively coupled conductors—the
transformer's coils. A varying current in the first or primary
winding creates a varying magnetic flux in the transformer's core,
and thus 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.
P a g e | 71
Basic principles
The transformer is based on two principles: firstly, that an electric
current can produce a magnetic field (electromagnetism) and
secondly that a changing magnetic field within a coil of wire
P a g e | 72
An ideal transformer
An ideal transformer is shown in the adjacent figure. Current
passing through the primary coil creates a magnetic field. The
primary and secondary coils are wrapped around a core of very
high magnetic permeability, such as iron, so that most of the
magnetic flux passes through both the primary and secondary
coils.
Induction law
The voltage induced across the secondary coil may be calculated
from faraday's law of induction, which states that:
Detailed operation
The simplified description above neglects several practical
factors, in particular the primary current required to establish a
magnetic field in the core, and the contribution to the field due to
current in the secondary circuit.
Applications
A major application of transformers is to increase voltage before
transmitting electrical energy over long distances through wires.
Wires have resistance and so dissipate electrical energy at a rate
proportional to the square of the current through the wire. By
transforming electrical power to a high-voltage (and therefore
low-current) form for transmission and back again afterward,
transformers enable economic transmission of power over long
distances. Consequently, transformers have shaped the electricity
supply industry, permitting generation to be located remotely
from points of demand. All but a tiny fraction of the world's
electrical power has passed through a series of transformers by
the time it reaches the consumer.
MICROCONTROLLER
Features
Description
The at89c51 is a low-power, high-performance cmos 8-bit
microcomputer with 4k bytes 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 in-
system or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bit cpu with flash on a monolithic chip,
the Atmel at89c51 is a powerful microcomputer which provides a
highly-flexible and cost-effective solution to many embedded
control applications and pinout.
Pin description
Gnd:-Ground.
Port 0
Port 1
Port 2
Port 2 also receives the high-order address bits and some control
signals during flash programming and verification.
Port 3
RST
Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device.
ALE/PROG
Address latch enable output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the
program pulse input (prog) during flash programming. In normal
operation ale is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking
purposes. Note, however, that one ale pulse is skipped during
each access to external data memory.
PSEN
EA/VPP
Oscillator characteristics
Xtal1 and xtal2 are the input and output, respectively, of an
inverting amplifier which can be configured for use as an on-chip
oscillator, as shown in figure 1. Either a quartz crystal or ceramic
resonator may be used. To drive the device from an external
clock source, xtal2 should be left unconnected while xtal1 is
driven as shown in figure 2. There are no requirements on the
duty cycle of the external clock signal, since the input to the
internal clocking circuitry is through a divide-by-two flip-flop, but
minimum and maximum voltage high and low time specifications
must be observed.
Idle mode
In idle mode, the cpu puts itself to sleep while all the on chip
peripherals remain active. The mode is invoked by software. The
content of the on-chip ram and all the special functions registers
remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset.
Power-down mode
In the power-down mode, the oscillator is stopped, and the
instruction that invokes power-down is the last instruction
executed. The on-chip ram and special function registers retain
their values until the power-down mode is terminated. The only
P a g e | 83
on the chip are three lock bits which can be left unprogrammed
(u) or can be programmed (p) to obtain the additional features
listed in the table below. When lock bit 1 is programmed, the logic
level at the ea pin is sampled and latched during reset. If the
device is powered up without a reset, the latch initializes to a
random value, and holds that value until reset is activated. It is
necessary that the latched value of ea be in agreement with the
P a g e | 84
current logic level at that pin in order for the device to function
properly.
Programming algorithm:
Repeat steps 1 through 5, changing the address and data for the
entire array or until the end of the object file is reached.
Data polling:
The at89c51 features data polling to indicate the end of a write
cycle. During a write cycle, an attempted read of the last byte
written will result in the complement of the written datum on
po.7. Once the write cycle has been completed, true data are
valid on all outputs, and the next cycle may begin. Data polling
may begin any time after a write cycle has been initiated.
Ready/busy:
The progress of byte programming can also be monitored by the
dribs output signal. P3.4 is pulled low after ale goes high during
programming to indicate busy. P3.4 is pulled high again when
programming is done to indicate ready.
Program verify: if lock bits lb1 and lb2 have not been
programmed, the programmed code data can be read back via
the address and data lines for verification. The lock bits cannot be
P a g e | 86
Reading the signature bytes: the signature bytes are read by the
same procedure as a normal verification of locations 030h, 031h,
and 032h, except that p3.6 and p3.7 must be pulled to a logic
low. The values returned are as follows.
Programming interface
Every code byte in the flash array can be written and the entire
array can be erased by using the appropriate combination of
control signals. The write operation cycle is self timed and once
initiated, will automatically time itself to completion.
Even that we can not see or hear infrared, we can feel it at our skin
temperature sensors.
When you approach your hand to fire or warm element, you will "feel"
the heat, but you can't see it. You can see the fire because it emits
other types of radiation, visible to your eyes, but it also emits lots of
infrared that you can only feel in your skin.
Its wavelength is longer (and the frequency lower) than that of visible
light, but the wavelength is shorter (and the frequency higher) than
that of terahertz radiation microwaves. Bright sunlight provides an
irradiance of just over 1 kilowatt per square meter at sea level. Of this
energy, 527 watts is infrared radiation, 445 watts is visible light, and 32
watts is ultraviolet radiation.
P a g e | 88
Infrared in electronics
This light can means something to the receiver, the "on or off"
radiation can transmit different meanings.
flashing strobe light. That strobe light is the "key", the "coding"
element that alerts us.
Similar to the airplane at the night sky, our T.V. room may have
hundreds of tinny IR sources, our body, the lamps around, even
the hot cup of tea. A way to avoid all those other sources, is
generating a key, like the flashing airplane. So, remote controls
use to pulsate its infrared in a certain frequency. The IR receiver
module at the T.V., VCR or stereo "tunes" to this certain
frequency and ignores all other IR received. The best frequency
for the job is between 30 and 60khz, the most used is around
36khz.
It means that those 3 dollars small units, have an output pin that
goes high (+5v) when there is a pulsating 36khz infrared in front
of it, and zero volts when there is not this radiation.
If you can turn on and off this frequency at the transmitter, your
receiver's output will indicate when the transmitter is on or off.
P a g e | 90
The T.V., VCR, and audio equipment manufacturers for long use
infra-red at their remote controls. My first color T.V. in 1976 used
an ultrasound (not infrared) remote control.
First of all, Philips adopted or created the rc5 standard that uses
fixed bit length and fixed quantity of bits.
Each bit is sliced in two halves. The left and right half has
opposed levels. If the bit to be transmitted is one (1), its left side
is zero while its right side is one. If the bit to be transmitted is
zero (0), its left side is one while the right side is zero.
P a g e | 91
(this is the right logic, reversed from what you can see at the IR
receiver output.)
It means that the second half of the bit is actually the same
meaning of the bit to be transmitted, as you can see at the
shaded blue right side of the bit as on, means bit transmitted = 1.
If you want to measure the correct logic level directly from the
receiver output, you should measure at the first half of the bit.
What is RC5?
Infrared Transmission
The RC5 code set was developed by Phillips and allows 2048
commands to be transmitted divided into 32 addressable groups
of 64 commands each. The transmitted code consists of a 14 bit
data word of the following structure.
Infrared Receiver
Photo detector
Preamplifier
Filter
Demodulator
Two pins are for +5v supply and ground while the third pin is for
data output. The Infrared Receiver is designed for demodulating
the frequency of 30khz to 40khz, for example, TSOP1738 is
designed for demodulating frequency of 38khz which is used in
our project.
Once we are sure that one of key in the key board is pressed next
our aim is to identify that key. To do this we firstly check for
particular row and then we check the corresponding column the
key board.
To check the row of the pressed key in the keyboard, one of the
rows is made high by making one of bit in the output port of 8051
high. This is done until the row is found out. Once we get the row
next out job is to find out the column of the pressed key. The
column is detected by contents in the input ports with the help of
a counter. The content of the input port is rotated with carry until
the carry bit is set.
1. The 8051 has 4 i/o ports p0 to p3 each with 8 i/o pins, p0.0
to p0.7,p1.0 to p1.7, p2.0 to p2.7, p3.0 to p3.7. The one of
the port p1 (it understood that p1 means p1.0 to p1.7) as an
i/p port for microcontroller 8051, port p0 as an o/p port of
microcontroller 8051 and port p2 is used for displaying the
number of pressed key.
2. Make all rows of port p0 high so that it gives high signal
when key is pressed.
3. See if any key is pressed by scanning the port p1 by
checking all columns for non zero condition.
4. If any key is pressed, to identify which key is pressed make
one row high at a time.
5. Initiate a counter to hold the count so that each key is
counted.
6. Check port p1 for nonzero condition. If any nonzero number
is there in [accumulator], start column scanning by following
step 9.
7. Otherwise make next row high in port p1.
8. Add a count of 08h to the counter to move to the next row
by repeating steps from step 6.
9. If any key pressed is found, the [accumulator] content is
rotated right through the carry until carry bit sets, while
P a g e | 99
PHOTODIODE
A photodiode is a semiconductor diode that functions as a photo
detector. Photodiodes are packaged with either a window or
optical fiber connection, in order to let in the light to the sensitive
part of the device. They may also be used without a window to
detect vacuum UV or x-rays.
Principle of operation: -
A photodiode is a p-n junction or p-i-n structure. When light with
sufficient photon energy strikes a semiconductor, photons can be
absorbed, resulting in generation of a mobile electron and
electron hole. If the absorption occurs in the junction's depletion
region, these carriers are swept from the junction by the built-in
field of the depletion region, producing a photocurrent.
Materials: -
The material used to make a photodiode is critical to defining its
properties, because only photons with sufficient energy to excite
an electron across the material's bandgap will produce significant
photocurrents.
Features: -
Critical performance metrics of a photodiode include: -
Responsivity
The ratio of generated photocurrent to incident light power,
typically expressed in a/w when used in photoconductive mode.
P a g e | 102
Dark current
The current through the photodiode in the absence of any input
optical signal, when it is operated in photoconductive mode. The
dark current includes photocurrent generated by background
radiation and the saturation current of the semiconductor
junction. Dark current must be accounted for by calibration if a
photodiode is used to make an accurate optical power
measurement, and it is also a source of noise when a photodiode
is used in an optical communication system.
Noise-equivalent power
(N.E.P.) the minimum input optical power to generate
photocurrent equal to the rms noise current in 1 hertz bandwidth.
The related characteristic detectivity (d) is the inverse of N.E.P.,
1/nep; and the specific detectivity ( ) is the detectivity
normalized to the area (a) of the photo detector, . The
N.E.P. is roughly the minimum detectable input power of a
photodiode.
Applications: -
P-n photodiodes are used in similar applications to other photo
detectors, such as photoconductors, charge-coupled devices, and
photomultiplier tubes.
P a g e | 103
Pin diodes are much faster and more sensitive than ordinary p-n
junction diodes, and hence are often used for optical
communications.
PHOTOTRANSISTOR
Phototransistors are solid-state light detectors with internal gain
that are used to provide analog or digital signals. They detect
visible, ultraviolet and near-infrared light from a variety of
sources and are more sensitive than photodiodes, semiconductor
devices that require a pre-amplifier. Phototransistors feed a
photocurrent output into the base of a small signal transistor. For
each illumination level, the area of the exposed collector-base
junction and the dc current gain of the transistor define the
output. The base current from the incident photons is amplified by
the gain of the transistor, resulting in current gains that range
from hundreds to several thousands. Response time is a function
of the capacitance of the collector-base junction and the value of
the load resistance. Photodarlingtons, a common type of
phototransistor, have two stages of gain and can provide net
gains greater than 100,000. Because of their ease of use, low cost
and compatibility with transistor-transistor logic (ttl),
phototransistors are often used in applications where more than
several hundred nanowatts (nw) of optical power are available.
SOFTWARE PART
Program for remote control (transmitter) unit
CODE:
keyport equ P2 ;Keypad port connected here
key_init:
ret
get_key:
done:
ret
P a g e | 108
ret
ret
inc keyval
P a g e | 109
ret
inc keyval
inc keyval
ret
ret
end
P a g e | 110
VAR1 equ r7
org 00H
mov SWport,#00H
mov sp,#50H
clr TOG
main:
jb IR,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#100
djnz VAR1,$
mov c,IR
mov FLIP,c
P a g e | 112
clr A
mov COUNT,#5
fadd:
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rlc a
djnz COUNT,fadd
mov ADDR,A
clr a
mov COUNT,#6
fcmd:
mov VAR1,#255
djnz VAR1,$
mov VAR1,#255
P a g e | 113
djnz VAR1,$
mov VAR1,#255
djnz VAR1,$
mov VAR1,#4
djnz VAR1,$
mov c,IR
rlc a
djnz COUNT,fcmd
mov TEMP,CMD
mov CMD,a
mov a,ADDR
cjne a,#00,nvalid
mov a,TEMP
cjne a,CMD,valid
nvalid:
ljmp main
valid:
clr a
mov c,FLIP
rlc a
mov TEMP,a
P a g e | 114
clr a
mov c,TOG
rlc a
cjne a,TEMP,valid1
sjmp nvalid
valid1:
mov c,FLIP
mov TOG,c
mov a,CMD
clr c
jb SW1,isset1
setb SW1
ljmp main
isset1:
clr SW1
ljmp main
skip1:
jb SW2,isset2
setb SW2
P a g e | 115
ljmp main
isset2:
clr SW2
ljmp main
skip2:
jb SW3,isset3
setb SW3
ljmp main
isset3:
clr SW3
ljmp main
skip3:
jb SW4,isset4
setb SW4
ljmp main
isset4:
clr SW4
ljmp main
skip4:
P a g e | 116
jb SW5,isset5
setb SW5
ljmp main
isset5:
clr SW5
ljmp main
skip5:
cjne a,#6,skip6
jb SW6,isset6
setb SW6
ljmp main
isset6:
clr SW6
ljmp main
skip6:
cjne a,#7,skip7
jb SW7,isset7
setb SW7
ljmp main
isset7:
P a g e | 117
clr SW7
ljmp main
skip7:
cjne a,#8,skip8
jb SW8,isset8
setb SW8
ljmp main
isset8:
clr SW8
ljmp main
skip8:
cjne a,#0CH,exit
mov SWport,#00H
ljmp main
exit:
ljmp main
END
P a g e | 118
DISCUSSION
The HomeAutomation could be developed further by making it
more stable and put more effort on the visual design of the
product. We could reduce the size of the product by replacing the
power supply module and Arduino microcontroller with much
smaller pieces. All the devices could be equipped with IR receiver
to control the electrical devices at home that support the IR
communication. More sophisticated actions and scenarios can be
created with this. IR commands enable larger variety for
controlling electrical devices that only the power outlet. A lot of
improvements could be done in the computer program as well. It
should be more customizable for an end user and it should have
some password protection for security reasons. It would be also
nice to make it web-based so that users can control their home
remotely.
P a g e | 119
CONCLUSION
HomeAutomation is undeniably a resource which can make a
home environment automated. People can control their electrical
devices via these HomeAutomation devices and set up the
controlling actions in the computer. We think this product have
high potential for marketing in the future. At the moment the
components are a bit to high to be able to produce these devices
for a interesting price.
P a g e | 120
BIBLIOGRAPHY
1. http://en.wikipedia.org/wiki/Resistance
2. http://en.wikipedia.org/wiki/Resistor
3. http://en.wikipedia.org/wiki/Capacitor
4. http://en.wikipedia.org/wiki/Diode
5. http://en.wikipedia.org/wiki/Light-emitting_diode
6. http://en.wikipedia.org/wiki/Transistor
7. http://en.wikipedia.org/wiki/Crystal_oscillator
8. http://en.wikipedia.org/wiki/Relay
9. http://en.wikipedia.org/wiki/Transformer
1 http://en.wikipedia.org/wiki/Intel_8051
0.
1 http://www.8052.com/book
1.
1 http://www.vishay.com/docs/82030/82030.pdf
2.