Sei sulla pagina 1di 62

Er.

Zatin Gupta

REPORT BASED ON THE PROJECT

DESIGNED BY:

Er. ZATIN GUPTA


B.Tech. – INFORMATION TECHNOLOGY

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

INDEX

 Acknowledgement
 DTMF Signal
 Embedded System
 Microcontroller
 Introduction to Project
 Hardware used
 Block diagram
 Circuit Diagram
 Working Diagram of Project
 Keypad assignment
 91214B IC
 8870 IC
 AT89S52 IC
 ULN2004A IC
 Software used in Project
 Testing
 Hardware testing
 Software testing
 Application of project
 Further work
 Reference

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Acknowledgement

I take this opportunity to express my sincere


gratitude and indebtedness to respected Mr. Naveen
for allowing me to undertake this project training
under his kind guidance at EMTECH FOUNDATION
(www.emtech.in), New Delhi

I am indebted to the Mr. Naveen for providing expert


guidance, invaluable suggestions, inspirational
support throughout my project without which this
work would not have been in its present shape. He
took care to spare time for discussing the project in
spite of his busy schedule.

I thank everyone who has been linked to this project


in some way and those who have helped me in
presenting this report in the present form.

ZATIN GUPTA

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

DTMF Signal

Dual-tone multi-frequency (DTMF) signaling is used


for telephone signaling over the line in the voice-
frequency band to the call switching center. The
version of DTMF used for telephone tone dialing is
known by the trademarked term Touch-Tone, and is
standardized by ITU-T Recommendation Q.23. A
different version is used for signaling internal to the
telephone network.

DTMF is an example of a multi-frequency shift keying


(MFSK) system. Today DTMF is used for most call
setup to the telephone exchange, at least in
developed regions of the world, and trunk signaling
is now done out of band using the SS7 signaling
system. The in band trunk signaling tones were
different from the tones known as Touch-Tone with
a triangular matrix being used rather than a square
matrix.

History
DTMF was developed at Bell Labs in order to allow
dialing signals to dial long-distance numbers,
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

potentially over nonwire links such as microwave


links or satellites. Encoder/decoders were added at
the end offices that would convert the standard
pulse signals into DTMF tones and play them down
the line to the remote end office. At the remote site
another encoder/decoder would decode the tones
and perform pulse dialing. It was as if you were
connected directly to that end office, yet the
signaling would work over any sort of link. This idea
of using the existing network for signaling as well as
the message is known as in-band signaling.

DTMF tones were also used by some cable television


networks to signal the local cable company to insert
a local advertisement. These tones were often heard
during a station ID preceding a local ad inserts.
Terrestrial television stations also used DTMF tones
to shut off and turn on remote transmitters.

Keypad
When you press the buttons on the keypad, a
connection is made that generates two tones at the
same time. A "Row" tone and a "Column" tone. These
two tones identify the key you pressed to any
equipment you are controlling. If the keypad is on
your phone, the telephone company's "Central
Office" equipment knows what numbers you are
dialing by these tones, and will switch your call
accordingly. If you are using a DTMF keypad to

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

remotely control equipment, the tones can identify


what unit you want to control, as well as which
unique function you want it to perform.

1 2 3 697 Hz
4 5 6 770 Hz
7 8 9 852 Hz
* 0 # 941 Hz
1209 Hz 1336 Hz 1477 Hz

When you press the digit 1 on the keypad, you


generate the tones 1209 Hz and 697 Hz. pressing the
digit 2 will generate the tones 1336 Hz and 697 Hz.
Sure, the tone 697 is the same for both digits, but it
take two tones to make a digit and the telephone
company's equipment knows the difference between
the 1209 Hz that would complete the digit 1, and a
1336 Hz that completes a digit 2.

DTMF Event Frequencies

Low High
Event
frequency frequency
Busy signal 480 Hz 620 Hz
Dial tone 350 Hz 440 Hz
Ring back tone
440 Hz 480 Hz
(US)
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

The tone frequencies, as defined by the Precise


