Electronics and Communications Engineering: Innovative Hidden Things Locator Using Wireless Technology

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Geethanjali College of Engineering & Technology

A
Mini Project Report
on
INNOVATIVE HIDDEN THINGS LOCATOR USING
WIRELESS TECHNOLOGY

Submitted to Jawaharlal Nehru Technological University Hyderabad in Partial fulfillment of


the requirements for the award of degree

Bachelor of Technology

In

ELECTRONICS AND COMMUNICATIONS ENGINEERING


By

M.Chandana (17R15A0448)

Under the Esteemed Guidance of

Mr.U.APPALA RAJU
Assoc.Professor

Department of Electronics and Communication Engineering


Geethanjali College Of Engineering & Technology
(Permanently Affiliated to JNTU Hyderabad,Accredited By NBA)

Cheeryal(V),Keesara(M),RR Dist,Hyderabad-501301.

2016-2020
Geethanjali College of Engineering & Technology

ACKNOWLEGMENTS

I express my profound thanks to the management of GEETHANJALI COLLEGE OF ENGINEERING


& TECHNOLOGY for providing the facilities in carrying this project.

I am extremely grateful to Mr.U.Appala Raju, Associate Professor in ECE Department, Mini


Project Guide, for his unflinching cooperation throughout the project.

I am thankful to Dr. C. V. Narasimhulu, Professor in ECE Department, Project Coordinator, for


his cooperation throughout the project.

I express my gratitude to B.Hari Kumar, HOD,ECE Department, for his kind assistance with
timely suggestions and indispensable help, whose cooperation has made this project feasible.

I am thankful to Principal, Dr.S.UDAYA KUMAR, for the wonderful guidance and


encouragement given to us to move ahead in the execution of this project.

Last but not least I am thankful all the teaching and non-teaching staff members of ECE
Department who directly or indirectly helped us in successful completion of the project.

M.Chandana(17R15A0448)
Geethanjali College of Engineering & Technology

DECLARATION

I hereby declare that the Mini Project entitled “INNOVATIVE HIDDEN THINGS LOCATOR
USING WIRELESS TECHNOLOGY”being submitted in partial fulfillment of the academic
requirement as a record of the bonafide work carried out by us.

PLACE: Hyderabad

DATE: (Signature of the Candidate)

M.Chandana(17R15A0448)
Geethanjali College of Engineering & Technology

CERTIFICATE

This is to certify that M.Chandana(17R15A0448) student of ECE Branch,GEETHANJALI COLLEGE


OF ENGINEERING & TECHNOLOGY,have successfully completed the Mini Project entitled
“INNOVATIVE HIDDEN THINGS LOCATOR USING WIRELESS TECHNOLOGY”for the academic
Year 2019-20 as part of curriculum work.

Mr.U. APPALA RAJU PROF.B. HARIKUMAR


INTERNAL GUIDE Head of the Department
Assoc Professor

Internal Examiner External Examiner


Geethanjali College of Engineering & Technology

ABSTRACT

In this busy and competition world man has to be very fast. Due to some tensions and
hurriedness, he/she is forgetting some daily needed things like keys, TV remote, purse, etc
where they are placed. The person has to spend some time to search those things and in this
process he will get more frustrated and becomes tenser. To avoid such situations this project
is been developed.
By using advancement in technology, especially in wireless technology we can give good
solution for this with simple design. In this we use 433 MHz RF transmitter and receiver. We
attach one receiver to each device with RF decoder and also each device contains one buzzer.
The transmitter is fixed at one place in the house. At the transmitter side we have
microcontroller, RF transmitter, RF encoder, device selection switches.
If the person forgets any device where it is placed, we have to press that device key in
the transmitter section, by which it will send signal to that particular device. Whenever receiver
of that particular device receives the signal from transmitter, it decodes the information and if
the data is matched then that device buzzer will be activated indicating the location of that
particular device.
For demonstration purpose the module is constructed for two devices only. Depending
on the requirement, it can be enhanced to any number of devices. The required power supply
for the transmitter section is derived from the mains and for the receiver sections, supply is
provided through small batteries
Geethanjali College of Engineering & Technology

CONTENTS
SI.No Topic Page No
1. Introduction 1
2. Block Diagram 3
3. Function of RF Transmitter And
Receiver 4
3.1Circuit of Transmitter Unit 6
3.2Pin Description of Transmitter 7
3.3The RF Receiver Unit 8
4.Description About 89C2051 Controllers 10
4.1Pin Description 10
4.2Oscilllator Characteristics 12
5.Description About 89C51 Microcontroller 13
5.1Introduction 13
5.2Necessity Of Microcontrollers 13
5.3Advantages of Microcontrollers 13
5.4Features of 8051 Architecture 14
5.58051 micro controller Arichitecture 15
5.6PIN DIAGRAM of 89C51 16
5.7Functional block diagram of micro controller 17
5.8types of memory 19
5.9Special Function registered memory 20
5.10INTERRUPTS 25
6.Breief Description About RF Communications 27
6.1General Physics of radio signal 27
6.2what is RF? 27
6.3Frequency band description 28
6.4why operate at higher frequency? 30
6.5working of RF communication system 31
7. Power Source Description 35
Geethanjali College of Engineering & Technology

7.1Introduction 35
7.2Transformers 36
7.3Rectifiers 37
7.4Filters 38
7.5Regulators 39
8.software Description with chip Burning process 41
8.1chip Burning process 42
9.Source Code 46
10.Hardware Details 49
11.Conclusions and References 51
Geethanjali College of Engineering & Technology

LIST OF FIGURES

Figure PARTICULARS PAGE


No. No:
2.1 Block diagram of hidden things 3
locator using wireless technology
3.2 Pin description of Transmitter 7
3.3(a) RF Receiver unit 8
3.3(b) RF Antenna 9
4.1 Pin Description 10
5.6 40 pin Diagram 16
5.7 Functional block diagram of 17
microcontroller
5.7 8051 oscillator and clock diagrams 19
7.1 Block diagram of power supply 35
7.2 Transformer 36
7.5(a) Voltage regulator 39
7.5(b) Circuit diagram of power supply 40
Geethanjali College of Engineering & Technology

LIST OF TABLES
TABLES NO PARTICULAR PAGE NO.
5.9(a) PCON power control 21
5.9(b) TCON Timer control 22
5.9(c) TMOD Timer mode 22
5.9(d) IE(Interrupt enable) 24
5.9(e) IP(Interrupt priority) 24
5.9(f) PSW power status 25
5.10 INTERRUPTS 26
6.3(a) Frequency band Description 28
6.3(b) Frequency band 30
7.3 Types of rectifier 37
Geethanjali College of Engineering & Technology

1.INTRODUCTION
An item locator is a device which functions to locate preselected items that is remote
from a user. The device comprises two parts; a transmitting device and multiple sensors/chips
(receivers) which are applied to objects the user desires to locate. The transmitting section
contains a control panel selector buttons for each multiple sensors/chip (receiver) it is desired
to locate. When a preselected button is depressed, the transmitter sends signal containing
preselected code. The signal is received by the receivers in each multiple sensors/chip. The
receivers in each multiple sensors/chip reads the code and if a match is obtained, that
particular receiver enables the alarm in the multiple sensors/chip to indicate the device. The
multiple sensors/chip has an attachment device permitting attachment to various articles to
be found. The transmitting section and multiple sensors/chip (receiving sections) are
powered by suitable power source.

The present invention relates to location of hidden items. More particularly, the
present invention relates to location of an item with a remote location device. Consumer
electronic devices such as TVs, VCRs, satellite receivers have optional remote controls which
are separate from the major device, and other articles such as keys, glasses, articles of
clothing and generally items which are hand carried by a person are prone to misplacement.
Often, while not lost, the items are concealed by furniture or other objects, or simply placed
in an unusual location where the owner has difficulty in locating them. What is needed is a
device which permits the owner to locate the hidden objects. So, as a solution for this, the
project is designed to locate the devices/items.

