Download (DOCX, 2.1MB) - examnotice.com

vengefulsantaclausΗλεκτρονική - Συσκευές

25 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

182 εμφανίσεις

1



CHAPTER
-
1


GENERAL OVERVIEW





















GENERAL OVERVIEW


1.1 INTRODUCTION
:


Technology is the word coined for the practical application of scientific knowledge in the industry.
The advancement in technology cannot be

justified unless it is used for leveraging the user’s
2


purpose. Technology
,

is today
,

imbibed for accomplishment of
several
tasks of varied complexity
,

in almost all walks of life.



The society as a
whole

is

exquisitely dependent on science and
technology.
Technology has played a very significant role in improving the quality of
life. One way through
which

thi
s is done is
by
automating
several tasks
using
complex logic to simplify the work.

Here we introduce
the automatic railway bridge damage indication through wireless
, that can be
identify the risk of the damage during the running of trains on the tracks existed on the bridges.


1.2 AIM
:


This proto
-
type
is developed for identifying the damage of railw
ay bridge

from the remote
locations to the specified authority
.























1.3 METHODOLOGY
:


3





The above figure gives the pictorial representation of the procedure followed in the project
development.




In the specifications stage, the requirements of the model were
identified. In order to
identify the requiremen
ts, literature survey
was carried

out.




The identified requirements and the specifications of the model were then analyzed to
identify whether or not they were viable. If any of the specification
s

seemed impracticable, the
specifications were reviewed.




On
ce the viable specifications
were
identified,
the design of the product was

developed.
A s
et of all possible test
cases was

also prepared simultaneously.




The high level design document gives an overview of the design details.


Specifications

Analysi
s

Produc
t


Design

Test

Case
s

High
-
level

Design

Low
-
level

Design

Coding &

Unit

Testing

Integration

System

Test

Documentation

Test

Desig
n

Successful

Failure

4




The low level design
document contains the intricate details of the product design.




The project
was then

divided into separate modules
and each

module was individually
soldered, coded

and tested.




All the tested modules were then integrated. The integrated module was then tes
ted for
the set of all possible test cases. In case the integrated module didn’t work for
a
certain test case, the
specifications were reviewed accordingly.




In general, after every stage in project development, the specifications were reviewed.




After the

integrated module satisfied all the test cases, different stages of the project were
documented.


1.4 SIGNIFICANCE

OF PROJECT WORK:


During the course of our project we developed a multi system controller that is capable of
controlling devices that
work on

both

ac and dc
power
supplies

satisfactorily
.
We have developed a
model that gives a demo of industrial automation.


1.5 ORGANISATION

OF THE REPORT:


In the report, the second chapter deals with the introduction to the embedded systems, mult
i
system controllers and its basic details. The third chapter gives the details about the
microcontroller.
The

chapters four and
five

contain the details of the encoder and decoder respectively. The sixth
chapter deals with the driver L293D that forms a ma
jor component of one of our application
circuits. The

specifications of the RF modules used for communication between the controller and
the controlled devices are discussed in the seventh chapter. The eighth chapter contains information
about the remote c
ontrolled car which is one of our application devices.

The power supply and relay circuits are discussed in chapter
nine. The

tenth chapter consists of the
details of the µvision software that has been used to code our circuits. The eleventh chapter gives
the details about the procedure followed for testing the model developed in our project.


5






























CHAPTER
-
2

INTRODUCTION


2.1

INTRODUCTION TO EMBEDDED SYSTEMS:

2.1.1 EMBEDDED

SYSTEMS:

6



An embedded system is a specialized computer system that is housed in a large system in order to
carry out certain specific applications. Some embedded systems include operating systems and most
are so specialized such that the ent
ire logic can be implemented as a single program.



2.1.2 APPLICATIONS

OF EMBEDDED SYSTEMS:



Industrial machines



Automobiles




Medical equipment




Cameras




Household appliances




Airplanes




Vending machines




Toys etc



2.2

INTRODUCTION

TO
VIBRATION SE
NSOR


Piezoelectric sensor

A piezoelectric disk generates a voltage when deformed (change in shape is greatly exaggerated)

A
piezoelectric sensor

is a device that uses the
piezoelectric effect

to measure
pressure
,
acceleration
,
strain

or
force

by converting them to an
electrical

charge.


Piezoelectric sensors have proven to be versatile tools for the measurement of various processes.
They are used for
quality assurance
,
process control

and for research and development in many
different indu
stries. This measuring principle has been increasingly used and can be regarded as
a
mature technology

with an outstanding inherent reliability. It has been successfully
used in
various applications, such as in
medical
,
aerospace
,
nuclear

instrumentation, and as a pressure
7


sensor in the touch pads of mobile phones. In the
automotive industry
, piezoelectric element
s are
used to monitor combustion when developing
internal combustion engines
. The sensors are
either directly mounted into additional holes into the c
ylinder head or the spark/glow plug is
equipped with a built in miniature piezoelectric sensor.

The rise of piezoelectric technology is directly related to a set of inherent advantages. The high
modulus of elasticity

of many piezoelectric materials is comparable to that of many metals and
goes up to
10
6

N/m².

Even though piezoelectric sensors are electromechanical systems that react
to
compression
, the sensing elements show almost zero deflection. This is the reason why
piezoelectric sensors are so rugged, have an extremely high natural frequency and an excellent
lin
earity over a wide
amplitude

range. Additionally, piezoelectric technology is insensitive to
electromagnetic fields

and
radiation
, enabling measurements under harsh conditions. Some
materials used (especially
gallium phosphate
) have an extreme stability even at high temperature,
enabling sensors to have a working range of up to
1000 °C
. Tourmaline shows
pyroelectricity

in
addition to the piezoelectric effect; this is the ability to generate an electrical signal when the
temperature of the crystal changes. This effect is also common to
piezoceramic

materials.

Principle of operation

Depending on how a piezoelectric material is cut, three main modes of operation can be
distinguished: transverse, longitudinal, and shear.


Transve
rse effect

A force is applied along a neutral axis (y) and the charges are generated along the (x)
direction, perpendicular to the line of force. The amount of charge depends on the
geometrical dimensions of the respective piezoelectric element. When dimen
sions
apply,


,

where
is the dimension in line with the neutral axis,
is in line with the charge
generating axis and
is the corresponding piezoelectric coefficient.


Longitudinal effect

8


The amount of charge

produced is strictly proportional to the applied force and is
independent of size and shape of the piezoelectric element. Using several elements that
are mechanically in series and electrically in
parallel

is the only way to increase the
charge output. The resulting charge is


,

where
is the piezoelectric coefficient for a charge in x
-
direction relea
sed by forces
applied along x
-
direction (in
pC
/
N
).
is the applied Force in x
-
direction [N] and
corresponds

to the number of stacked elements .

Electrical properties



Schematic symbol and electronic model of a piezoelectric sensor

A piezoelectric transducer has very high DC
output impedance

and can be modeled as a
proportional
voltage source