Tone Plan, are selected such that harmonics and
intermodulation products will not cause an
unreliable signal. No frequency is a multiple of
another, the difference between any two
frequencies does not equal any of the frequencies,
and the sum of any two frequencies does not equal
any of the frequencies. The frequencies were
initially designed with a ratio of 21/19, which is
slightly less than a whole tone. The frequencies may
not vary more than ±1.5% from their nominal
frequency, or the switching center will ignore the
signal. The high frequencies may be the same
volume or louder as the low frequencies when sent
across the line. The loudness difference between the
high and low frequencies can be as large as 3
decibels (dB) and is referred to as "twist".

Why not computer signals instead of DTMF

Radios are a particular animal. They are mostly


analog and they are optimized for voice signals.
DTMF was designed by the engineers to be in the
normal human voice range.
What this means is that DTMF passes transparently
over normal two-way radio channels. It doesn't
require special channel widths, or expensive
equipment. In most instances you can simply attach

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

a cable to the speaker output of your two-way radio


to a decoder, and it will be ready to go.
It’s straightforward, fast, and easy to understand,
works on most any type of radio, and gives the most
flexible features for the lowest cost!

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Embedded system

Introduction to embedded system:

Embedded system:
A hardware system which is designed to
perform a specific task in a particular time period,
e.g. mobile phones

Objectives of embedded system:

Embedded system is a hardware system which is


designed to perform a specific task in a particular
time period. E.g. mobile phones

Component in an embedded system are as:

Hardware
Input & Output
Software

Input devices are as:

 Sensors
 Keys
 Analog signals
 Pulses

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Output devices are:


LED, Relays, 7 segments displays,
LCD, motors, Serial data, Monitor, Opto coupler.

To design an embedded system following H\W & S\W


are used:

Software’s Hardware’s
Machine language Digital IC’s (driver,
decoder, MUX)
Assembly language linear IC’s (op amp,
ADC, DAC, comparator)
High level language Passive components
(L, C, R’s)
C, C++, java PCB, Relays,
Motors

Characteristics of embedded system:

 Perform a single set of functions.

 It works in a time constraint environment.

 Most of the embedded system avoids mechanical


moving parts because of friction & due to
friction losses are their & hence probability of
accuracy decreases.

 Embedded systems have low cost due to mars


production.
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Why I study Embedded System:

 Embedded systems are a rapidly growing field


where growth opportunities are numerous.
 Embedded system plays important roles in our
every day lives even though they might not
necessarily be visible.
 Some of the embedded systems I use every day.

Cell-phone a very common example of embedded


system

Basis components are:


 Keys
 LCD
 Memory Backup
 Some control unit

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Applications of Embedded Systems

 Consumer electronics, e.g., cameras,


camcorders,
 Consumer products, e.g., washers, microwave
ovens, ...
 Automobiles (anti-lock braking, engine control,
...)
 Industrial process controllers &
avionics/defense
Applications…
 Computer/Communication products, e.g.,
printers, FAX Machines…
 Emerging multimedia applications & consumer
electronics e.g. cell phones, personal digital
assistants…
Difference between Embedded System & General
Computing Platform

 An embedded system will have very few


resources compared to general purpose
computing systems like a desktop computer.
 The memory capacity and processing power in
an embedded system is limited where as
 It is more challenging to develop an application
in embedded system due to its constricted
environment as compared to developing the
same for a desktop system.
 Some embedded systems run a scaled down
version of operating system called an RTOS (real
time operating system).
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Microcontroller

Introduction to Microcontroller and its type

µC 8051

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Micro-controller can be of following types

 4 – Bit microcontroller
 8 – Bit microcontroller
 16 – Bit microcontroller
 32 – Bit microcontroller

4 – BIT MICROCONTROLLERS

 Most popular microcontroller made in terms of


production numbers
 Economical
 Application: appliances and toys

8 – BIT MICROCONTROLLERS

 Represent a transition zone between dedicated,


high-volume, 4-bit micro-controllers and the
high performance 16 bit microcontroller
 8 – Bit word size adequate for many computing
tasks and control or monitoring applications.
 Application: simple appliance control, high-
speed machine control, data collection

16 –BIT MICROCONTROLLERS

 Provide faster response and more sophisticated


calculations
 Applications: control of servomechanism like
robot arms
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

32 – BIT MICROCONTROLLERS

 Design emphasis is more on high speed


computation features and not on chip features
like RAM, ROM, Timers, etc
 Applications: robotics, highly intelligent