Numerous innovations for an Item Locator with Attachable Receiver/Transmitter have


been provided in the prior art that are described as follows. Even though these innovations
may be suitable for the specific individual purposes to which they address, they differ from
the present invention as hereinafter contrasted.

The entire circuit is designed with single 89C51 microcontroller & this controller is
playing major role in this project work; this chip belongs to Atmel family & offers many latest
expectations. This is an 8- bit controller widely used for instrumentation technology. This
microcontroller is the integration of a microprocessor having 4kb memory, 32 I/O lines,
timers, ROM, etc. on a single chip. As this chip is having four ports, lot of electronic hard ware

Page 1
Geethanjali College of Engineering & Technology

can be interfaced with this single chip. Its high-density non-volatile memory compatible with
standard MCS-51 instruction set makes it a powerful controller that provides highly flexible
and cost effective solution to control applications. Micro-controller works according to the
program written in it. The program is written in such a way, so that the Micro controller can
read and it can store the information received from the keyboard. Micro-controllers are
"Embedded" inside some other device so that they can control the features or actions of the
product. Another name for a micro-controller is "embedded controller". Micro-controllers are
dedicated to one task and run one specific program. The program is stored in ROM (read-only
memory) and generally does not change. Micro-controllers are often low-power devices.

The controller used here is belongs to 8051 family architecture & often it is referred
to as MCS-51. This microcontroller is having an 8-bit data bus. In this family some of the
controllers are capable of addressing 64K of program memory and a separate 64K of data
memory. The 8051 has 4K of code memory implemented as on-chip Read Only Memory
(ROM). The 8051 has 128 bytes of internal Random Access Memory (RAM). The 8051 has two
timer/counters, a serial port, 4 general purpose parallel input/output ports, and interrupt
control logic with five sources of interrupts. Besides internal RAM, the 8051 has various
Special Function Registers (SFR), which are the control and data registers for on-chip facilities.
The SFR’s also include the accumulator, the B register, and the Program Status Word (PSW),
which contains the CPU flags. Programming the various internal hardware facilities of the
8051 is achieved by placing the appropriate control words into the corresponding SFR’s.

As stated, the 8051 can address 64K of external data memory and 64K of external
program memory. These may be separate blocks of memory, so that up to 128K of memory
can be attached to the microcontroller. Separate blocks of code and data memory are
referred to as the Harvard architecture. The 8051 has two separate read signals, RD# and
PSEN#. The first is activated when a byte is to be read from external data memory, the other,
from external program memory. Both of these signals are so-called active low signals. That is,
they are cleared to logic level 0 when activated. All external code is fetched from external
program memory. In addition, bytes from external program memory may be read by special
read instructions such as the MOVC instruction.

Page 2
Geethanjali College of Engineering & Technology

2.BLOCK DIAGRAM OF HIDDEN THINGS LOCATOR


USING WIRELESS TECHNOLOGY
Antenna

RF Transmitter
keys

Microcontroller unit Designed with 89C51/52

5V ALARM
+5V
Regulator

_
+ AT 89C2051
9V RF
Battery Microcontroller used as
RECIEVER
Data Transmitter

5V ALARM
+5V
Regulator

_
+ AT 89C2051
9V RF
Battery Microcontroller used as
RECIEVER
Data Transmitter

fig:2.1 Block Diagram of hidden things locator using wireless technology

Page 3
Geethanjali College of Engineering & Technology

3.FUNCTION OF RF TRANSMITTER AND RECEIVER


The data-transmitting unit including 89C51 microcontroller is designed to operate at
5V DC, therefore the supply is derived from the mains. A small keyboard designed with 2 keys
is interfaced with this microcontroller. This keyboard is designed to generate the data that is
stored in RAM and it is delivered through output pin of the controller (transmitter). The
output of the microcontroller is modulated at 433.92 MHz frequency produced by the RF
transmitter, transmits the binary data to space in a particular range based on the antenna
used. Any digital data generated by the keyboard is transmitted as it is, once the key is pressed
in the transmitter, binary data is transmitted and according to that data, the receiving
controller unit has to be programmed.

The main function of the data transmitting section is to generate 8-bit binary code that is
to be transmitted through RF transmitter. The 8-bit binary code produced by the keyboard is
fed to microcontroller, which functions as encoder; the data obtained from the keyboard is
stored and it is converted into 8-bit information which is transmitted through amplified
modulated input signal. If any key is pressed; that information is converted into 8-bit data.
For example, if No.1 key is pressed, 00000001 code is generated. Likewise each key function
differs from another key to generate a different 8-bit code. Based on this code, the other
microcontroller 89c2051 used in the receiving modules, designed as 8-bit code decoder,
decodes this data and compares with the pre-defined program prepared in assembly
language and activates the alarm if data is matched.

The output of the (Encoder) microcontroller is fed to RF transmitter, for radiating the
pulsating energy into air. The function of a radio frequency (RF) transmitter is to modulate,
up convert, and amplify signals for transmission into free space. An RF transmitter generally
includes a modulator that modulates an input signal and radio frequency power amplifier that
coupled to the modulator to amplify the modulated input signal. The radio frequency power
amplifier is coupled to an antenna that transmits the amplified modulated input signal.

The RF transmitter used in our project is TWS-434A. This RF transmitter transmits data in
the frequency range of 433 MHz with a range of approximately 50-feet (open area) outdoors.
Indoors, the range is approximately 20 feet, and will go through most walls, TWS-434A has

Page 4
Geethanjali College of Engineering & Technology

features which includes small in size, low power consumption i.e. 8mW and operate from 1.5
to 12volts DC, excellent for applications requiring short-range RF signal. Data to be send
amplitude modulation with the carrier RF signal.

The data receiving module consist RF receiver that is interfaced with the 89C2051
microcontroller as source of information at the receiving side and activates the alarm
according to the information received.

The RF signal transmitted by the transmitter is detected and received by this section of
the receiver. This binary encoder data is sent to the decoder for decoding the original data.
The receiver receives an RF signal, converts the RF signal to an IF signal, and then converts
the IF signal to a base band signal, which is then provides to the base band processor. As is
also known, RF transceivers typically include sensitive components susceptible to noise and
interference with one another and with external sources. The RF receiver is coupled to the
antenna and includes a low noise amplifier, one or more intermediate frequency stages, a
filtering stage, and a data recovery stage. The low noise amplifier receives an inbound RF
signal via the antenna and amplifies it.

The RF receiver used is RWS-433. This RF receiver receives RF signal, which is in the
frequency of 433 MHz and has a sensitivity of 3uV. The RWS-433 receiver operates from 4.5
to 5.5 volts-DC, and has both linear and digital outputs and its tunable to match the frequency
of the transmitter unit.

The program is fixed, it cannot be changed, depending up on the program prepared


for controller, and the information produced by the keyboard at transmitting end, the
received information if it is tallied with the pre-defined program, then the microcontroller at
receiving end displays the digit information automatically in the seven segment display.

The main components present in the transmitting unit are the push buttons (keys),
micro controller (89C51), RF transmitter and a power supply to all these components. As
mentioned earlier, only 2 keys (push buttons) are used for locating the two different devices
and these are interfaced with the 89C51 micro controller. Depending on the key pressed, the
controller generates a unique code which is fed to the RF transmitter for modulation. The
detailed explanation about the RF transmitter is provided below.

Page 5
Geethanjali College of Engineering & Technology

Radio frequency (RF) transmitters are widely used in radio frequency communications
system. With the increasing availability of efficient, low cost electronic modules, mobile
communication system are becoming more and more widespread. A terminal apparatus used
in the radio communications system receives a radio frequency signal transmitted from a base
station, by an antenna, inputs the signal to a receiving radio-frequency unit via an antenna
duplexer, high frequency amplifies the signal, removes unnecessary waves outside the
receiving band from the signal, converts the signal to an intermediate frequency signal,
demodulates the intermediate frequency signal by a demodulator, and converts the signal
into a base band signal.