and
filter network
. T
he voltage
V

at the source is directly
proportional to the applied force, pressure, or strain.
[5]

The output signal is then related to this
mechanical force as i
f it had passed through the equivalent circuit.




Frequency response of a piezoelectric sensor; output voltage vs applied force

9


A detailed model includes the effects of the sensor's mechanical construction and other non
-
idealities.
[6]

The inductance
L
m

is due to the seismic
mass

and
inertia

of the sensor itself.
C
e

is
inversely proportional to the mechanical
elasticity

of the sensor.
C
0

represents the static
capacitance of the transducer, resulting from an inertial mass of infinite size.
[6]

R
i

is the
insulation
leakage resistance

of the transducer element. If the sensor is connected to a
load
resistance
, this also acts in pa
rallel with the insulation resistance, both increasing the high
-
pass
cutoff frequency.



In the flat region, the sensor can be modeled as a voltage source in series with the sensor's
capacitance or a charge source in parallel with the capacitance

For use

as a sensor, the flat region of the frequency response plot is typically used, between the
high
-
pass cutoff and the resonant peak. The load and leakage resistance need to be large enough
that low frequencies of interest are not lost. A simplified equivale
nt circuit model can be used in
this region, in which
C
s

represents the capacitance of the sensor surface itself, determined by the
standard
formula for capacitance o
f parallel plates
.
[6]
[7]

It can also be modeled as a charge source
in parallel with
the source capacitance, with the charge directly proportional to the applied force,
as above.
[5]

10


Sensor design



Metal disks with piezo

material, used in buzzers or as
contact microphones

Based on piezoelectric technology various physical quantities can be measured; the most
common are pressure and acc
eleration. For pressure sensors, a thin
membrane

and a massive
base is used, ensuring that an applied pressure specifically loads the elements in one direction.
For
accelerometers
, a
seismic mass

is attached to
the crystal elements. When the accelerometer
experiences a motion, the invariant seismic mass loads the elements according to Newton’s
second law of motion
.

The main difference in the working principle between these two cases is the way forces are
applie
d to the sensing elements. In a pressure sensor a thin membrane is used to transfer the force
to the elements, while in accelerometers the forces are applied by an attached seismic mass.

Sensors often tend to be sensitive to more than one physical quantity
. Pressure sensors show
false signal when they are exposed to vibrations. Sophisticated pressure sensors therefore use
acceleration compensation elements in addition to the pressure sensing elements. By carefully
matching those elements, the acceleration s
ignal (released from the compensation element) is
subtracted from the combined signal of pressure and acceleration to derive the true pressure
information.

Vibration sensors can also be used to harvest otherwise wasted energy from mechanical
vibrations. Th
is is accomplished by using piezoelectric materials to convert mechanical strain
into usable electrical energy.

Sensing materials

11


Two main groups of materials are used for piezoelectric sensors: piezoelectric ceramics and
single crystal materials. The cera
mic materials (such as
PZT

ceramic) have a piezoelectric
constant / sensitivity that is roughly two
orders of
magnitude

higher than those of the natural
single crystal materials and can be produced by inexpensive
sintering

processes. The piezoeffect
in piezoceramics is "trained", so unfortunatel
y their high sensitivity degrades over time. The
degradation is highly correlated with temperature. The less sensitive 'natural' single crystal
materials (
gallium phospha
te
,
quartz
,
tourmaline
) have a much higher


when carefully handled,
almost infinite


long term stability. There are al
so new single crystal materials commercially
available such as Lead Magnesium Niobate
-
Lead Titanate (PMN
-
PT). These materials offer
greatly improved sensitivity (compared with
PZT
) but suffer from a

lower maximum operating
temperature and are currently much more expensive to manufacture.


12



CHAPTER
-
3

MICROCONTROLLER


3.1 INTRODUCTION:

A microcontroller is a computer on a chip. It is an integrated chip that is usually a part of an
embedded system. It is a microprocessor that is meant to be more self contained, independent and
yet function as a tiny, dedicated computer. It lays emphasis
on high integration, low power
consumption, self sufficiency and cost effectiveness.




It is typically designed using the CMOS (complementary metal oxide semiconductor) technology
and has the following features:




a central processing unit



discrete input a
nd output pins



serial input/output ports(UARTs)



peripherals such as timers, counters



RAM,ROM,EPROM,Flash Memory(EEPROM)



Clock generator



May include analog to digital converters



In
-
circuit programming and debugging support



13





3.2 ADVANTAGES:

Design with microcontrollers has the following advantages:



It has low overall system cost as all the peripherals are integrated

onto a single chip.



The product size is small, therefore the product is handy.



System design and troubleshooting is simple.



Since the peripherals are integrated on the same chip, the system is reliable.



Additional RAM and ROM can be easily interfaced as a
nd when required.



Microcontrollers with on
-
chip ROM provides a software security feature.


3.3 ATMEL 89S52:

ATMEL 89C51 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, non volatile memory technology and is compatible with in
dustry standard
MCS
-
51 instruction set. It provides highly flexible and cost effective solution to many embedded
control applications.


3.4 FEATURES OF ATMEL 89S52:



It has 4K bytes of in
-
system reprogrammable flash memory (1000 write/erase cycles).



Fully
static operation: 0
-
24 MHz

Micro controller


Memory

(RAM/ROM)

I/O ports

Peripherals

14




Three level program memory lock



128 bytes internal RAM



32 programmable I/O lines(4 ports)



Two 16 bit timers/counters



Six interrupt sources



Programmable serial channel



Low power idle and Power down modes



8 bit CPU optimized for co
ntrolled applications



64 K of external program memory



Full duplex UART


3.5 BLOCK DIAGRAM OF THE MICROCONTROLLER:


15





Fig 3.5
Block Diagram of the M
icrocontroller




16


3.6 DESCRIPTION OF BLOCK DIAGRAM:

3.6.1 CENTRAL PROCESSING UNIT (CPU):


The microcontroller consists of 8 bit ALU with associated registers like register A,
register B,Program status word(PSW),Stack pointer(SP) ,a 16 bit program counter(PC) and a 16 bit
data pointer register(DTPR).

3.6.2

ARITHMETIC LOGIC UNIT(
ALU):

The ALU performs arithmetic and logic functions on 8 bit variables. An important and unique

feature of the microcontroller architecture is that the

ALU can manipulate 1 bit as well as 8 bit data
types. It

performs the

Operations over the operands held by the temporary registers

TMP1 and
TMP2.The temporary registers cannot be accessed by the user.


3.6.3 ACCUMULATOR (ACC):


It is referred to as register A or Acc.It is an 8 bit register.

It holds the source
operand and stores the result of arithmetic operations. It is used as the source or destination register
for logical operations. It is either explicitly or implicitly specified in the instructions.

3.6.4 B

REGISTER:


It is a special function register. It can be used to store one of the operands in multiply
and divide instructions. For all other instructions it is used as a scratch pad.

3.6.5 PROGRAM STATUS WORD (PSW):