instrumentation, avionics, image
 processing, telecommunications, automobiles,
etc

Example: Intel 80960, ARM

Let’s focus on 8051 family of

 Introduced by Intel Corporation in 1981 as MCS


– 51. Main features of MCS – 51

Feature Quantity
ROM 4K bytes
RAM 128 bytes
Timer 2
I/O Pins 32
Serial port 1
Interrupt sources 6

 Intel allowed other manufacturers to make and


market any version of 8051 depending upon the
speed and on chip ROM
 All versions code compatible
Other members of the 8051 family: 8052, 8031

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

8052 MICROCONTROLLER
 Has all the features of 8051 along with extra
128 bytes of RAM, a timer and an extra 4K bytes
of on chip ROM
 8051 is upward compatible to 8052

8031 MICROCONTROLLER
 ROM-less 8051 i.e. contains 0 K bytes of on chip
ROM
 An external ROM must be added to make it
functional.

COMPARISON OF 8051 FAMILY MEMBERS

Feature 8051 8031 8052


ROM 4K 0K 8K
RAM(bytes) 128 128 256
Timers 2 2 3
I/O Pins 32 32 32
Serial Port 1 1 1
Interrupt Sources 6 6 8

VERSIONS OF 8051 µC

8751 microcontroller
4K bytes of on chip UV-EPROM require PROM burner,
as Ill as UV-EPROM to erase its contents and takes 20
min erase cycle.

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

AT89C51 from Atmel Corporation


On chip ROM flash memory, erase cycle in seconds,
furnish fast development.

DS5000 from Dallas Semiconductor


On chip ROM in form of NV-RAM form. In NV-RAM has
ability to change the ROM contents one byte at a
time.

OTP (one time programmable) version of the 8051


For mass production, low cost.

8051 family from Philips One of the largest


selections of 8051 microcontrollers, various features
like ADC, DAC, extended I/O, both OTP and flash.

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Introduction to Project

Project Description

Title
“A2Z Control System ”

Hardware used

To design the specified project I require the


following main hardware components.

DTMF encoder IC (91214b/91215b)

DTMF decoder IC (8870/9170)

One AT89S52 microcontroller

ULN 2004A IC

Nine keys for making a 3x3 key pad Matrix

LCD display

Two 12V Relays

9-0-9 V transformer for power supply

A PCB on which all the hardware is mounted

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Brief overview of peripherals attached

 DTMF Encoder (91214B) is used to generate a


DTMF tone when a key is pressed.
 DTMF Decoder (8870) is used to produce the BCD
code for each key tone.
 LCD is used to the display the no. of pressed
key.
 ULN2004A IC is used to operate relays.
 Relays are used to control any electrical
appliance except D.C. motor.

Subroutine and their working


LCD setup:
Keysense:
Key;
Display:
Cmdwrt:
Datwrt:
Delay:

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Features
 Keys for entering particular no.
 No. of corresponding key display on LCD
BLOCK DIAGRAM OF PROJECT

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

CIRCUIT DIAGRAM

Power supply

Keypad

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

DTMF Encoder

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

DTMF Decoder

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Microcontroller with LCD & ULN2004A

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Relays

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

WORKING DIAGRAM OF PROJECT

OFF STATE

ON STATE

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Keypad Assignment

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

DTMF encoder IC (91214b/91215b)

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

DTMF decoder IC (8870/9170)

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Pin Description

1 IN+ Non-inverting input Connections to the


front-end differential amplifier.

2 IN- Inverting input

3 GS Gain select. Gives access to output of front-


end amplifier for connection of feedback resistor.

4 VREF Reference voltage output (nominally


VDD/2). May be used to bias the inputs at mid-rail

5 INH* Inhibits detection of tones representing


keys A, B, C, and D

6 PD* Power down. Logic high powers down the


device and inhibits the oscillator. Internal pull down.

7 OSC1 Clock input 3.579545 MHz crystal


connected between these pins completes the
internal oscillator.

8 OSC2 Clock output

9 VSS Negative power supply (normally connected


to 0 V).

10 OE Tri-statable outputs enable (input). Logic high


enables the outputs Q1 - Q4. Internal pull-up

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