Generally, a radio transmitter is used for performing a radio transmission operation,


whereby a high frequency signal outputted from a modulator is transmitted to an antenna of
the radio transmitter and is transmitted there from to a remote radio transmitter thereby a
signal is transmitted.

The transmitting base band signal is subjected to a predetermined signal process, input
to a modulator, which modulates a carrier wave signal. The modulated carrier wave signal is
converted into a radio frequency by a transmitting radio-frequency circuit and amplified to a
predetermined transmitting power, and transmitted to the base station from the antenna via
the duplexer. Communication systems are known to support wireless and wire lined
communications between wireless and /or wire lined communication devices.

The function of a radio frequency (RF) transmitter is to modulate, up convert, and


amplify signals for transmission into free space. An RF transmitter generally includes a
modulator that modulates an input signal and a radio frequency power amplifier that is
coupled to the modulator to amplify the modulated input signal. The radio frequency power
amplifier is coupled to an antenna that transmits the amplified modulated input signal. Power
amplifiers are required in radio telecommunication system to amplify signals before
transmitting, because a radio signal attenuates on the radio path.

3.1.Circuit of transmitter unit:

For efficiently, the amplifier is often a non-linear amplifier operated near its peak capacity. To
avoid distortion of the transmitted signals due to the non-linearity, the signals are pre-

Page 6
Geethanjali College of Engineering & Technology

distorted by a pre-distorter before they are transmitted. The pre-distortion is required to


prevent transmitter from transmitting signals on channel bands other than the band assigned
to the transmitter. The pre-distortion values are chosen such that the product values entering
the power amplifier will be distorted by the power amplifier to return to a substantially linear
amplification of the modulated signals.

A direct conversion transmitter system to produce a transmission signal is generally


comprised of a low oscillator (LO), a phase locked loop (PLL), a quadrature generator, a
modulator, a power amplifier (PA), and one or more filters. The low oscillator, coupled to the
PLL, produces a signal with a frequency that is substantially equal to the frequency of a desired
RF transmission signal. The quadrature generator is coupled to the low oscillator and the
modulator.

The PA is coupled to the quadrature generator, and receives the transmission signal
and amplifies it. The amplified signal may go through a filter to reduce noise or spurious
outputs outside of the transmission band.

3.2.Pin description of Transmitter:


Pin 1: Ground (-5V)
Pin 2: input pin for data from encoder
Pin3: supply (+5V)
Pin4: pin for external RF antenna

Fig:3.2 Pin description of Transmitter

Page 7
Geethanjali College of Engineering & Technology

3.3.THE RF RECEIVER UNIT:

Receivers for communication systems generally are designed such that they are tuned
to receive one of a multiplicity of signals having widely varying bandwidths and which may
fall within a particular frequency range. The RF receiver receives an RF signal, converts the RF
signal to an IF signal, and then converts the IF signal to a base band signal, which it then
provides to the base band processor. As is also known, RF transceivers typically include
sensitive components susceptible to noise and interference with one another and with
external sources.

The receiver unit is present with the device/item. This unit consists of RF receiver, micro
controller (89C2051), alarm and battery to provide power supply to all these devices.

The RF receiver is coupled to the antenna and includes a low noise amplifier, one or more
intermediate frequency stages, a filtering stage, and a data recovery stage. The low noise
amplifier receives an inbound RF signal via the antenna and amplifies it.

The one or more intermediate frequency stages mix the amplified RF signal with one or
more local oscillations to convert the amplified RF signal into a base band signal or an
intermediate frequency (IF) signal.

Fig:3.3(a) The RF Receiver unit

Page 8
Geethanjali College of Engineering & Technology

Pin 1: ground (-5V)


Pin 2: output pin for digital data received
Pin 3: output pin for analog data received
Pin 4: supply (+5V)
Pin 6 & 7: ground (-5V)
Pin 8: pin for external RF Antenna

Fig:3.3(b) RF Antenna

Page 9
Geethanjali College of Engineering & Technology

4.DESCRIPTION ABOUT 89C2051 CONTROLLERS

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with


2K bytes of Flash programmable and erasable read only memory (PEROM). The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is compatible
with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with
Flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides
a highly-flexible and cost-effective solution to many embedded control applications.

The AT89C2051 provides the following standard features: 2K bytes of Flash, 128
bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and
clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to
continue functioning. The power-down mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.

4.1Pin Description

VCC

Supply voltage.

GND

Ground.

Port 1

Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0
and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and
the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port

Page 10
Geethanjali College of Engineering & Technology

1 output buffers can sink 20 mA and can drive LED displays directly. When 1s are written to
Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are
externally pulled low, they will source current (IIL) because of the internal pull-ups. Port 1 also
receives code data during Flash programming and verification.

Port 3

Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6
is hard-wired as an input to the output of the on-chip comparator and is not accessible as a
general purpose I/O pin. The Port 3 output buffers can sink 20 mA. 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 also serves the functions of various special features of the AT89C2051 as listed
below:

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)

Port 3 also receives some control signals for Flash programming and verification.

RST

Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high
for two machine cycles while the oscillator is running resets the device. Each machine cycle
takes 12 oscillator or clock cycles.

Page 11
Geethanjali College of Engineering & Technology

Each machine cycle takes 12 oscillator or clock cycles. XTAL1 Input to the inverting
oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the
inverting oscillator amplifier.

4.2. Oscillator Characteristics

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can
be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz c r y s t a l
or ceramic resonator may be used. To drive the device from an external clock source, XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maxim u m voltage
high and low time specifications must be observed.

Port 3 also receives some control signals for Flash programming and verification. RST
Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for
two machine cycles while the oscillator is running resets the device.

Page 12
Geethanjali College of Engineering & Technology

5. DESCRIPTION ABOUT 89C51 MICROCONTROLLERS

5.1. INTRODUCTION

A Micro controller consists of a powerful CPU tightly coupled with memory, various
I/O interfaces such as serial port, parallel port timer or counter, interrupt controller, data
acquisition interfaces-Analog to Digital converter, Digital to Analog converter, integrated on
to a single silicon chip. If a system is developed with a microprocessor, the designer has to go
for external memory such as RAM, ROM, EPROM and peripherals.

Intel has introduced a family of Micro controllers called the MCS-51.The


microcontroller plays the major role in any embedded project. In this my project we use two
microcontrollers they are made by the ATMEL Company. That is AT89S52/51.

5.2. NECESSITY OF MICROCONTROLLERS

Microprocessors brought the concept of programmable devices and made many


applications of intelligent equipment. Most applications, which do not need large amount of
data and program memory, tended to be costly.

The microprocessor system had to satisfy the data and program requirements so;
sufficient RAM and ROM are used to satisfy most applications. The peripheral control
equipment also had to be satisfied. Therefore, almost all-peripheral chips were used in the
design. Because of these additional peripherals cost will be comparatively high.

5.3. ADVANTAGES OF MICRO CONTROLLERS

1. If system is developed with a microprocessor, the designer has to go for external memory
such as RAM, ROM or EPROM and peripherals and hence the size of PCB will be large enough
to hold all the required peripherals. But the micro controller has got all this peripheral facility
on a single chip o development of a similar system with a micro controller reduces PCB size
and cost of the design.

Page 13
Geethanjali College of Engineering & Technology

2. One of the major differences between a micro controller and a microprocessor is that a
controller often deals with bits, not bytes as in the real world application, for example switch
contacts can only be open or close, indicators should be lit or dark and motors can be either
turned on or off and so forth.