It is one of the special function registers .It is an 8 bit register. It is a set of


Flags that indicate the status of the microcontroller.



CARRY BIT (CY):

This bit holds the carry bit in case of arithmetic operations. It also serves the purpose of
accumulator in case of Boolean operations. It is set to one when there is a carry out from the D7 bit.
It can a
lso be rest or cleared through instructions.



AUXILLARY CARRY (AC):

CY AC FO RS1 RS0 OV
--

P

17


It is used in BCD operations usually. This bit is raised when a carry occurs from lower nibble to the
higher nibble during arithmetic operations on BCD numbers.

FLAG 0 (F0):

Flag 0 is ava
ilable to the user for general purpose.

REGISTER SELECT BITS (RS1 AND RS0):


The two bits RS1 and RS0 are used to select one of the four available register banks

As below:



OVERFLOW FLAG (OF):

The overflow flag was created specifically for the purpose

of informing the programmer that the
result of the signed number operation is erroneous. If the result of an operation on signed numbers
is too big for a register, an overflow has occurred and the programmer must be notified.

PARITY (P):

The parity bit re
flects the number of 1s in the accumulator.


P=0 implies that accumulator contains an even number of 1s.


P=1 implies that the accumulator contains odd number of 1s.

D1 bit is a user definable flag and is reserved for future use.

3.5.6 SPECIAL

FUNCTION REGISTER BANK (SFR):


It is a set of special function registers that can be addressed using their respective addresses
allotted to them. The addresses lie in the range 80H
-
FFH.


3.5.7 INPUT
-
OUTPUT (I/O) PORTS (P0
-
P3):


RS1 RS0

REGISTER BANKS

ADDRESS




0

0 0 00H
-
07H


0 1 1 08H
-
0FH



1 0 2

10H
-
17H


1 1 3 18H
-
1FH

18



These four latches
-
drivers pairs have been allotted to the four parallel I/O ports. These latches have
been allotted addresses in the special function register bank. Using these allotted addresses, the user
can communicate with the ports.


3.5.8 BUFFER:


It is a special function register and consists of two registers namely transmit buffer and the
receive buffer. The transmit buffer receives data parallely and transmits serially. The receive buffer
on the other hand is serial in parallel out re
gister.

3.5.9 TIMING AND CONTROL UNIT:


It derives the timing and control information required for the internal operation of the circuit
and the control information required for controlling the external bus.

3.5.10 OSCILLATOR:


It gener
ates the basic timing clock signal required for the operation of the circuit using a
crystal oscillator connected externally.

3.5.11 EPROM AND PROGRAM ADDRESS REGISTER:


These blocks provide on chip EPROM and a mechanism to internally address the
EPROM.

3.5.12

RAM AND RAM ADDRESS REGISTER:


They provide 128 bytes of RAM and a mechanism to internally address the RAM












3.6

PIN DESCRIPTION OF AT89S52:

19





3.7 Pin Description

3.7.1VCC (PIN 40)


Supply voltage.

3.7.2 GND (PIN 20)


Ground.

3.7.3 Port 0 (PIN 32
-
39)


Port 0 is an 8
-
bit open drain bidirectional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
-
impedance inputs. Po
rt
0 can also be configured to be the multiplexed low
-
order address/data bus during accesses to
external program and data memory. In this mode, P0 has internal pull
-
ups. Port 0 also receives the
code bytes during Flash programming and outputs the code byte
s dur
-
ing program verification.
External pull
-
ups are required during program verification
.

3.7.4 Port 1 (PIN 1
-
8)

Port 1 is an 8
-
bit bidirectional I/O port with internal pull
-
ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are wri
tten to Port 1 pins, they are pulled high by the inter
-
nal pull
-
ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low
will source current (IIL) because of the internal pull
-
ups. In addition, P1.0 and P1.1 can be
20


configu
red to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger
input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low
-
order
address bytes during Flash programming and verification.


3.7.
5 Port 2 (PIN 21
-
28)

Port 2 is an 8
-
bit bidirectional I/O port with internal pull
-
ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal
pull
-
ups and can be used as inputs. A
s inputs, Port 2 pins that are externally being pulled low will
source current (IIL) because of the internal pull
-
ups. Port 2 emits the high
-
order address byte during
fetches from external program memory and during accesses to external data memory that use

16
-
bit
addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull
-
ups when emitting
1s. During accesses to external data memory that use 8
-
bit addresses (MOVX @ RI), Port 2 emits
the contents of the P2 Special Function Register. Port 2

also receives the high
-
order address bits
and some control signals during Flash program
-
ming and verification.
Port Pin Alternate Functions
P1.0 T2 (external count input to Timer/Counter 2), clock
-
out P1.1 T2EX (Timer/Counter 2
capture/reload trigger and
direction control) P1.5 MOSI (used for In
-
System Programming) P1.6
MISO (used for In
-
System Programming) P1.7 SCK (used for In
-
System Programming)

3.7.6 Port 3 (PIN 10
-
17)


Port 3 is an 8
-
bit bidirectional I/O port with internal pull
-
ups. The Port 3 output

buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal
pull
-
ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will
source current (IIL) because of the pull
-
ups. Port 3 receives some control signals for Flash
programming and verification. Port 3 also serves the functions of various special features of the
AT89S52, as shown in the following table.


3
.7.7 RST (PIN 9)

Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit
in SFR AUXR (address 8EH) can be used to disable this feat
ure. In the default state of bit DISRTO,
the RESET HIGH out feature is enabled.


3.7.8 ALE/PROG (PIN 30)

21


Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the progra
m 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. If desired, ALE operation can be
disabled by setting bit 0 of SF
R location 8EH. With the bit set, ALE is active only during a MOVX
or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE
-
disable bit has no
effect if the microcontroller is in external execution mode.
Port Pin Alternate Functions

P
3.0 RXD
(serial input port) P3.1 TXD (serial output port) P3.2 INT0 (external interrupt 0) P3.3 INT1
(external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input) P3.6 WR
(external data memory write strobe) P3.7 RD (external data

memory read strobe)


3.7.9 PSEN (PIN 29)


Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52
is executing code from external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activati
ons are skipped during each access to exter
-
nal data memory.

3.7.10 EA/VPP (PIN 31)

External Access Enable.

EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH. Note, however, that if
lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to
VCC for
internal program executions. This pin also receives the 12
-
volt programming enable voltage (VPP)
during Flash programming.


3.7.11 XTAL1 (PIN 19)

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

3.7.12

XTAL2 (PIN 18)

Output from the inverting oscillator amplifier.







22



CHAPTER
-
4


Design and implementation


Hardware section


1.

The system design consists of both hardware and software.

2.

From the hardware end, we implement the both transmitter and receiver

section.
Here we use RF communication between the transmitter and receiver.

3.

To implement the transmitter section, we use ARM microcontroller for the
controlling purpose.

4.

In the transmitt
er we need to implement encoder

and RF transmitting module.

5.

In the r
eceiver section we need to implement
decoder and
R
F