11-14 Q1, Q2, Q3, Q4 Tri-statable data outputs.


When enabled by OE, provides the code
corresponding to the last valid tone pair Received.
15 StD Delayed steering output. Presents logic
high when a received tone pair has been registered
and the output latch is updated. Returns to logic low
when the voltage on St/GT falls below VTSt

16 ESt Early steering output. Presents logic high


immediately when the digital algorithm detects a
recognizable tone pair (signal condition) any
momentary loss of signal condition will cause ESt to
return to a logic low.

17 St/GT Steering input/guard time output


(bidirectional). A voltage greater than VTSt detected
at St Causes the device to register the
Detected tone pair and update the output latch. A
voltage less than VTSt free the device to accept a
new tone pair. The GT output acts to reset the
external steering time constant and its state is a
function of EST and the voltage on St.

18 VDD Positive power supply. (Normally


connected to +5V.)

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

AT89S52 microcontroller

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Pin Description

VCC
Supply voltage.

GND
Ground

Port 0
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. Port 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 Pullups. Port 0 also receives the code bytes
during Flash programming and outputs the code
bytes during program verification. External pullups
are required during program verification.

Port 1
Port 1 is an 8-bit bidirectional I/O port with internal
pullups. The Port 1 output buffers can sink/source
four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal pullups 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 pullups. In addition, P1.0
and P1.1 can be configured to be the timer/counter
2 external count input (P1.0/T2) and the
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

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.

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)

Port 2
Port 2 is an 8-bit bidirectional I/O port with internal
pullups. 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 pullups and can
be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source
Current (IIL) because of the internal pullups 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 pullups when emitting 1s. During
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

accesses to external data memory that uses 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 programming and
verification.

Port 3
Port 3 is an 8-bit bidirectional I/O port with internal
pullups. 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 pullups and can
be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL)
because of the pullups. Port 3 also serves the
functions of various special features of the AT89S52,
as shown in the following table. Port 3 also receives
some control signals for Flash programming
And verification

Port Pin Alternate Functions


P3.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)
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

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

ALE/PROG
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 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. If desired, ALE operation can
be disabled by setting bit 0 of SFR 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.

PSEN
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
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

that two PSEN activations are skipped during each


access to external data memory.

EA/VPP
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.

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

XTAL2
Output from the inverting oscillator amplifier

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

ULN 2004A IC

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Logic Diagram

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

Pin Description

The ULN2001A, ULN2002A, ULN2003A, ULN2004A,


ULQ2003A, and ULQ2004A are high-voltage, high-
current Darlington transistor arrays. Each consists of
seven n-p-n Darlington pairs that feature high-
voltage outputs with common -cathode clamp diodes
for switching inductive loads. The collector-current
rating of a single Darlington pair is 500 mA. The
Darlington pairs can be paralleled for higher current
capability. Applications include relay drivers,
hammer drivers, lamp drivers, display drivers (LED
and gas discharge), line drivers, and logic buffers.
For 100-V (otherwise inter changeable) versions of
the ULN2003A and ULN2004A, see the SN75468 and
SN75469, respectively.
The ULN2001A is a general-
purpose array and can be used with TTL and CMOS
technologies. The ULN2002A is designed specifically
for use with 14-V to 25-V PMOS devices. Each input
of this device has a Zener diode and resistor in series
to control the input current to a safe limit. The
ULN2003A and ULQ2003A have a 2.7-kΩ series base
resistor for each Darlington pair for operation
directly with TTL or 5-V CMOS devices. The
ULN2004A and ULQ2004A have a 10.5-kΩ series base
resistor to allow operation directly from CMOS
devices that use supply voltages of 6 V to 15 V. The
required input current of the ULN/ULQ2004A is
below that of the ULN/ULQ2003A, and the required
voltage is less than that required by the ULN2002A.
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

SOFTWARE USED IN THE PROJECT

Software is the main part which performs all the


functions happening in the project i.e. when a key is
pressed then what happens at the back hand is
controlled by only the software & corresponding to
that what the action performed by controller itself
also specified in the software & output taken by user
by just operating it. There is no issue of
programming skills in user because it is only one
time burning process after that, it will continue with
its working.
This project is working on the software
made in “embedded C” language which is compiled
by the keil compiler ‘student version’.