The system requirements and control specifications clearly rule out the use of 16,
32- or 64-bit micro controllers or microprocessors. Systems using these may be earlier to
implement due to large number of internal features. They are also faster and more reliable
but, the above application is satisfactorily served by 8-bit micro controller. Using an
inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive
market place.

5.4. FEATURES OF 8051 ARCHITECTURE

• Optimized 8 Bit CPU for control applications and extensive Boolean processing
capabilities.

• 64K Program Memory address space.

• 64K Data Memory address space.

• 128 bytes of on chip Data Memory.

• 32 Bi-directional and individually addressable I/O lines.

• Two 16-bit timer/counters.

• Full Duplex UART.

• 6-source / 5-vector interrupt structure with priority levels.

• On chip clock oscillator.

Now we may be wondering about the non-mentioning of memory space meant for
the program storage, the most important part of any embedded controller. Originally
these 8051 architectures were introduced with on-chip, ‘one time programmable’
version of Program Memory of size 4K X 8.

Page 14
Geethanjali College of Engineering & Technology

Intel delivered all these microcontrollers (8051) with user’s program fused
inside the device. The memory portion was mapped at the lower end of the Program
Memory area. But, after getting devices, customers couldn’t change anything in their
program code, which was already made available inside during device fabrication.

5.5.8051 micro controller architecture

The 8051 architecture consists of these specific features:

• Eight –bit CPU with registers A (the accumulator) and B

• Sixteen-bit program counter (PC) and data pointer (DPTR)

• Eight- bit stack pointer (PSW)

• Eight-bit stack pointer (SP)

• Internal ROM or EPROM (8751) of 0(8031) to 4K (8051)

• Internal RAM of 128 bytes:

1. Four register banks, each containing eight registers

2. Sixteen bytes, which may be addressed at the bit level

3. Eighty bytes of general- purpose data memory

• Thirty –two input/output pins arranged as four 8-bit Ports:P0-p3

• Two 16-bit timer/counters: T0 and T1

• Full duplex serial data receiver/transmitter: SBUF

• Control registers: TCON, TMOD, SCON, PCON, IP, and IE

• Two external and three internal interrupts sources.

• Oscillator and clock circuits.

Page 15
Geethanjali College of Engineering & Technology

5.6.PIN DIAGRAM

Fig:5.6 PIN DIAGRAM OF 89C51 IC

Page 16
Geethanjali College of Engineering & Technology

5.7. FUNCTIONAL BLOCK DIAGRAM OF MICROCONTROLLER

Fig:5.7 Functional block diagram of micro controller

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 writes strobe)

Page 17
Geethanjali College of Engineering & Technology

P3.7 -RD (external data memory read strobe)

VCC: -Supply voltage

VSS: -Circuit ground potential

All four ports in the 89C51 are bidirectional. Each consists of a latch (Special Function
Registers P0 through P3), an output driver, and an input buffer. The output drivers of Ports 0
and 2, and the input buffers of Port 0, are used in accesses to external memory. In this
application, Port 0 outputs the low byte of the external memory address, time-multiplexed
with the byte being written or read. Port 2 outputs the high byte of the external memory
address when the address is 16 bits wide. Otherwise, the Port 2 pins continue to emit the P2
SFR content.

All the Port 3 pins are multifunctional. They are not only port pins, but also serve the
functions of various special features as listed below:

Port Pin Alternate Function

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt)

P3.3 INT1 (external interrupt)

P3.4 T0 (Timer/Counter 0 external input)

P3.5 T1 (Timer/Counter 1 external input)

P3.6 WR (external Data Memory write strobe)

P3.7 RD (external Data Memory read strobe)

Page 18
Geethanjali College of Engineering & Technology

The 8051 Oscillator and Clock

The heart of the 8051 circuitry that generates the clock pulses by which all the internal all
internal operations are synchronized. Pins XTAL1 And XTAL2 is provided for connecting a
resonant network to form an oscillator. Typically, a quartz crystal and capacitors are
employed. The crystal frequency is the basic internal clock frequency of the microcontroller.
The manufacturers make 8051 designs that run at specific minimum and maximum
frequencies typically 1 to 16 MHz

Fig:5.7 Oscillator and timing circuit

5.8. Types of memory

The 8051 have three general types of memory. They are on-chip memory, external
Code memory and external Ram. On-Chip memory refers to physically existing memory on
the micro controller itself. External code memory is the code memory that resides off chip.

Page 19
Geethanjali College of Engineering & Technology

This is often in the form of an external EPROM. External RAM is the Ram that resides off chip.
This often is in the form of standard static RAM or flash RAM.

Code memory

Code memory is the memory that holds the actual 8051 programs that is to be run. This
memory is limited to 64K. Code memory may be found on-chip or off-chip. It is possible to
have 4K of code memory on-chip and 60K off chip memory simultaneously. If only off-chip
memory is available then there can be 64K of off chip ROM. This is controlled by pin provided
as EA.

Internal RAM

The 8051 have a bank of 128 bytes of internal RAM. The internal RAM is found on-chip. So, it
is the fastest Ram available. And also, it is most flexible in terms of reading and writing.
Internal Ram is volatile, so when 8051 is reset, this memory is cleared. 128 bytes of internal
memory are subdivided. The first 32 bytes are divided into 4 register banks. Each bank
contains 8 registers. Internal RAM also contains 128 bits, which are addressed from 20h to
2Fh. These bits are bit addressed i.e. each individual bit of a byte can be addressed by the
user. They are numbered 00h to 7Fh. The user may make use of these variables with
commands such as SETB and CLR.

5.9. Special Function registered memory

Special function registers are the areas of memory that control specific functionality
of the 8051-micro controller.

Accumulator (0E0h)

As its name suggests, it is used to accumulate the results of large no of instructions. It can
hold 8 Bit values.

Page 20
Geethanjali College of Engineering & Technology

B register (0F0h)

The B register is very similar to accumulator. It may hold 8-bit value. The b register is only
used by MUL AB and DIV AB instructions. In MUL AB the higher byte of the product gets stored
in B register. In div AB the quotient gets stored in B with the remainder in A.

Stack pointer (81h)

The stack pointer holds 8-bit value. This is used to indicate where the next value to
be removed from the stack should be taken from. When a value is to be pushed onto the
stack, the 8051 first stores the value of SP and then store the value at the resulting memory
location. When a value is to be popped from the stack, the 8051 returns the value from the
memory location indicated by SP and then decrements the value of SP.

Data pointer

The SFRs DPL and DPH work together work together to represent a 16-bit value called
the data pointer. The data pointer is used in operations regarding external RAM and some
instructions code memory. It is a 16-bit SFR and also an addressable SFR.

Program counter

The program counter is a 16 Bit register, which contains the 2 byte address, which tells
the 8051 where the next instruction to execute to be found in memory. When the 8051 is
initialized PC starts at 0000h. And is incremented each time an instruction is executes. It is
not addressable SFR.

PCON (power control, 87h)

Table:5.9(a) PCON Power Control,87h

Page 21
Geethanjali College of Engineering & Technology

The power control SFR is used to control the 8051’s power control modes. Certain operation
modes of the 8051 allow the 8051 to go into a type of “sleep mode” which consumes much
less power

TCON (timer control, 88h)

The timer control SFR is used to configure and modify the way in which the 8051’s two
timers operate. This SFR controls whether each of the two timers is running or stopped and
contains a flag to indicate that each timer has overflowed. Additionally, some non-timer
related bits are located in TCON SFR. These bits are used to configure the way in which the
external interrupt flags are activated, which are set when an external interrupt occurs.

Table:5.9(b) TCON Timer Control,88h

TCON REGISTERS

TMOD (Timer Mode, 89h)

The timer mode SFR is used to configure the mode of operation of each of the two
timers. Using this SFR your program may configure each timer to be a 16-bit timer, or 13 Bit
timer, 8-bit auto reload timer, or two separate timers. Additionally you may configure the
timers to only count when an external pin is activated or to count “events” that are indicated
on an external pin.