receiving module.


Software section


1.

For the operation purpose, the user application instructions are written programming code
by using
embedded c
.

2.

The application program is compiled by using
KEIL
-
C

comp
iler and converts the source
file into
.hex file
.

3.

For the dumping purpose, we use micro flash programmer.

4.

Here the program is dumped in the microcontroller
ROM memory

location.


System design flow


1.

The power supply circuit generates +ve

5 volt dc from 230 ac, which is required for the
microcontroller and other passive component operating

power
supply.

2.

Here we developed two transmitting sections and one receiving section.

3.


In the transmitting sections, we generate the RF frequency signals
, by using RF
transmitter modules.

23


4.

In the receiving section, the receiving RF receiver module connected to the ARM
microcontroller along with the DC motor for dish position control.

5.

When the transmitter section generates the frequency which is same as the
receiver
frequency then the dish position changes according to the transmitter position.




























24





CHAPTER
-
4

ENCODER












HT12E



Introduction:


The 2
^
12 encoders are a series of CMOS LSIs

(large scale integrated circuits)

for

remote control
system applications. They are

capable of encoding information which consists

o
f N address bits
and 12_N data bits. Each address/data input can be set to one of the two

logic states. The
programmed addresses/data

are transmitted together with

the header bits

via an RF or an infrared
transmission medium

upon receipt of a trigger signal. The
c
apability

to select a TE trigger on the
HT12E
.


Features
:

25





Operating voltage



2.4V~12V for the HT12E



Low power and high noise immunity CMOS

technology



L
ow s
tandby current: 0.1_A
at

VDD=5V



Minimum transmission word



Four words for the HT12E



Built
-
in oscillator needs only 5% resistor



Data code has positive polarity



Minimal external components



HT12E
: 18
-
pin DIP/20
-
pin SOP package








PIN Diagra
m:



26


PIN
Description:


A0~A7

(
NMOS

Transmission

Gate

Protection

Diode
).
Input pins for

address A0~A7
setting
.
These pins can be
externally

set to VSS or left open
.




AD8~AD11

(
NMOS

Transmission

Gate

protection

Diode
)
Input pins for address/data


AD8~AD11 setting
.
These pins can be externally set to VSS or left open


D8~D1

(
CMOS IN
)
Pull
-
high

Input pins for data D8~D11 setting and transmission

enable,

active low
.
These pins should be externally set to VSS or left open


DOUT


(
CMOS OUT
)

Encoder data serial transmission output


L/MB

(
CMOS IN
) Pull
-
high

Latch
/Momentary transmission format selection pin:


Latch: Floating or VDD


Momentary: VSS



Operation
:


The 2
^
12

series of encoders begin a 4
-
word transmission cycle upon receipt of a transmission
enable

(TE for the HT12E
active

low). This cycle will repeat itself as long as the

transmission
enable (TE or D8~D11) is held low. Once the transmission enable returns hig
h the encoder

output completes its final cycle and then stops
.






Information word
:


If L/MB=1 the device is in the latch mode (for use with the latch type of data decoders). When
the transmission

enable is removed during a transmission, the DOUT pin ou
tputs a complete
word and then

stops. On the other hand, if L/MB=0 the device is in the momentary mode (for use
with the momentary

type of data decoders). When the

transmission enable is removed during a
27


transmission, the DOUT

outputs a complete word and
then adds 7 words all with the _1_ data
code.

An information word consists of 4 periods
.



Address/data waveform
:


Each programmable address/data pin can be externally
set to one of the two
logic states
.





Address/data programming (preset)
:


The statu
s of each address/data pin can be individually pre
-
set to logic _hi
gh_ or _low_. If a
transmission
enable signal is applied, the encoder scans and transmits the status of the 12 bits of
address/data serially in the

order A0 to AD11 for the HT12E.
During in
formation transmission
these bits are transmitted with a preceding synchronization bit. If

the trigger signal is not applied,
the chip enters the standby mode and consumes a reduced current of

less than 1
A for a supply
voltage of 5V.

Usual applications pre
set the address pins with individual security codes using
DIP switches or PCB

wiring, while the data is selected by push buttons or electronic switches.





28



Address/Data sequence
:



The following provides the address/data sequence table for various
models of the 212 series of

encoders. The correct device should be selected according to the individual address and data
requirements.



Part No.

:
0

1

2

3

4

5



6

7

8

9


10

11



Address/Data Bits
:
A0

A1

A2

A3

A4

A5

A6

A7

AD8


AD9

AD10

AD11



Transmissions enable
:


For the HT12E encoders, transmission is enabled by applying a low signal to the TE pin.


Applications
:




Burglar
alarm system



Smoke and fire alarm system



Garage door controllers



Car door controllers



Car alarm system



Security system



Cordless telephones



Other remote control systems









29
































30


CHAPTER
-
6

RF MODULE



RF MODULE


433 MHz RF
Transmitter STT
-
433:

1.

Overview


The STT
-
433 is ideal for remote control applications where low

cost and longer range is
required. The transmitter operates from a

1.5
-
12V supply, making it ideal for battery
-
powered
applications.

The transmitter employs a
SAW
-
stabilized oscillator, ensuring

accurate frequency
control for best range performance. Output

power and harmonic emissions are easy to control,
making FCC

and ETSI compliance easy. The manufacturing
-
friendly SIP style

package and low
-
cost make the STT
-
433 suitable for high volume

applications.

2.

Features

∙ 433.92 MHz Frequency

∙ Low Cost

∙ 1.5
-
12V operation

∙ 11mA current consumption at 3V

∙ Small size

∙ 4 dBm output power at 3V


31





Transmitter



3. Applications

∙ Remote Keyless Entry (RKE)

∙ Remote
Lighting Controls

∙ On
-
Site Paging

∙ Asset Tracking

∙ Wireless Alarm and Security Systems

∙ Long Range RFID

∙ Automated Resource Management



4
. Pin Description

ANT 50 ohm antenna output. The antenna port impedance affects

output power and harmonic
emissio
ns. An L
-
C low
-
pass filter

may be needed to sufficiently filter harmonic emissions.
Antenna

can be single core wire of approximately 17cm length or PCB

trace antenna.

VCC
Operating voltage for the transmitter. VCC should be bypassed

with a .01uF ceramic
capacitor
and filtered with a 4.7uF tantalum

capacitor. Noise on the power supply will degrade transmitter

noise performance.

DATA Digital data input. This input is CMOS compatible and should be

driven with CMOS level inputs.

GND Transmitter ground. Connec
t to ground plane.

32



5
. Operation

5
.1. Theory

OOK(On Off Keying) modulation is a binary form of amplitude modulation. When a logical 0
(data linelow) is being sent, the transmitter is off, fully suppressing the carrier. In this state, the
transmitter curren
t

is very low, less than 1mA. When a logical 1 is being sent, the carrier is fully
on. In this state, the module

current consumption is at its highest, about 11mA with a 3V power
supply.