Software of project is as defined below:

#include<reg51.h>
#define keyport P1
#define lcdport P3
#define relay P2
sbit rs=P2^0;
sbit en=P2^1;
void lcdsetup();
void keysense();
void key();
void display(int);
void cmdwrt();
void datwrt();
void delay(int);
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

char msg1[]={"KEY "};


int i;

void main()
{
lcdsetup();
while(1)
{
keysense();
}
}

void keysense()
{
keyport=0xef;
key();
keyport=0xdf;
key();
keyport=0xbf;
key();
keyport=0x7f;
key();
return;
}

void key()
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

{
if(keyport==0xee)
{
while(keyport==0xee);
display(1);
return;
}
else if(keyport==0xed)
{
while(keyport==0xed);
display(2);
return;
}
else if(keyport==0xeb)
{
while(keyport==0xeb);
display(3);
return;
}
else if(keyport==0xe7)
{
while(keyport==0xe7);
display(4);
return;
}
else if(keyport==0xde)
{
while(keyport==0xde);
display(5);
return;
}
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

else if(keyport==0xdd)
{
while(keyport==0xdd);
display(6);
return;
}
else if(keyport==0xdb)
{
while(keyport==0xdb);
display(7);
return;
}
else if(keyport==0xd7)
{
while(keyport==0xd7);
display(8);
return;
}
else if(keyport==0xbe)
{
while(keyport==0xbe);
display(9);
return;
}
else if(keyport==0xbd)
{
while(keyport==0xbd);
display(10);
return;
}
else
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

return;
}

void display(int b)
{
if(b==1)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='1';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==2)
{
lcdport=0x80;
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='2';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==3)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='3';
datwrt();
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==4)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='4';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==5)
{
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='5';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==6)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='6';
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==7)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='7';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==8)
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
lcdport='8';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
else if(b==9)
{
lcdport=0x80;
cmdwrt();
delay(1000);
for(i=0;i<3;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

lcdport='9';
datwrt();
delay(1000);
for(i=3;i<10;i++)
{
lcdport=msg1[4];
datwrt();
delay(1000);
}
}
}

void lcdsetup()
{
lcdport=0x38;
cmdwrt();
delay(10000);
lcdport=0x01;
cmdwrt();
delay(10000);
lcdport=0x0e;
cmdwrt();
delay(10000);
lcdport=0x80;
cmdwrt();
delay(10000);
return;
}

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

void cmdwrt()
{
rs=0;
en=0;
for(i=0;i<5;i++);
en=1;
return;
}

void datwrt()
{
rs=1;
en=0;
for(i=0;i<5;i++);
en=1;
return;
}

void delay(int p)
{
while(p!=0);
return;
}

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

HARDWARE TESTING

WITHOUT IC

Power off testing: in this testing module I have


checked continuity to all the peripherals mounted on
the PCB i.e. if there is any loose connection or
breakage in between connections then it must be
repaired.

Continuity in between

 Keypad & encoder


 Encoder & decoder
 Decoder with controller and LED’s
 Controller with LCD & ULN2004A
 ULN & Relays
 All the components connected to IC’s

 Keys must be short on pressing


 When key pressed then it short with
encoder pin
 Signal goes from encoder to decoder also
non distorted
 Output of decoder in BCD form supplied to
LED’s so, that connection also tight
 DTMF signal density does not attenuate by
the interference of supply voltage

Power on testing: in this module all the frequencies,


voltages, ground, +ve, -ve points checked i.e. is all
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

the requirements are fulfilled or not i.e. voltages &


frequencies supplied or generated by supply & CO is
right or not. In this:

Vcc=5v
Gnd=0v
Reset=0v initial & 5v pressed
EA=5v

WITH IC

With IC testing, power on testing type, in which IC


also mounted on its base & supply connected to
main. In this some parameters are observed which
are mentioned as below:

Vcc=5v
Gnd=0v
Reset= low-high-low
EA=5v
Crystal Oscillator: in this there are 2 parameters as
below
Voltage
Frequency
Voltage at 18 & 19 pin <=2v

Frequency=11.0592MHz

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

SOFTWARE TESTING

This is that testing module in which the hardware