Table:5.9(c) TMOD (Timer Mode,89h)

Page 22
Geethanjali College of Engineering & Technology

TO (Timer 0 low/high, address 8A/8C h)

These two SFR’s taken together represent timer 0. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up.

T1 (Timer 1 Low/High, address 8B/ 8D h)

These two SFRs, taken together, represent timer 1. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up.

P0 (Port 0, address 90h, bit addressable)

This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of
port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this SFR will send a high
level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

P1 (port 1, address 90h, bit addressable)

This is port latch1. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of
port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR will send a high
level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

P2 (port 2, address 0A0h, bit addressable)

This is a port latch2. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of
port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR will send a high level
on the corresponding I/O pin whereas a value of 0 will bring it to low level.

P3 (port 3, address B0h, bit addressable)

This is a port latch3. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of

Page 23
Geethanjali College of Engineering & Technology

port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR will send a high level
on the corresponding I/O pin whereas a value of 0 will bring it to low level.

IE (interrupt enable, 0A8h)

The Interrupt Enable SFR is used to enable and disable specific interrupts. The low 7
bits of the SFR are used to enable/disable the specific interrupts, where the MSB bit is used
to enable or disable all the interrupts. Thus, if the high bit of IE is 0 all interrupts are disabled
regardless of whether an individual interrupt is enabled by setting a lower bit.

Table:5.9(d) IE (interrupt enable,0A8h)

IE Register

IP (Interrupt Priority, 0B8h)

The interrupt priority SFR is used to specify the relative priority of each interrupt. On
8051 an interrupt may be either low or high priority. An interrupt may interrupt interrupts.
For e.g., if we configure all interrupts as low priority other than serial interrupt. The serial
interrupt always interrupts the system, even if another interrupt is currently executing.
However, if a serial interrupt is executing no other interrupt will be able to interrupt the serial
interrupt routine since the serial interrupt routine has the highest priority.

Table :5.9(e)IP(interrupt Priority,0B8h)

IP registers

Page 24
Geethanjali College of Engineering & Technology

PSW (Program Status Word, 0D0h)

The program Status Word is used to store a number of important bits that are set and
cleared by 8051 instructions. The PSW SFR contains the carry flag, the auxiliary carry flag, the
parity flag and the overflow flag. Additionally, it also contains the register bank select flags,
which are used to select, which of the “R” register banks currently in use.

Table:5.9(f) PSW(Program Status Word,0D0h)

SBUF (Serial Buffers)

SBUF is used to hold data in serial communication. It is physically two registers. One
is writing only and is used to hold data to be transmitted out of 8051 via TXD. The other is
read only and holds received data from external sources via RXD. Both mutually exclusive
registers use address 99h.

5.10.INTERRUPTS

Interrupts are hardware signals that are used to determine conditions that exist in
external and internal circuits. Any interrupt can cause the 8051 to perform a hardware call to
an interrupt –handling subroutine that is located at a predetermined absolute address in the
program memory.

Five interrupts are provided in the 8051. Three of these are generated automatically by
the internal operations: Timer flag 0, Timer Flag 1, and the serial port interrupt (RI or TI) Two
interrupts are triggered by external signals provided by the circuitry that is connected to the
pins INTO 0 and INTO1. The interrupts maybe enable or disabled, given priority or otherwise
controlled by altering the bits in the Interrupt Enabled (IE) register, Interrupt Priority (IP)
register, and the Timer Control (TCON) register . These interrupts are mask able i.e. they can
be disabled. Reset is a non-maskable interrupt which has the highest priority. It is generated

Page 25
Geethanjali College of Engineering & Technology

when a high is applied to the reset pin. Upon reset, the registers are loaded with the default
values.

Each interrupt source causes the program to do store the address in PC onto the
stack and causes a hardware call to one of the dedicated addresses in the program memory.
The appropriate memory locations for each for each interrupt are as follows:

Table:5.10 Interrupts

Interrupt Address
RESET 0000
IE0 (External interrupt 0) 0003
TF0(Timer 0 Interrupt) 000B
IE1(External interrupt 1) 0013
TF1(Timer 1 interrupt) 001B
SERIAL 0023

Page 26
Geethanjali College of Engineering & Technology

6.BRIEF DESCRIPTION ABOUT RF COMMUNICATIONS

Radio Frequency (RF) and wireless have been around for over a century with Alexander
Popov and Sir Oliver Lodge laying the groundwork for Guglielmo Marconi’s wireless radio
developments in the early 20th century. In December 1901, Marconi performed his most
prominent experiment, where he successfully transmitted Morse code from Cornwall,
England, to St John’s, Canada.

6.1. General physics of radio signals

RF communication works by creating electromagnetic waves at a source and being


able to pick up those electromagnetic waves at a particular destination. These
electromagnetic waves travel through the air at near the speed of light. The wavelength of an
electromagnetic signal is inversely proportional to the frequency; the higher the frequency,
the shorter the wavelength.

Frequency is measured in Hertz (cycles per second) and radio frequencies are
measured in kilohertz (KHz or thousands of cycles per second), megahertz (MHz or millions of
cycles per second) and gigahertz (GHz or billions of cycles per second). Higher frequencies
result in shorter wavelengths. The wavelength for a 900 MHz device is longer than that of a
2.4 GHz device.

In general, signals with longer wavelengths travel a greater distance and penetrate
through, and around objects better than signals with shorter wavelengths.

6.2. What is RF?

RF itself has become synonymous with wireless and high frequency signals, describing
anything from AM radio between 535 kHz and 1605 kHz to computer local area networks
(LANs) at 2.4 GHz. However, RF has traditionally defined frequencies from a few kHz to
roughly 1 GHz. If one considers microwave frequencies as RF, this range extends to 300 GHz.

Radio frequency (RF) is a frequency, or rate of oscillation, of electromagnetic radiation within


the range of about 3 Hz to 300 GHz. This range corresponds to the frequency of alternating
current electrical signals used to produce and detect radio waves. Since most of this range is

Page 27
Geethanjali College of Engineering & Technology

beyond the vibration rate that most mechanical systems can respond to, RF usually refers to
oscillations in electrical circuits. The following tables outline the various nomenclatures for
the frequency bands.

06.3. Frequency Band Designations:

Table: 6.3(a) Frequency Band Designation

Name Symbol Frequency Wavelength Applications

Directly audible when converted to


Extremely low
ELF 3–30 Hz 100–10 Mm sound (above ~20 Hz),
frequency
communication with submarines

Super low Directly audible when converted to


SLF 30–300 Hz 10–1 Mm
frequency sound, AC power grids (50–60 Hz)

Ultralow Directly audible when converted to


ULF 300–3000 Hz 1000–100 km
frequency sound, communication within mines

Directly audible when converted to


Very low
VLF 3–30 kHz 100–10 km sound (below ~20 kHz; or ultrasound
frequency
otherwise)

AM broadcasting, navigational
Low frequency LF 30–300 kHz 10–1 km
beacons, and amateur radio.

Navigational beacons, AM
Medium broadcasting, amateur radio,
MF 300–3000 kHz 1000–100 m
frequency maritime and aviation
communication

Short wave, amateur radio, citizens'


High frequency HF 3–30 MHz 100–10 m
band radio, sky wave propagation.

Page 28
Geethanjali College of Engineering & Technology

FM broadcasting, amateur radio,


Very high
VHF 30–300 MHz 10–1 m broadcast television, aviation, GPR,
frequency
MRI.

Broadcast television, amateur radio,


mobile telephones, cordless
Ultra-high
UHF 300–3000 MHz 100–10 cm telephones, wireless networking,
frequency
remote keyless entry for
automobiles, microwave ovens, GPR

Wireless networking, satellite links,


Super high
SHF 3–30 GHz 10–1 cm amateur radio, microwave links,
frequency
satellite television, door openers