OOK is the modulation method of choice for remote control application
s where power
consumption and

cost are the primary factors. Because OOK transmitters draw no power when
they transmit a 0, they

exhibit significantly better power consumption than FSK transmitters.

OOK data rate is limited by the start
-
up time of the oscil
lator. High
-
Q oscillators which have
very stable

center frequencies take longer to start
-
up than low
-
Q oscillators. The start
-
up time of
the oscillator

determines the maximum data rate that the transmitter can send.

The antenna port
impedance affects

outp
ut power and harmonic emissions. An L
-
C low
-
pass filter

may be needed
to sufficiently filter harmonic emissions. Antenna

can be single core wire of approximately 17cm
length or PCB

trace antenna.

VCC Operating voltage for the transmitter. VCC should be
byp
assed

with a .01uF ceramic capacitor and filtered with a 4.7uF tantalum

capacitor. Noise on
the power supply will degrade transmitter

noise performance.

DATA Digital data input. This
input is CMOS compatible and should be

driven with CMOS level inputs.

GND

Transmitter
ground. Connect to ground plane.




6
.2. Data Rate

The oscillator start
-
up time is on the order of 40uSec, which limits the maximum data rate to 4.8
kbit/sec.

6
.3. SAW stabilized oscillator

The transmitter is basically a negative resistance LC

oscillator whose center frequency is tightly

controlled by a SAW resonator. SAW (Surface Acoustic Wave) resonators are fundamental
frequency

devices that resonate at frequencies much higher than crystals.

433 MHz RF Receiver STR
-
433:

33


1.

Overview

The STR
-
433
is ideal for short
-
range remote control applications where cost is a primary
concern. The receiver module requires no external RF components except for the antenna. It
generates virtually no emissions, making FCC and ETSI approvals easy. The super
-
regenera
tive
design exhibits exceptional sensitivity at a very low cost. The manufacturing
-
friendly SIP style
package and low
-
cost make the STR
-
433 suitable for high volume applications.

2.

Features

∙ Low Cost

∙ 5V operation

∙ 3.5mA current drain

∙ No External Parts
are required

∙ Receiver Frequency: 433.92 MHZ

∙ Typical sensitivity:
-
105dBm

∙ IF Frequency: 1MHz









Receiver

3. Applications


∙ Car security system

∙ Sensor reporting

∙ Automation system

∙ Remote Keyless Entry (RKE)

∙ Remote Lighting Contr
ols

∙ On
-
Site Paging

∙ Asset Tracking

34


∙ Wireless Alarm and Security Systems

∙ Long Range RFID

∙ Automated Resource Management


4. Specification

Parameter Symbol Min Typ. Max Unit

Parameter Symbol Min Typ. Max Unit

Operating Voltage Vcc 4.5 5.0 5.5 VDC

Operating Current Icc
-

3.5 4.5 mA

Reception Bandwidth BW rx
-

1.0
-

MHz

Center Frequency Fc
-

433.92
-

MHz

Sensitivity
-

-

-
105
-

dBm

Max Data Rate
-

300 1k 3K Kbit/s

Turn On Time
-

-

25
-

ms

Operating Temperature T op
-
10
-

+60 °C


5. Pin Description


Pi
n Name Description

Pin Name Description

ANT Antenna input.

GND Receiver Ground. Connect to ground plane.

VCC(5V) VCC pins are electrically connected and provide operating voltage for the receiver.
VCC can be applied to either or both. VCC should be bypasse
d with a .1μF ceramic capacitor.
Noise on the power supply will degrade receiver sensitivity. DATA Digital data output. This
output is capable of driving one TTL or CMOS load.

It is a CMOS compatible output.


6. Operation


6.1. Super
-
Regenerative AM Detect
ion

35


The STR
-
433 uses a super
-
regenerative AM detector to demodulate the incoming AM carrier. A
super

regenerative

detector is a gain stage with positive feedback greater than unity so that it
oscillates. An RC
-
time constant is included in the gain stage so that when the gain stage
oscillates, the gain will be lowered over time proportional to the RC time constant unti
l the
oscillation eventually dies. When the oscillation dies, the current draw of the gain stage
decreases, charging the RC circuit, increasing the gain, and ultimately the oscillation starts again.
In this way, the oscillation of the gain stage is turned
on and off at a rate set by the RC time
constant. This rate is chosen to be super
-
audible but much lower than the main oscillation rate.
Detection is accomplished by measuring the emitter current of the gainstage. Any RF input
signal at the frequency of th
e main oscillation will aid the main oscillation in restarting. If the
amplitude of the RF input increases, the main oscillation will stay on for a longer period of time,
and the emitter current will be higher. Therefore, we can detect the original base
-
ba
nd signal by
simply low
-
pass filtering the emitter current.The average emitter current is not very linear as a
function of the RF input level. It exhibits a 1/ln response because of the exponentially rising
nature of oscillator start
-
up. The steep slope of

a logarithmnear zero results in high sensitivity to
small input signals.

6.2. Data Slicer

The data slicer converts the base
-
band analog signal from the super
-
regenerative detector to a
CMOS/TTL compatible output. Because the data slicer is AC coupled to t
he audio output, there
is a minimum data rate. AC coupling also limits the minimum and maximum pulse width.
Typically, data is encoded on the transmit side using pulse
-
width modulation (PWM) or non
-
return
-
to
-
zero (NRZ).The most common source for NRZ data i
s from a UART embedded in a
micro
-
controller. Applications that use NRZ data encoding typically involve microcontrollers.
The most common source for PWM data is from a remote control IC such as the HC
-
12E from
Holtek or ST14 CODEC from SunromTechnologies.

Data is sent as a constant rate square
-
wave.
The duty cycle of that square wave will generally be either33% (a zero) or 66% (a one). The data
slicer on the STR
-
433 is optimized for use with PWM encodeddata, though it will work with
NRZ data if certain enco
ding rules are followed.


6.3. Power Supply

36


The STR
-
433 is designed to operate from a 5V power supply. It is crucial that this power supply
be very quiet. The power supply should be bypassed using a 0.1uF low
-
ESR ceramic capacitor
and a 4.7uF tantalum capa
citor. These capacitors should be placed as close to the power pins as
possible. The STR
-
433 is designed for continuous duty operation. From the time power is
applied, it can take up to 750mSec for the data output to become valid.


6.4. Antenna Input

It wi
ll support most antenna types, including printed antennas integrated directly onto the PCB
and

simple single core wire of about 17cm. The performance of the different antennas varies.
Any time a

trace is longer than 1/8th the wavelength of the frequency it

is carrying, it should be a
50 ohm microstrip.


CHAPTER
-
7

HT12D
-

DECODER


7
.1 GENERAL FEATURES:



Operating Voltage:2.4V to 12V



Low power and high noise immunity CMOS technology



Low standby current



Capable of decoding 12 bits of information



Binary address
setting



Received codes are checked three times



Address/Data number combination: 8 address bits and 4 data bits



Built
-
in oscillator needs only 5% resistor