components are tested by running software on them
to check only the connections and hardware. The
different hardware tested in this module is given as
with their software’s:

LCD

RELAYS

LCD

Liquid crystal display is used to display the key no.


and status of relays. To check this hardware the
software is as:

lcdport equ p0
rs bit p2.7
rw bit p2.5
en bit p2.6
clr rw

main:
acall lcdinit
acall display
sjmp main

Lcdinit:
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

mov lcdport, #038h ; 38H


ACTIVATES 2 LINES OF 16*2 LCD i.e. COLOUMS
acall commandwr
acall delay
mov lcdport,#01h ;CLRSCR
acall commandwr
acall delay
mov lcdport,#0eh ;DISPLAY &
CURSOR ON
acall commandwr
acall delay
mov lcdport,#80h ;80H IS FIRST
LOC OF CURSOR
acall commandwr
acall delay
ret

commandwr:
clr rs
setb en ;HIGH
ENABLE
nop
nop
nop
clr en ;RESET
ENABLE
ret

display:

mov lcdport,#'Z'
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

acall datawr
acall delay
Mov lcdport,#'A'
acall datawr
acall delay
mov lcdport,#'T'
acall datawr
acall delay
mov lcdport,#'I'
acall datawr
acall delay
mov lcdport,#'N'
acall datawr
acall delay
ret

datawr:
setb rs ;SET REG SELECT
setb en ;SET ENABLE
nop
nop
nop
clr en ;CLEAR ENABLE
ret

delay:
mov r5,#100d
lp2: mov r6,#10d
lp1: mov r7,#100d
lp0: djnz r7,lp0
djnz r6,lp1
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

djnz r5,lp2
ret

RELAYS

Relays are used to control electrical appliances


connected with this project. The relays connected
are SPDT relays hence not control DC motor so to
control DC motor we require DPDT relays hence
these relays can control all appliances except DC
motor. To check this hardware the software is as:

For first relay

relay bit p2.4


main:
mov relay,#0f7h
acall delay
mov relay,#0fbh
acall delay
mov relay,#0fdh
acall delay
mov relay,#0feh
acall delay
sjmp main

delay:
MOV R5,#20d
lp2: MOV R6,#200d
lp1: MOV R7,#250d
lp0: djnz R7,lp0
http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

djnz R6,lp1
djnz R5,lp2
Ret

For second relay

relay bit p2.5


main:
mov relay,#0f7h
acall delay
mov relay,#0fbh
acall delay
mov relay,#0fdh
acall delay
mov relay,#0feh
acall delay
sjmp main

delay:
MOV R5,#20d
lp2: MOV R6,#200d
lp1: MOV R7,#250d
lp0: djnz R7,lp0
djnz R6,lp1
djnz R5,lp2
Ret

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

APPLICATION OF PROJECT

As stated above that I have made a project on


telecomm. This controls home appliances. Title of
the project is

“A2Z Control System “

Hence as the name suggest this project has many


applications in today life as mentioned below:

Controlling home appliances for power saving


operations.

It creates automatic controlling the power in


the field of switching the appliances.

This is the idea which done the multiplexing of


telecomm with electrical field i.e. Using
telecomm controlling the electrical
instruments

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

FURTHER WORK

There is another 3 steps which are applicable over


this project they are as mentioned as below:

 The next applicable step is: make it wireless i.e.


keypad and relays are independently wireless
using IR transmitters and receivers.

 Next to next step is: connects with the working


telephone line. Now their IC which generates
telephone tone i.e. DTMF Tone

 Last but not the least step is: make it


completely wireless i.e. now it connects with
home telephone line and when ever there is call
happening by a particular mobile then the
mobile no. traces by controller if it is right then
the procedure further proceeds and got the
instructions by mobile.

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)
Er. Zatin Gupta

REFERENCE

To complete this project successfully I need to refer


with many websites and books some of them are as
mentioned below:

Websites
 www.google.com
 www.howstuffworks.com
 www.alldatasheet.com
 www.dogpile.com
 www.electroguys.com
 www.wikipedia.com
 www.efy.com

Books
 Mazidi
 Programming & customizing the PIC &
microcontrollers ( e-book)

http://zatin.gupta2000.googlepages.com

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

Potrebbero piacerti anche