Microwave data links, radio


Extremely high astronomy, amateur radio, remote
EHF 30–300 GHz 10–1 mm
frequency sensing, advanced weapons systems,
advanced security scanning

The above Table shows a relationship between frequency (f) and wavelength (λ). A
wave or sinusoid can be completely described by either its frequency or its wavelength. They
are inversely proportional to each other and related to the speed of light through a particular
medium. The relationship in a vacuum is shown in the following equation:

Where c is the speed of light. As frequency increases, wavelength decreases. For


reference, a 1 GHz wave has a wavelength of roughly 1 foot, and a 100 MHz wave has a
wavelength of roughly 10 feet.

Page 29
Geethanjali College of Engineering & Technology

Table:6.3(b) Frequency band description

RF measurement methodology can generally be divided into three major categories:


spectral analysis, vector analysis, and network analysis. Spectrum analyzers, which provide
basic measurement capabilities, are the most popular type of RF instrument in many general-
purpose applications. Specifically, using a spectrum analyzer you can view power- vs. -
Frequency information and can sometimes demodulate analog formats, such as amplitude
modulation (AM), frequency modulation (FM), and phase modulation (PM).

Vector instruments include vector or real-time signal analyzers and generators. These
instruments analyze and generate broadband waveforms, and capture time, frequency,
phase, and power information from signals of interest. These instruments are much more
powerful than spectrum analyzers and offer excellent modulation control and signal analysis.

Network analyzers, on the other hand, are typically used for making S-parameter
measurements and other characterization measurements on RF or high-frequency
components. Network analyzers are instruments that correlate both the generation and
analysis on multiple channels but at a much higher price than spectrum analyzers and vector
signal generators/analyzers.

6.4.Why Operate at Higher Frequencies?


From the frequency spectrum we notice that it is quite fragmented and dense. This
encompasses one of the reasons that we are constantly pushing applications into higher and
higher frequencies. However, some of the other reasons accounting for this push into higher
frequencies include efficiency in propagation, immunity to some forms of noise and
impairments as well as the size of the antenna required. The antenna size is typically related
to the wavelength of the signal and in practice is usually ¼ wavelength.

Page 30
Geethanjali College of Engineering & Technology

This leads to a very interesting question. Typically, data is structured and easily
represented at low frequencies; how can we represent it or physically translate it to these
higher RF frequencies? For example, the human audible range is from 20 Hz to 20 kHz.
According to the Nyquist theorem, we can completely represent the human audible range by
sampling at 40 kHz or, more precisely, at 44.1 kHz (this is where stereo audio is sampled). Cell
phones, however, operate at around 850 MHz.

How this happens is much of the study of RF and high-frequency measurements occurs
in the frequency domain. There is a duality between the time-domain functions and those
same functions represented in the frequency-domain. Figure 1 depicts frequency shifting the
human audible range to transmit through cellular frequencies. The most common way to
frequency shift is called mixing, which is equivalent to multiplying your signal by a sinusoidal
signal. The following mathematical trigonometric identity demonstrates this fact.

Therefore, by beating two sine waves against each other, you get both sum and
difference frequencies. You can shift an entire signal to a new frequency range (either up or

down in spectrum) by selecting the appropriate value of . In addition, any signal can be
represented as the sum of sinusoidal signals of different frequencies. Thus, shifting a signal
simply applies the “multiplication” to all its sinusoidal components.

6.5.Working of RF communication system

Imagine an RF transmitter wiggling an electron in one location. This wiggling electron


causes a ripple effect, somewhat a kind of dropping a pebble in a pond. The effect is an
electromagnetic (EM) wave that travels out from the initial location resulting in electrons
wiggling in remote locations. An RF receiver can detect this remote electron wiggling.

The RF communication system then utilizes this phenomenon by wiggling electrons in


a specific pattern to represent information. The receiver can make this same information
available at a remote location; communicating with no wires.

Page 31
Geethanjali College of Engineering & Technology

In most wireless systems, a designer has two overriding constraints: it must operate
over a certain distance (range) and transfer a certain amount of information within a time
frame (data rate). Then the economics of the system must work out (price) along with
acquiring government agency approvals (regulations and licensing).

RANGE

In order to accurately compute range – it is essential to understand a few terms: dB -


Decibels

Decibels are logarithmic units that are often used to represent RF power. To convert
from watts to dB: Power in dB = 10* (log x) where x is the power in watts.

Another unit of measure that is encountered often is dBm (dB mill watts). The
conversion formula for it is Power in dBm = 10* (log x) where x is the power in mill watts.

Line-of-site (LOS)

Line-of-site when speaking of RF means more than just being able to see the receiving
antenna from the transmitting antenna. In, order to have true line-of-site no objects
(including trees, houses or the ground) can be in the Fresnel zone. The Fresnel zone is the
area around the visual line-of-sight that radio waves spread out into after they leave the
antenna. This area must be clear or else signal strength will weaken. There are essentially two
parameters to look at when trying to determine range.

1) Transmit Power

Transmit power refers to the amount of RF power that comes out of the antenna port
of the radio. Transmit power is usually measured in Watts, mill watts or dBm.

2) Receiver sensitivity

Receiver sensitivity refers to the minimum level signal the radio can demodulate. It is
convenient to use an example with sound waves; Transmit power is how loud someone is
yelling and receive sensitivity would be how soft a voice someone can hear. Transmit power

Page 32
Geethanjali College of Engineering & Technology

and receive sensitivity together constitute what is know as “link budget”. The link budget is
the total amount of signal attenuation you can have between the transmitter and receiver
and still have communication occur.

Example:
Maxstream 9XStream TX Power: 20dBm

Maxstream 9XStream RX Sensitivity: -110dBm

Total Link budget: 130dBm.

For line-of-site situations, a mathematical formula can be used to figure out the
approximate range for a given link budget. For non line-of-site applications range calculations
are more complex because of the various ways the signal can be attenuated.

3)RF communications and data rate

Data rates are usually dictated by the system - how much data must be transferred
and how often does the transfer need to take place. Lower data rates, allow the radio module
to have better receive sensitivity and thus more range. In the XStream modules the 9600-
baud module has 3dB more sensitivity than the 19200-baud module. This means about 30%
more distance in line-of-sight conditions. Higher data rates allow the communication to take
place in less time, potentially using less power to transmit.

4)Radio communication

In order to receive radio signals, for instance from AM/FM radio stations, a radio
antenna must be used. However, since the antenna will pick up thousands of sine waves at a
time, a radio tuner is necessary as well to tune in to a particular frequency (or frequency
range). This is typically done via a resonator (in its simplest form, a circuit with a capacitor
and an inductor). The resonator is configured to resonate at a particular frequency (or
frequency band), thus amplifying sine waves at that radio frequency, while ignoring other sine
waves. Usually, either the inductor or the capacitor of the resonator is adjustable, allowing
the user to change the frequency it resonates at.

Page 33
Geethanjali College of Engineering & Technology

6.6.Special properties of RF electrical signals

Electrical currents that oscillate at RF have special properties not shared by direct
current signals. One such property is the ease with which they can ionize air to create a
conductive path through air. ‘High frequency’ units used in electric arc welding, although
strictly speaking these machines do not typically employ frequencies within the HF band,
exploit this property. Another special property is an electromagnetic force that drives the RF
current to the surface of conductors, known as the skin effect. Another property is the ability
to appear to flow through paths that contain insulating material, like the dielectric insulator
of a capacitor. The degree of effect of these properties depends on the frequency of the
signals.

Page 34
Geethanjali College of Engineering & Technology

7.POWER SOURCE DESCRIPTION

7.1. INTRODUCTION
The power supplies are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. A RPS (Regulated Power
Supply) is the Power Supply with Rectification, Filtering and Regulation being done on the AC
mains to get a Regulated power supply for Microcontroller and for the other devices being
interfaced to it.
For example, a 5V regulated power supply system as shown below:

Fig: 7.1 Block Diagram of the Power Supply

A power supply unit can by broken down into a series of blocks, each of which
performs a particular function. A d.c power supply which maintains the output voltage
constant irrespective of a.c mains fluctuations or load variations is known as “Regulated D.C
Power Supply”.

Page 35
Geethanjali College of Engineering & Technology

7.2. TRANSFORMER

A transformer is an electrical device which is used to convert electrical power from one
Electrical circuit to another without change in frequency. Transformers convert AC electricity
from one voltage to another with little loss of power. Transformers work only with AC and
this is one of the reasons why mains electricity is AC. Step-up transformers increase in output
voltage, step-down transformers decrease in output voltage. Most power supplies use a step-
down transformer to reduce the dangerously high mains voltage to a safer low voltage. The
input coil is called the primary and the output coil is called the secondary. There is no electrical
connection between the two coils; instead they are linked by an alternating magnetic field
created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio
of the number of turns on each coil, called the turn’s ratio, determines the ratio of the
voltages. A step-down transformer has a large number of turns on its primary (input) coil
which is connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.

Fig:7.2 An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS


Power Out= Power In
VS x IS=VP x IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current

Page 36
Geethanjali College of Engineering & Technology

7.3.RECTIFIER

A circuit which is used to convert AC to dc is known as RECTIFIER. The process of conversion


AC to DC is called “Rectification”.

Types of Rectifiers

1. Half wave Rectifier

2. Full wave Rectifier

(i). Centre tap full wave rectifier.

(ii). Bridge type full bridge rectifier.

Table:7.3 Comparison of Rectifier Circuits

Type of Rectifier

Parameter Half wave Full wave Bridge

Number of diodes 1 2 4

PIV of diodes Vm 2Vm Vm

D.C output voltage Vm/ 2Vm/ 2Vm/

Vdc, at no-load 0.318Vm 0.636Vm 0.636Vm

Ripple factor 1.21 0.482 0.482

Ripple frequency f 2f 2f

Rectification efficiency 0.406 0.812 0.812

Transformer

Utilization 0.287 0.693 0.812

Factor (TUF)

Page 37
Geethanjali College of Engineering & Technology

RMS voltage Vrms Vm/2 Vm/√2 Vm/√2

Full-wave Rectifier

From the above comparison we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave rectifier
circuit.

7.4. FILTER

A Filter is a device which removes the AC component of rectifier output but allows
the DC component to reach the load

Capacitor Filter

We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages
of ripples is not acceptable for most of the applications.

Ripples can be removed by one of the following methods of filtering.