Valid transmission indicator



Easy interface with an RF or an IR transmission medium



Minimal external
components


7
.2 APPLICATIONS:



Burglar alarm system

37




Smoke and fire alarm system



Garage door controllers



Car door controllers



Car alarm system



Security system



Cordless telephones



Other remote control systems







7
.3 GENERAL DESCRIPTION:


.
The HT12D is a
CMOS large scale integrated circuit for remote control system applications.


.
It is paired with the compatible encoder. For proper operation, a pair of encoder/decoder with
the same number of addresses and data format should be chosen.


.
The decoder rece
ives serial addresses and data from a programmed encoder that are transmitted
by a carrier using an RF or an IR transmission medium.

.

They compare the serial input data three times continuously with their local addresses. If no
error or unmatched codes a
re found, the input data codes are decoded and then transferred to the
output pins.

.
The V
T
pin also goes high to indicate a valid transmission. The HT12D is capable of decoding
information that consists of 8 bits of address and 4 bits of data.


7
.4 BLOCK

DIAGRAM:

38



7.5

PIN DIAGRAM AND DESCRIPTION:



A0


A1


A2


A3


A4


A5


A6


A7


VSS

VDD

VT

OSC2

OSC1

DIN

D11

D10

D9

D8

1

2

3

4

5

6

7

8

9

18

17

16

15

14

13

12

11

10

Oscillator

Data

Shift

Register

Divider

Sync.

Detecto
r

Buffer

Data

Detecto
r

Contro
l


Logic

Comparator

Comparator

Buffer

Transmission Gate Circuit

Latch

Circuit

…………….

osc1

osc2

D
IN

Data

V
T

Address

V
DD

V
SS

.

.

.


.

.

.

.

.

.

.

39



o

A0
-
A7 (PINS 1
-

8):

They are input pins. They are used for setting the address.NMOS transmission gate and protection
diodes are connected internally to these pins. These pins can either be externally set to Vcc or left
o
pen.

o

D8
-
D11(PINS 10
-
13):

These are output data pins. When the decoder is powered on, the default state is low.

o

VT(PIN 17) :


This indicated valid transmission. It is an active high pin.

o

DIN (PIN 14):

It is the encoder’s serial data input pin.

o

VDD(PIN 1
8):

It is the positive power supply.

o

VSS(PIN 9):

It is the negative power supply.

o

OSCILLATOR(PINS 16 AND 15):

The pins are oscillator input and output pins of the oscillator.


7.5

ABSOLUTE MAXIMUM RATINGS:



Supply Voltage
-----------

-
0.3V to
13V



Input Voltage
-----------

Vss
-
0.3 to VDD+0.3V



Storage temperature
-----------

-
50°C to 125°C



Operating temperature
----------

-
20°C to 75°C


7.6

FUNCTIONAL DESCRIPTION:


7.6.
1 OPERATION:



The HT12D receives the 12 bit data that is
transmitted by an encoder and interprets the first 8
bits of code period as address and the last 4 bits as data.

40




A signal on the DIN pin activates the oscillator which in turn decodes the incoming address
and data.



The decoder will then check the received
address three times continuously.



If the received address codes match all the contents of the decoder’s local address, the 4 bits
of data are decoded to activate the output pins and the VT pin is set high to indicate a valid
transmission. This will last u
nless the data code is incorrect or no signal is received.



The output of the VT pin is high only when the transmission is valid. Otherwise it is always
low.


7.6
.2 OUTPUT TYPE:


The HT12D has 4 latch type data pins whose data remains unchanged until ne
w data is received.



Part



Data ins



Address


Iutput type


Operating Voltage


HT12D

4

8


Latch

2.4V~12V



7.6
.3 DECODER TIMING:

41



7.6
.4 FLOW CHART:



The oscillator is disabled in the standby state and activated when a logic “high” signal applies
to the DIN pin. The DIN pin is low if there is no signal input.



42










43


7.6
.5 ADDRESS/DATA SEQUENCE:

The following tale

provides the address/data sequence of the HT12D:


Part


No.


Address/Data sequence


0


1


2


3


4

5 5


6


7


8


9


10


11


HT12D


A0


A1


A2


A3


A4


A5


A6


A7


A8


A9


A10


A11



7.7


APPLICATION CIRCUIT:










44



CHAPTER
-
6

DESIGN AND IMPLEMENTATION

LIST OF
COMPONENTS


























45


Block diagram

TRANSMITTER













RECEIVER














CAPACITORS

(a) INTRODUCTION

Vibration
Sensor







Micro
Controller

AT89S52


RF

TRANSMIT
TER


Power
Supply

(5V)







Micro
Controller

AT89S52



Power
Supply

(5V)


RF

RECEIVER


L C D

46





Examples of capacitor package

Electrolytic capacitors




A capacitor or condenser is a
passive

electronic component

consisting of a pair of
conductors

separated by a
dielectric
. When a
voltage

potential difference

exists between the
conductors, an
electric fiel
d

is present in the dielectric. This field stores
energy

and produces a
mechanical force between the plates. The effect is greatest between wide, flat, parallel, narrowly
separated conductors. Capacitors are widely used in electronic circuits to block the flow of
direct
current

while allowing
alternating current

to pass, to filter out interference, to smooth the output
of
power supplies
, and for many other purposes.

(i)Un
polarised
:
-
Unpolarised capacitors don't mind which direction they are charged up from,
the potential difference across them can be in eithe
r direction.



Unpolarised capacitor


(ii) Polarised

capacitor:



47


Polarised capacitors have a positive and a negative connection, if connected the wrong way
round they will leak and often go pop! While not a

huge disaster, it does make a mess you will
have to clear up and the fluids inside them can be quite nasty so be careful when using them.








polarised capacitor




(iv) Capacitors in Parallel


Capacitors in Parallel


When capacitors are connected in parallel (fig 4) their combined capacitance is equal to the
individual capacitance added together. For eg: if capacitors C1 and C2 are connected
in series
their combined resistance, C is given by:



C=C1+C2



(v) Capacitors in Series


48



Capacitors in series


When capacitors are connected in series (figure 5) their combined resistance is less than any of
the individual

capacitances. There is a special equation for the combined capacitance of two
capacitors C1 and C2:

C = (C1×C2)/(C1+C2)


RESISTORS




Resistors




Type : passive



Electronic symbol

:

(Europe)



(US)





A resistor is a two
-
terminal

electronic component

that produces a
voltage

across its
terminals that is
proportional

to the
electric current

through it in accordance with
Ohm's law
:




V = I
R


49


Resistors are elements of
electrical networks

and electronic circuits. 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
.






























5
0











CHAPTER
-
7

LCD
















LCD (Liquid Cristal Display)


Introduction:


51



A liquid crystal display (LCD) is a thin, flat display device made up of any
number of color or monochrome pixels arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspend
ed between two transparent electrodes,
and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without
the liquid crystals between them, light passing through one would be blocked by the other. The
liquid crystal twists
the polarization of light entering one filter to allow it to pass through the
other.



A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common

devices attached to an
controller is an LCD display. Some of the most common LCDs connected to the contollers are
16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line
by 2 lines and 20 characters per line by 2 l
ines, respectively.



Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD

NT
-
C1611 module, are inexpensive, easy to use, and it is
even possible to produce a readout using the 5X7 dots plus cursor of the display. They have a
standard ASCII set of characters and mathematical symbols. For an 8
-
bit data bus, the display
requires

a +5V supply plus 10 I/O lines (
RS RW D7 D6 D5 D4 D3 D2 D1 D0)
. For a 4
-
bit data
bus it only requires the supply lines plus 6 extra lines(
RS RW D7 D6 D5 D4
). When the LCD
display is not enabled, data lines are tri
-
state and they do not interfere with th
e operation of the
microcontroller.


Fea
ture
s:


(1) Interface with either 4
-
bit or 8
-
bit microprocessor.




dot
-
matrix character patterns.



Shapes and S

available. Line lengths of
8, 16,
20, 24,
32 and
40
charact
ers are
all
standar
d, in
one,
two


52



-
matrix patterns.

(8).Display data RAM and character generator RAM may be


Accessed by

the microprocessor.




Blink Character, Cursor Shift, Display Shift.

-
in reset circuit is triggered

at power ON.

-
in oscillator.



Data can be placed at any location on the LCD. For 16×1 LCD, the address locations
are:






Fig : Address locations for a 1x16 line LCD









Shapes and sizes:

53





Even limited to character based modules,there is still a wide variety of shapes and sizes
available. Line lenghs of 8,16,20,24,32 and 40 charecters are all standard, in one, two and four
line versions.



Several different LC technologies exists.

“supertwist” types, for example, offer Improved
contrast and viewing angle over the older “twisted nematic” types. Some modules are available
with back lighting, so so that they can be viewed in dimly
-
lit conditions. The back lighting may
be either “elec
tro
-
luminescent”, requiring a high voltage inverter circuit, or simple LED
illumination.





54



Electrical block

diagram:




Power supply for lcd driving:




55


PIN DESCRIPTION:


Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two
pins are extra in both for back
-
light LED connections).





Fig: pin diagram of 1x16 lines lcd









56



CONTROL LINES:

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 make sure this line is low (0) 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

high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

RS
:


Line is the "Register Select" line. When RS is low (0), th
e 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 sould be displayed on the screen. For example, to display
the letter "T" on the screen yo
u would set RS high.



57


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 L
CD 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 referre
d to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.

Logic status on control lines:

• E
-

0 Access to LCD disabled

-

1 Access to LCD enabled

• R/W
-

0 Writing data to LCD

-

1 Reading data from LCD

• RS
-

0 Instructions

-

1 Character


Writing data to the LCD:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low


Read data from data lines (if it is reading)on LCD:


1) Set R/W bit to high

2) Set RS
bit to logic 0 or 1 (instruction or character)

58


3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low


Entering Text:


First, a little tip: it is manually a lot easier to enter characters and commands in
hexadecimal rather than binary (although, of course, you will need to translate commands from
binary couple of sub
-
miniature hexadecimal rotary switches is a simple matter
, although a little bit
into hex so that you know which bits you are setting). Replacing the d.i.l. switch pack with a of
re
-
wiring is necessary.

The switches must be the type where On = 0, so that when they are turned to the zero
position, all four outpu
ts are shorted to the common pin, and in position “F”, all four outputs are
open circuit.