(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples voltage
though it due to low impedance. At ripple frequency and leave the D.C. to appear at the load.

(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)

(c) Various combinations of capacitor and inductor, such as L-section filter section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and (b)
above. Two cases of capacitor filter, one applied on half wave rectifier and another with full
wave rectifier.

Filtering is performed by a large value electrolytic capacitor connected across the DC


supply to act as a reservoir, supplying current to the output when the varying DC voltage
from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC,

Page 38
Geethanjali College of Engineering & Technology

and then discharges as it supplies current to the output. Filtering significantly increases the
average DC voltage to almost the peak value (1.4 × RMS value).

To calculate the value of capacitor(C),

C = ¼*√3*f*r*R

Where, f = supply frequency,

r = ripple factor,

Rl = load resistance

Note: In our circuit we are using 1000µF hence large value of capacitor is placed to
reduce ripples and to improve the DC component.

7.5. REGULATOR

Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage
regulators are available, mainly for use in dual supplies.

Most regulators include some automatic protection from excessive current ('overload
protection') and overheating ('thermal protection'). Many of the fixed voltage regulators ICs
have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the
right. The LM7805 is simple to use. You simply connect the positive lead of your unregulated
DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead
to the Common pin and then when you turn on the power, you get a 5 Volt supply from the
output pin.

Fig: 7.5(a) A Three Terminal Voltage Regulator

Page 39
Geethanjali College of Engineering & Technology

Circuit Diagram of Power Supply is shown below:

Fig:7.5(b) Circuit Diagram of power supply

Page 40
Geethanjali College of Engineering & Technology

8.SOFTWARE DESCRIPTION WITH CHIP BURNING PROCESS


Developing software and hardware for micro controller based Embedded systems
involves the use of a range of tools that can include editors, assemblers, Compilers,
debuggers, simulators, emulators and Flash/OTP programmers. To the Newcomer to micro
controller development it is often not clear how all of these Different components play
together in the development cycle and what differences There are for example between
Trainer kits, emulators and simulator. The basic operations that are involved in above micro
controller development cycle are:
1. Writing Micro controller Code.

2. Translating the Code.

3. Debugging the code.

Writing micro controller code:


Software Code for a micro controller is written in a programming language of choice
(often Assembler or C). This source code is written with a standard ASCII text editor and saved
as an ASCII text file. Programming in assembler involves learning a micro controller’s specific
instruction set (assembler mnemonics), but results in the most compact and fastest code. A
higher-level language like C is for the most part independent of a micro controller’s specific
architecture, but still requires some controller specific extensions of the standard language
to be able to control all of a chip's peripherals and functionality. The penalty for more portable
code and faster program development is a larger code size (20%...40% compared to
assembler).

Translating the code:

Next the source code needs to be translated into instructions the micro controller can actually
execute. A microcontroller’s instruction set is represented by "op codes". Op codes are unique
sequences of bits ("0" and "1") that are decoded by the controller's instruction decode logic and then
executed. Instead of writing op-codes in bits, they are commonly represented as hexadecimal
numbers, whereby one hex number represents 4 bits within a byte, so it takes two hex numbers to
represent 8 bits or 1 byte. For that reason, a micro controller’s firmware in Machine-readable form
is also called Hex-Code and the file that stores that code Hex-File.
Page 41
Geethanjali College of Engineering & Technology

Debugging the Code:

A debugger is a piece of software running on the PC, which has to be tightly integrated
with the emulator that you use to validate your code. For that reason all emulator
manufacturers ship their own debugger software with their tools, but also compiler
manufacturers frequently include debuggers, which work with certain emulators, into their
development suites

ADVANTAGES

1. One of the advantages of an embedded system is to decrease power consumption and


space.

2. All embedded systems that are based on micro controller have low power consumption in
addition to some form of I/O, COM port and ROM all on a single chip.

8.1. CHIP BURNING PROCESS

The process of chip burning depends up on the compiler kit, the CA51 Compiler
Kit for the 8051 micro controller family supports all 8051 derivatives including those
from companies like Analog Devices, Atmel, Cypress Semiconductor, Dallas
Semiconductor, Goal, Hynix, Infineon, Intel, OKI, Philips, Silicon Labs, SMSC, ST
Microelectronics, Synopsis, TDK, Temic, Texas Instruments, and Winbond.

The following components are included in the CA51 8051 C-compiler & Assembler Kit:

C51 ‘C’ Compiler

The Keil C51 ‘C’ Compiler for the 8051 micro controller is the most popular 8051 ‘C’
compiler in the world. It provides more features than any other 8051 ‘C’ compiler available
today. The C51 Compiler allows you to write 8051 micro controller applications in C that have
the efficiency and speed of assembly language. Language extensions in the C51 Compiler give
you full access to all resources of the 8051.

Page 42
Geethanjali College of Engineering & Technology

C51 translates C source files into a re-locatable object module. When the DEBUG
control is used, the object file contains full symbolic information for debugging with the
µVision3 Debugger or an in-circuit emulator. In addition to the object file, the C51 Compiler
generates a listing file, which optionally may include symbol table and cross-reference
information.

Features

• Nine basic data types, including 32-bit IEEE floating-point


• Flexible variable allocation with bit, data, BDATA, IDATA, XDATA, and PDATA memory
types
• Interrupt functions may be written in C
• Full use of the 8051 register banks
• Complete symbol and type information for source-level debugging
• Use of AJMP and ACALL instructions
• Bit-addressable data objects
• Built-in interface for the RTX51 real-time operating system
• Support for dual data pointers on Atmel, AMD, Cypress, Dallas Semiconductor, Infineon,
Philips, and triscend micro controllers
• Support for the Philips 8xC750, 8xC751, and 8xC752 limited instruction sets
• Support for the Infineon 80C517 arithmetic unit

A51 Macro Assembler

The A51 Assembler is a macro assembler for the 8051 family of micro controllers. It
supports all 8051 derivatives. It translates symbolic assembly language mnemonics into
relocatable object code where the utmost speed, small code size, and hardware control are
critical. The macro facility speeds development and conserves maintenance time since
common sequences need only be developed once. The A51 assembler supports symbolic
access to all features of the 8051 architecture.

The A51 assembler translates assembler source files into a relocatable object module.
The DEBUG control adds full symbolic information to the object module and supports

Page 43
Geethanjali College of Engineering & Technology

debugging with the µVision3 Debugger or an in-circuit emulator. In addition to object files,
the A51 assembler generates list files, which optionally may include symbol table and cross
reference information.

µVision3 IDE

The µVision3 IDE from Keil Software combines project management; make facilities,
source code editing, program debugging, and complete simulation in one powerful
environment. µVision3 helps you get programs working faster than ever while providing an
easy-to-use development platform. The editor and debugger are integrated into a single
application and provide a seamless embedded project development environment.

µVision3 features include:

• The Device Database, which automatically sets the assembler, compiler, and linker
options for the chip, you select. This prevents you from wasting your time configuring the
tools and helps you get started writing code faster.
• A robust Project Manager, which lets you create several different configurations of your
target from a single project file. The Keil µVision3 IDE allows you to create an output file
for simulating, an output file for debugging with an emulator, and an output file for
programming an EPROM -- all from the same Project file.
• An integrated Make facility with automatic dependency generation. You don't have to
figure out which header files and include files are used by which source files. The Keil
compilers and assemblers do that automatically.
• Interactive Error Correction. As your project compiles, errors and warnings appear in an
output window. You may make corrections to the files in your project while µVision3
continues to compile in the background. Line numbers associated with each error or
warnings are automatically resynchronized when you make changes to the source.

OH51 Object-HEX Converter

The OH51 Object-HEX converter creates Intel HEX files from absolute OMF51 object
modules, created by the Keil A51 assembler, BL51 code banking linker, or OC51 banked object
converter.

Page 44
Geethanjali College of Engineering & Technology

Intel HEX files are ASCII files that contain a hexadecimal representation of your
program. They easily may be loaded into a device programmer for writing EPROM’s or other
memory devices.

KEIL Compiler

It's very easy to work with Keil if you know how to write the programs in c or assembly
language. The basic steps to compile and run a program in assembly language:

1. Open the Keil

2. Open project window and then select a new project and save it by any name like exam1.

3. Now a "select device for target 'target1' " window will appear.
Select the name of the chip vendor (Intel, Philips, Siemens, etc.) in the Vendor box. Select
the device family from the drop down menu in the Family box. Enter the part number for
the device in the Device box. I select ATMEL, after clicking on Atmel it will give device no.
I select AT89C51.

4. Now in "project workspace"(window on the left side), target1 will appear. Click on target1,
source group1 will appear.

5. Open new file and write a program in assembly. Save it with .asm (like 'exam.asm').

6. Now right click on the "source group1”. Select "add files to group 'source group1' "

7. Give the file name like 'exam.asm’ and add it and close that window. Again left click on the
source group1; you can see the added file.

8. Right click on this added file and select “build target”. By this you can compile your program.
Check the output window. If you’re pro is compiled properly then go to 'Debug'.

9. Select 'start/stop debug session'.

10. In project workspace you can see how your program is running.

11. Again go to 'Debug' and see F11 is there for running your program step-by-step.

12. Press F11 or F5.

Page 45
Geethanjali College of Engineering & Technology

9.Source code

TRANSMITTER

org 0000h
RT:
MOV SCON, #40H
MOV TMOD, #20H
MOV TH1, #0FAH
CLR TI
SETB TR1
MAIN:
JB P1.0, XX; START
MOV A, #03AH
MOV SBUF, A
JNB TI, $
CLR TI
LJMP main
XX:
JB P1.1, MAIN
MOV A, #03BH
MOV SBUF, A
JNB TI, $
CLR TI
LJMP main
End

RECEIVER1
ORG 00h

MOV P1, #00H

MOV SCON, #50h

MOV TMOD, #20h

MOV TH1, #0FAH

SETB TR1

main:

Page 46
Geethanjali College of Engineering & Technology

JNB RI, MAIN

CLR RI

MOV A, SBUF

CJNE A, #03bH, MAIN

MOV P1, #0FFH

LJMP MAIN

END

RECEIVER2:

org 00h

MOV P1, #00H

MOV SCON, #50h

MOV TMOD, #20h

MOV TH1, #0FAH

setb TR1

main:

JNB RI, MAIN

CLR RI

MOV A, SBUF

CJNE A, #03AH, MAIN

MOV P1, #0FF

Page 47
Geethanjali College of Engineering & Technology

LJMP MAIN

END

Page 48
Geethanjali College of Engineering & Technology

10.HARDWARE DETAILS

The Electronic Hardware like IC’s and other important components used in this

project work are procured from the Hyderabad Electronics Market. The required printing

circuit boards are designed and fabricated at kushiguda industrial estate. The data sheets of

IC’s are gathered from websites. The following are the important components details, and

their data sheets are provided in this chapter.

ATMEL 89C2051 Microcontroller

(1) ATMEL 89C51 Microcontroller chip


(2) RF Transmitter and Receivers
(3) 7805 Voltage Regulator
(4) BC547 NPN Transistor

Page 49
Geethanjali College of Engineering & Technology

11.CONCLUSIONS AND REFERENCES

The project work is designed and developed successfully. For the demonstration
purpose, a prototype module is constructed; and the results are found to be satisfactory.
Since it is a prototype module, a simple module is constructed, which can be used for locating
the devices easily. While designing and developing this proto type module, we have consulted
few experts those who are having knowledge in embedded systems, communication systems,
etc and these professionals working at different organizations belongs to Hyderabad helped
us while developing this project work. Since it is a prototype module, much amount is not
invested. The whole module is constructed with locally available components. Some of the
modifications must be carried out in design to make it as real working system.

REFERENCES
While designing and fabrication of this project work, we gathered information from
websites. The information is gathered from yahoo.com search Engine. Regarding micro
controllers plenty of books are available, the following are the references made during design,
development and fabrication of the project work.

Text Books:

Linear Integrated Circuits – By: D. Roy Choudhury, Shail Jain


1. Digital Electronics. By JOSEPH J.CARR
2. Digital and Analog Communication System By: K. sam Shanmugam
3. Electronic Circuit guide book – Sensors – By JOSEPH J.CARR
4. The 8051 Micro-controller Architecture, programming & Applications By: Kenneth J. Ayala
5. Practical transistor circuit design and analysis By: GERALD E. WILLIAMS
6. Programming and Customizing the 8051 Micro-controllers By: Myke Predko
7. The concepts and Features of Micro-controllers By: Raj Kamal
8. Digital Principles and Applications by ALBERT PAUL MALVINO and DONALD P. LEACH

Catalogs:

(1) TEXAS - LINEAR IC’s manual

(2) SIGNETICS - DIGITAL IC’s manual

Page 50
Geethanjali College of Engineering & Technology

Journals:

(1) Electronic Design

(2) Electronics for you

(3) Electronics Text.

(4) Practical Electronics

Page 51

You might also like