All the available characters that are built into the module are shown in Table 3. Studying
the table, you will see that codes associated with the characters are quot
ed in binary and
hexadecimal, most significant bits (“left
-
hand” four bits) across the top, and least significant bits
(“right
-
hand” four bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters

(and a few other things) are obvious exceptions. Since these intelligent modules were
designed in the “Land of the Rising Sun,” it seems only fair that their Katakana phonetic symbols
should also be incorporated. The more extensive Kanji character set, wh
ich the Japanese share
with the Chinese, consisting of several thousand different characters, is not included!

Using the switches, of whatever type, and referring to Table 3, enter a few characters onto
the display, both letters and numbers. The RS switch

(S10) must be “up” (logic 1) when sending
the characters, and switch E (S9) must be pressed for each of them. Thus the operational order is:
set RS high, enter character, trigger E, leave RS high, enter another character, trigger E, and so
on.

The first 1
6 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM.
This is the Character Generator RAM (random access memory), which can be used to hold user
-
defined graphics characters. This is where these modules really start to show their potent
ial,
59


offering such capabilities as bar graphs, flashing symbols, even animated characters. Before the
user
-
defined characters are set up, these codes will just bring up strange looking symbols.



Codes 00010000 to 00011111 ($10 to $1F) are not us
ed and just display blank characters.
ASCII codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to
10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese
characters.






60



61



Initialization
by Instructions:





62



If the power conditions for the normal operation of the internal reset circuit
are not satisfied, then executing a series of instructions must initialize LCD unit. The
procedure for this initialization process is as fol
lows:


LCD commands:


Flow chart:





We won’t replace every routine in the LCD library, but we will try to cover all the major
functions. Our program, then, must initialize the LCD, display a simple message on the LCD,
63


display a message that
requires controlling the position we place letters on the LCD, and scroll a
message across the LCD. Between each message, we will want to clear the display. In this way,
we will cover all the major LCD operations:


























64








CHAPTER
-
8

STEP DOWN TRANSFORMER






















65


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 tran
sformer'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 second
ary winding. This effect is called
inductive coupling
.

If a
load

is connected to the s
econdary, current will flow in the secondary winding, and electrical
energy will be transferred from the primary circuit through the transformer to the load. In an
ideal transformer, the induced voltage in the secondary winding (
V
s
) is in proportion to the

primary voltage (
V
p
) and is given by the ratio of the number of turns in the secondary (
N
s
) to the
number of turns in the primary (
N
p
) as follows:


By appropriate selection of the ratio of turns, a transformer thus enables an
alternating current
(AC)

voltage to be "stepped up" by making
N
s

greater than
N
p
, or "stepped down" by making
N
s

less than
N
p
.

In the vast majority of transformers, the

windings are coils wound around a
ferromagnetic core
,
air
-
core

transformers being a notable
exception.

Transformers range in size from a thumbnail
-
sized coupling transformer hidden inside a stage
microphone

to huge units weighing hundreds of tons used to interconnect portions

of
power
grids
. All operate on the same basic principles, although the range of designs is wide. While new
technologies have eliminated the need for transformers in some electronic ci
rcuits, transformers
are still found in nearly all electronic devices designed for
household ("mains") voltage
.
Transformers are essential for high
-
voltage
electric power transmission
, which makes long
-
distance transmission economically practical.


66


Basic principles



An ideal transformer. The secondary current arises

from the action of the secondary EMF on the
(not shown) load impedance.

The transformer is based on two principles: first, that an
electric current

can produce a
magnetic
field

(
electromagnetism
) and second that a changing magnetic field within a coil of wire ind
uces
a voltage across the ends of the coil (
electromagnetic induction
). Changing the current in the
primary coil changes the magnetic flux that is develop
ed. The changing magnetic flux induces a
voltage in the secondary coil.

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 th
rough both
the primary and secondary coils. If a load is connected to the secondary winding, the load current
and voltage will be in the directions indicated, given the primary current and voltage in the
directions indicated (each will be
alternating current

in practice).



67



Induction law

The voltage induced across the secondary coil may be calculated from
Faraday's law of
induction
, which states that:


where
V
s

is the instantaneous
voltage
,
N
s

is the number of turns in the secondary coil and Φ is th
e
magnetic flux

through one turn of the coil. If the turns of the coil are oriented perpendicularly to
the magnetic field lines, the flux is the product of the
magnetic flux density

B

and the area
A

through which it cuts. The area is constant, being equal to the cross
-
sectional area of the
transformer core, whereas the magnetic field vari
es with time according to the excitation of the
primary. Since the same magnetic flux passes through both the primary and secondary coils in an
ideal transformer,
[34]

the instantaneous voltage across the primary winding equals


Taking the ratio of the two equations for
V
s

and
V
p

gives the basic equation
[35]

for stepping up or
stepping do
wn the voltage


N
p
/
N
s

is known as the
turns ratio
, and is the primary functional characteristic of any transformer.
In the case of step
-
up transformers, this may sometimes be stated as the reciprocal,
N
s
/
N
p
.
Turns
ratio

is commonly expressed as an
irreducible fraction

or ratio: for example, a transformer with
primary and secondary windings of, respectively, 100 and 150 turns is said to have a turns ratio
of 2:3

rather than 0.667 or 100:150.


68


Ideal power equation



The ideal transformer as a circuit element

If the secondary coil is attached to a load that allows current to flow, electrical power is
transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is perfectly
efficient. All the incoming energy is transformed from the pri
mary circuit to the
magnetic field

and into the secondary circuit. If this condition is met, the input
electric power

must equal the
output power:


giving the ideal transformer equation


This formula is a reasonable approximation for most commercial built transformers today.

If the voltage is increased, then the current is decreased by the same fac
tor. The impedance in
one circuit is transformed by the
square

of the turns ratio.
[34]

For example, if an impedance
Z
s

is
attached across the terminals of the secondar
y coil, it appears to the primary circuit to have an
impedance of (
N
p
/
N
s
)
2
Z
s
. This relationship is reciprocal, so that the impedance
Z
p

of the primary
circuit appears to the secondary to be (
N
s
/
N
p
)
2
Z
p
.

69


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.

Models of an ideal transformer typically assume a core of
negligible
reluctance

with two
windings of zero
resistance
.
[36]

When a voltage is applied to the primary winding, a small current
flows, driving
flux

around the
magnetic circuit

of the core.:
[36]

The current required to create the
flux is termed the
magnetizing cu
rrent
. Since the ideal core has been assumed to have near
-
zero
reluctance, the magnetizing current is negligible, although still required, to create the magnetic
field.

The changing magnetic field induces an
electromotive force

(EMF) across each winding.
[37]

Since the ideal windings have no impedance, they have no associated voltage dr
op, and so the
voltages V
P

and V
S

measured at the terminals of the transformer, are equal to the corresponding
EMFs. The primary EMF, acting as it does in opposition to the primary voltage, is sometimes
termed the "
back EMF
".
[38]

This is in accordance with
Lenz's law
, which states that induction of
EMF always opposes development of any such change in magnetic field.

Practical considerations

Leakage flux


70


The ideal transformer model assumes that all flux generated by the primary winding links all the

turns of every winding, including itself. In practice, some flux traverses paths that take it outside
the windings.
[39]

Such flux is termed
leakage flux
, and results in
leakage inductance

in
series

with
the mutually coupled transfor
mer windings.
[38]

Leakage results in energy being alternately stored
in and discharged from the
magnetic fields

with each cycle of the power supply. It is not directly
a power loss (see
"Stray losses"

below), but results in inferior
voltage regulation
, causing the
secondary voltage to not be directly proportional to the primary voltage, particularly under heavy
load.
[39]

Transformers are therefore normally designed to have very low
leakage inductance
.
Nevertheless, it is impossible to eliminate all leakage flux because it plays
an essential part in the
operation of the transformer. The combined effect of the leakage flux and the electric field
around the windings is what transfers energy from the primary to the secondary.
[40]

In some applications increased leakage is desired, and long magnetic paths, air gaps, or magnetic
bypass shunts may deliberately be introduced in a transformer design to limit the
short
-
circuit

current it will supply.
[38]

Leaky transformers may be used to supply loads that exh
ibit
negative
resistance
, such as
electric arcs
,
mercury vapor lamps
, and
neon signs

or for safely handling
loads that become periodically short
-
circ
uited such as
electric arc welders
.
[41]

Air gaps are also used to keep a transformer from saturating, espec
ially audio
-
frequency
transformers in circuits that have a direct current component flowing through the windings.
[42]

Leakage inductance is also helpful when transformers are operat
ed in parallel. It can be shown
that if the "per
-
unit" inductance of two transformers is the same (a typical value is 5%), they will
automatically split power "correctly" (e.g. 500
kVA

unit in parallel with 1,000 kVA unit, the
larger one will carry twice the current).






71


Effect of frequency

Transformer universal EMF equation

If the flux in the core is purely
sinusoidal
, the relationship for either winding between its
rms

voltage

E
rms

of the winding, and the supply frequency
f
, number of turns
N
, core cross
-
sectional
area
a

and peak
magnetic flux density

B

is given by the universal EMF equation:
[36]


If the flux does not contain even
harmonics

the following equation can be used for
half
-
cycle
average voltage

E
avg

of any waveshape:


The time
-
derivative term in
Faraday's Law

shows that the flux in the core is the
integral

with
respect to time of the applied voltage
.
[43]

Hypothetically an ideal transformer would work with
direct
-
current excitation, with the core flux increasing linearly with time.
[44]

In practice, the flux
rises to the point where
magnetic saturation

of the core occurs, causing a large increas
e in the
magnetizing current and overheating the transformer. All practical transformers must therefore
operate with alternating (or pulsed direct) current.
[44]

The EMF of
a transformer at a given flux density increases with frequency.
[36]

By operating at
higher frequencies, transformers can be physically more compact because a given core is able
to
transfer more power without reaching saturation and fewer turns are needed to achieve the same
impedance. However, properties such as core loss and conductor
skin effect

also incr
ease with
frequency. Aircraft and military equipment employ 400

Hz power supplies which reduce core
and winding weight.
[45]

Conversely, frequencies used for some
railway electrification systems

were much lower (e.g. 16.7

Hz and 25

Hz) than normal utility frequencies (50


60

Hz) for
historical reasons concerned mainly with
the limitations of early
electric traction motors
. As
such, the transformers used to step down the high over