ir signal tracking system

184
IR SIGNAL TRACKING SYSTEM (Advanced User Controlled Roof Top Antenna Signal Tracking System using AT89S52 MCU with direction identifier) [IR Signal Tracking System] Page 1

Upload: martemartemarte

Post on 27-Dec-2015

151 views

Category:

Documents


4 download

DESCRIPTION

IR Signal Tracking System IR Signal Tracking System IR Signal Tracking System

TRANSCRIPT

Page 1: IR Signal Tracking System

IR SIGNAL TRACKING SYSTEM

(Advanced User Controlled Roof Top Antenna Signal Tracking

System using AT89S52 MCU with direction identifier)

[IR Signal Tracking System] Page 1

Page 2: IR Signal Tracking System

A PROJECT WORK ENTITLED

IR SIGNAL TRACKING SYSTEM

SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD OF THE DEGREE OF

B.TECH (CCC)

IN

ELECTRONICS & COMMUNICATION ENGINEERING

Submitted By

V.ANITHA

Reg. No. 09063A4355

Under the Guidance of

Dr. Y.PADMA SAI

HEAD OF THE DEPARMENT, ECE

VNRVJIET

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI INSTITUTE OF ENGINEERING & TECHNOLOGY

AN AUTONOMOUS INSTITUTE(Approved by AICTE - New Delhi,Govt. of A.P.)Accredited by NBA and NAAC with ‘A’ Grade

VignanaJyothi Nagar, Bachupally, Nizampet (S.O.), Hyderabad-500 090. A.P., India.

2009-2014

[IR Signal Tracking System] Page 2

Page 3: IR Signal Tracking System

VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI INSTITUTE OF ENGINEERING & TECHNOLOGY

AN AUTONOMOUS INSTITUTE(Approved by AICTE - New Delhi,Govt. of A.P. and Affiliated to JNTUH)

Accredited by NBA and NAAC with ‘A’ GradeVignanaJyothi Nagar, Bachupally, Nizampet (S.O.), Hyderabad-500 090. A.P., India.

DEPARTMENT OF ELECTRONICS AND COMMUNICATIONENGINEERING

CERTIFICATE

This is to certify that the project report entitled “IR Signal Tracking System” is a

bonafide work done under our supervision and is being submitted by Mr.V.ANITHA

(09063A4355) in partial fulfillment for the award of the Degree of B.Tech(CCC) in Electronics

and communication Engineering, in the VNRVJIET, Hyderabad during the academic year 2009-

2014.

Certified further that to the best of my knowledge the work presented in this thesis has

not been submitted to any other University or Institute for the award of any Degree or Diploma.

Internal Guide

Dr. Y. PADMA SAIProfessor and Head,Department of ECE,VNR VJIET, HYD.

EXTERNAL EXAMINER

[IR Signal Tracking System] Page 3

Head of the Department

Dr. Y. PADMA SAIProfessor and Head,Department of ECE,VNR VJIET, HYD.

Page 4: IR Signal Tracking System

ACKNOWLEDGEMENT

I am indebted to Dr. D. N. RAO, General Secretary, VNRVJIET,for his help and

guidance in my work. I consider myself fortunate to have obtained his friendly and valuable

advice during the course of my research.

I am thankful to Dr.C.D.NAIDU, principal, VNR VJIET, Hyderabad for giving me

permission to carry out this project.

My sincere thanks to Dr.Y. PADMA SAI, professor, Head of the Department, ECE,

VNRVJIET for her esteemed guidance and encouragement provided during the course of my

project.

I would like to express my sincere thanks to Dr.Y.JYOSTNA Professor and

coordinator(CCC), VNR VJIET for her precious guidance and kind co-operation at every step of

this project work.

I am thankful to all the staff members of ECE department, VNRVJIET for helping me

during this project.

I am thankful to all the project committee members of ECE department, VNR VJIET for

helping me during this project.

Finally, I am very thankful to my family members and my friends for their great moral

support.

V.ANITHA

(09063A4355)

[IR Signal Tracking System] Page 4

Page 5: IR Signal Tracking System

DECLARATION

I do declare that the thesis work entitled “IR SIGNAL TRACKING SYSTEM” submitted in the department of Electronics and Communication Engineering (ECE), Vallurupalli Nageswara Rao VignanaJyothi Institute of Engineering and Technology, Hyderabad, in partial fulfillment of the requirement for the award of the degree of B. Tech (CCC) is a bonafide record of my own work carried out under the guidance of Dr. Y. PADMA SAI.

Also, I declare that the matter embodied in this thesis has not been submitted by me in

full or in any part thereof for the award of any degree/diploma of any other institution or

university previously.

Place: Hyderabad (Signature of the candidate)

Date: V.ANITHA

[IR Signal Tracking System] Page 5

Page 6: IR Signal Tracking System

TECHNICAL SPECIFICATION

Title of the project : IR Signal Tracking System

Domain : Embedded Systems , RADAR Communication

Software : Embedded C, Keil, proload

Microcontroller : AT89S52 controller

Power Supply : 5V regulated power supply.

IR Sensor : 1

DC Geared Motor : 1 (60 rpm)

Fm Radio : 1

Music Generation system : 1

Audio visual indication : 1

Crystal : 11.0592MHz

Applications : Satellite communication

[IR Signal Tracking System] Page 6

Page 7: IR Signal Tracking System

Abstract:

A IR Signal tracking system is designed to track the signal. Roof top antenna better suits

in all the areas for tracking signals from a distant place.

Here in this project the antenna is fitted with DC geared motor and to control its

operation we are using AT89S52 as controller. In this project we are using AT89S52, DC Geared

motors, IR sensors, FM radio is used to track Radio signal. In this project, L293D H-Bridge is

used to drive the geared DC motor.

If the target is found to be moved in any direction and then it gives a control signal to the

microcontroller and the status is displayed on the LCD for user identification. In this project

antenna is placed at an altitude to track various frequencies emitted by radio stations. The system

is provided with control switches.

If user presses one switch, antenna tracks for corresponding radio signal. The rotation of

antenna is based on the signal tracked by a pair of infrared sensor. Once the signal is matched

antenna bowl will stop in that particular direction it indirectly turns ON the relay to switch ON

the particular FM radio. In this way we can track the signal and can switch ON the particular

desired frequency channel.

This project uses regulated 5V, 750mA power supply. 7805 three terminal voltage

regulator is used for voltage regulation. Bridge type full wave rectifier is used to rectify the ac

out put of secondary of 230/12V step down transformer.

[IR Signal Tracking System] Page 7

Page 8: IR Signal Tracking System

Block Diagram:

INTRODUCTION TO EMBEDDED SYSTEMS

Introduction:

[IR Signal Tracking System] Page 8

A

T

8

9

S

5

2

A

T

8

9

S

5

2

H-Bridge

H-Bridge

Geared DC motors

Geared DC motors

Switch 1

Switch 1

Switch 2

Switch 2

Antenna arrangement

Antenna arrangement

IR Receiver

IR Receiver

IR Transmitter

IR Transmitter

Transistor driver ckt

Transistor driver ckt

RelayRelay

FM RadioFM Radio

AC Input

AC Input

Step down

T/F

Bridge Rectifier

Filter Circuit Regulator

Power Supply to all blocks

4 IR pairs

Page 9: IR Signal Tracking System

An embedded system is a system which is going to do a predefined specified task is the

embedded system and is even defined as combination of both software and hardware. A general-

purpose definition of embedded systems is that they are devices used to control, monitor or assist

the operation of equipment, machinery or plant. "Embedded" reflects the fact that they are an

integral part of the system. At the other extreme a general-purpose computer may be used to

control the operation of a large complex processing plant, and its presence will be obvious.

All embedded systems are including computers or microprocessors. Some of these

computers are however very simple systems as compared with a personal computer.

The very simplest embedded systems are capable of performing only a single function or

set of functions to meet a single predetermined purpose. In more complex systems an application

program that enables the embedded system to be used for a particular purpose in a specific

application determines the functioning of the embedded system. The ability to have programs

means that the same embedded system can be used for a variety of different purposes. In some

cases a microprocessor may be designed in such a way that application software for a particular

purpose can be added to the basic software in a second process, after which it is not possible to

make further changes. The applications software on such processors is sometimes referred to as

firmware.

The simplest devices consist of a single microprocessor (often called a "chip”), which

may itself be packaged with other chips in a hybrid system or Application Specific Integrated

Circuit (ASIC). Its input comes from a detector or sensor and its output goes to a switch or

activator which (for example) may start or stop the operation of a machine or, by operating a

valve, may control the flow of fuel to an engine.

As the embedded system is the combination of both software and hardware

[IR Signal Tracking System] Page 9

Page 10: IR Signal Tracking System

Figure: Block diagram of Embedded System

Software deals with the languages like ALP, C, and VB etc., and Hardware deals with

Processors, Peripherals, and Memory.

Memory: It is used to store data or address.

Peripherals: These are the external devices connected

Processor: It is an IC which is used to perform some task

Applications of embedded systems

Manufacturing and process control

Construction industry

Transport

Buildings and premises

Domestic service

Communications

Office systems and mobile equipment

Banking, finance and commercial

[IR Signal Tracking System] Page 10

Embedded

System

Software Hardware

ALP

C

VB Etc.,

Processor

Peripherals

memory

Page 11: IR Signal Tracking System

Medical diagnostics, monitoring and life support

Testing, monitoring and diagnostic systems

Processors are classified into four types like:

Micro Processor (µp)

Micro controller (µc)

Digital Signal Processor (DSP)

Application Specific Integrated Circuits (ASIC)

Micro Processor (µp):

A silicon chip that contains a CPU. In the world of personal computers, the terms microprocessor

and CPU are used interchangeably. At the heart of all personal computers and most workstations

sits a microprocessor. Microprocessors also control the logic of almost all digital devices, from

clock radios to fuel-injection systems for automobiles.

Three basic characteristics differentiate microprocessors:

Instruction set : The set of instructions that the microprocessor can execute.

Bandwidth : The number of bits processed in a single instruction.

Clock speed : Given in megahertz (MHz), the clock speed determines how many instructions

per second the processor can execute.

In both cases, the higher the value, the more powerful the CPU. For example, a 32-bit

microprocessor that runs at 50MHz is more powerful than a 16-bit microprocessor that runs at

25MHz. In addition to bandwidth and clock speed, microprocessors are classified as being either

RISC (reduced instruction set computer) or CISC (complex instruction set computer).

A microprocessor has three basic elements, as shown above. The ALU performs all arithmetic

computations, such as addition, subtraction and logic operations (AND, OR, etc). It is controlled

by the Control Unit and receives its data from the Register Array.   The Register Array is a set of

registers used for storing data. These registers can be accessed by the ALU very quickly. Some

registers have specific functions - we will deal with these later.   The Control Unit controls the

entire process. It provides the timing and a control signal for getting data into and out of the

[IR Signal Tracking System] Page 11

Page 12: IR Signal Tracking System

registers and the ALU and it synchronizes the execution of instructions (we will deal with

instruction execution at a later date).  

Three Basic Elements of a Microprocessor

Micro Controller (µc):

A microcontroller is a small computer on a single integrated circuit containing a processor core,

memory, and programmable input/output peripherals. Program memory in the form of NOR

flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM.

Microcontrollers are designed for embedded applications, in contrast to the microprocessors

used in personal computers or other general purpose applications.

[IR Signal Tracking System] Page 12

Timer, Counter, serial communication ROM,

ADC, DAC, Timers, USART, Oscillators

Etc.,

ALU

CU

Memory

Page 13: IR Signal Tracking System

Figure: Block Diagram of Micro Controller (µc)

Digital Signal Processors (DSPs):

Digital Signal Processors is one which performs scientific and mathematical operation.

Digital Signal Processor chips - specialized microprocessors with architectures designed

specifically for the types of operations required in digital signal processing. Like a general-

purpose microprocessor, a DSP is a programmable device, with its own native instruction code.

DSP chips are capable of carrying out millions of floating point operations per second, and like

their better-known general-purpose cousins, faster and more powerful versions are continually

being introduced. DSPs can also be embedded within complex "system-on-chip" devices, often

containing both analog and digital circuitry.

Application Specific Integrated Circuit (ASIC)

ASIC is a combination of digital and analog circuits packed into an IC to achieve the desired

control/computation function

ASIC typically contains

CPU cores for computation and control

Peripherals to control timing critical functions

Memories to store data and program

Analog circuits to provide clocks and interface to the real world which is analog in nature

I/Os to connect to external components like LEDs, memories, monitors etc.

Computer Instruction Set

There are two different types of computer instruction set there are:

1. RISC (Reduced Instruction Set Computer) and

2. CISC (Complex Instruction Set computer)

Reduced Instruction Set Computer (RISC)

[IR Signal Tracking System] Page 13

Page 14: IR Signal Tracking System

A RISC (reduced instruction set computer) is a microprocessor that is designed to perform a

smaller number of types of computer instruction so that it can operate at a higher speed (perform

more million instructions per second, or millions of instructions per second). Since each

instruction type that a computer must perform requires additional transistors and circuitry, a

larger list or set of computer instructions tends to make the microprocessor more complicated

and slower in operation.

Besides performance improvement, some advantages of RISC and related design improvements

are:

A new microprocessor can be developed and tested more quickly if one of its aims is to be less

complicated.

Operating system and application programmers who use the microprocessor's instructions will

find it easier to develop code with a smaller instruction set.

The simplicity of RISC allows more freedom to choose how to use the space on a

microprocessor.

Higher-level language compilers produce more efficient code than formerly because they have

always tended to use the smaller set of instructions to be found in a RISC computer.

RISC characteristics

Simple instruction set:

In a RISC machine, the instruction set contains simple, basic instructions, from which more

complex instructions can be composed.

Same length instructions.

Each instruction is the same length, so that it may be fetched in a single operation.

1 machine-cycle instructions.

Most instructions complete in one machine cycle, which allows the processor to handle several

instructions at the same time. This pipelining is a key technique used to speed up RISC

machines.

Complex Instruction Set Computer (CISC)

[IR Signal Tracking System] Page 14

Page 15: IR Signal Tracking System

CISC, which stands for Complex Instruction Set Computer, is a philosophy for designing chips

that are easy to program and which make efficient use of memory. Each instruction in a CISC

instruction set might perform a series of operations inside the processor. This reduces the number

of instructions required to implement a given program, and allows the programmer to learn a

small but flexible set of instructions.

The advantages of CISC

At the time of their initial development, CISC machines used available technologies to optimize

computer performance.

Microprogramming is as easy as assembly language to implement, and much less expensive than

hardwiring a control unit.

The ease of micro-coding new instructions allowed designers to make CISC machines upwardly

compatible: a new computer could run the same programs as earlier computers because the new

computer would contain a superset of the instructions of the earlier computers.

As each instruction became more capable, fewer instructions could be used to implement a given

task. This made more efficient use of the relatively slow main memory.

Because micro program instruction sets can be written to match the constructs of high-level

languages, the compiler does not have to be as complicated.

The disadvantages of CISC

Still, designers soon realized that the CISC philosophy had its own problems, including:

Earlier generations of a processor family generally were contained as a subset in every new

version --- so instruction set & chip hardware become more complex with each generation of

computers.

So that as many instructions as possible could be stored in memory with the least possible wasted

space, individual instructions could be of almost any length---this means that different

instructions will take different amounts of clock time to execute, slowing down the overall

performance of the machine.

[IR Signal Tracking System] Page 15

Page 16: IR Signal Tracking System

Many specialized instructions aren't used frequently enough to justify their existence ---

approximately 20% of the available instructions are used in a typical program.

CISC instructions typically set the condition codes as a side effect of the instruction. Not only

does setting the condition codes take time, but programmers have to remember to examine the

condition code bits before a subsequent instruction changes them.

Memory Architecture

There two different type’s memory architectures there are:

Harvard Architecture

Von-Neumann Architecture

Harvard Architecture

Computers have separate memory areas for program instructions and data. There are two or more

internal data buses, which allow simultaneous access to both instructions and data. The CPU

fetches program instructions on the program memory bus.

The Harvard architecture is a computer architecture with physically separate storage and signal

pathways for instructions and data. The term originated from the Harvard Mark I relay-based

computer, which stored instructions on punched tape (24 bits wide) and data in electro-

mechanical counters. These early machines had limited data storage, entirely contained within

the central processing unit, and provided no access to the instruction storage as data. Programs

needed to be loaded by an operator, the processor could not boot itself.

Figure: Harvard Architecture

[IR Signal Tracking System] Page 16

Page 17: IR Signal Tracking System

Modern uses of the Harvard architecture

The principal advantage of the pure Harvard architecture - simultaneous access to more than one

memory system - has been reduced by modified Harvard processors using modern CPU cache

systems. Relatively pure Harvard architecture machines are used mostly in applications where

tradeoffs, such as the cost and power savings from omitting caches, outweigh the programming

penalties from having distinct code and data address spaces.

Digital signal processors (DSPs) generally execute small, highly-optimized audio or video

processing algorithms. They avoid caches because their behavior must be extremely

reproducible. The difficulties of coping with multiple address spaces are of secondary concern to

speed of execution. As a result, some DSPs have multiple data memories in distinct address

spaces to facilitate SIMD and VLIW processing. Texas Instruments TMS320 C55x processors,

as one example, have multiple parallel data busses (two write, three read) and one instruction

bus.

Microcontrollers are characterized by having small amounts of program (flash memory) and data

(SRAM) memory, with no cache, and take advantage of the Harvard architecture to speed

processing by concurrent instruction and data access. The separate storage means the program

and data memories can have different bit depths, for example using 16-bit wide instructions and

8-bit wide data. They also mean that instruction pre-fetch can be performed in parallel with other

activities. Examples include, the AVR by Atmel Corp, the PIC by Microchip Technology, Inc.

and the ARM Cortex-M3 processor (not all ARM chips have Harvard architecture).

Even in these cases, it is common to have special instructions to access program memory as data

for read-only tables, or for reprogramming.

Von-Neumann Architecture

A computer has a single, common memory space in which both program instructions and data

are stored. There is a single internal data bus that fetches both instructions and data. They cannot

be performed at the same time

The Von Neumann architecture is a design model for a stored-program digital computer that

uses a central processing unit (CPU) and a single separate storage structure ("memory") to hold

both instructions and data. It is named after the mathematician and early computer scientist John

[IR Signal Tracking System] Page 17

Page 18: IR Signal Tracking System

von Neumann. Such computers implement a universal Turing machine and have a sequential

architecture.

A stored-program digital computer is one that keeps its programmed instructions, as well as its

data, in read-write, random-access memory (RAM). Stored-program computers were

advancement over the program-controlled computers of the 1940s, such as the Colossus and the

ENIAC, which were programmed by setting switches and inserting patch leads to route data and

to control signals between various functional units. In the vast majority of modern computers, the

same memory is used for both data and program instructions. The mechanisms for transferring

the data and instructions between the CPU and memory are, however, considerably more

complex than the original von Neumann architecture.

The terms "von Neumann architecture" and "stored-program computer" are generally used

interchangeably, and that usage is followed in this article.

Figure: Schematic of the Von-Neumann Architecture.

[IR Signal Tracking System] Page 18

Page 19: IR Signal Tracking System

Basic Difference between Harvard and Von-Neumann Architecture

The primary difference between Harvard architecture and the Von Neumann architecture is in

the Von Neumann architecture data and programs are stored in the same memory and managed

by the same information handling system.

Whereas the Harvard architecture stores data and programs in separate memory devices and they

are handled by different subsystems.

In a computer using the Von-Neumann architecture without cache; the central processing unit

(CPU) can either be reading and instruction or writing/reading data to/from the memory. Both of

these operations cannot occur simultaneously as the data and instructions use the same system

bus.

In a computer using the Harvard architecture the CPU can both read an instruction and access

data memory at the same time without cache. This means that a computer with Harvard

architecture can potentially be faster for a given circuit complexity because data access and

instruction fetches do not contend for use of a single memory pathway.

Today, the vast majority of computers are designed and built using the Von Neumann

architecture template primarily because of the dynamic capabilities and efficiencies gained in

designing, implementing, operating one memory system as opposed to two. Von Neumann

architecture may be somewhat slower than the contrasting Harvard Architecture for certain

specific tasks, but it is much more flexible and allows for many concepts unavailable to Harvard

architecture such as self programming, word processing and so on.

Harvard architectures are typically only used in either specialized systems or for very specific uses. It is

used in specialized digital signal processing (DSP), typically for video and audio processing products. It

is also used in many small microcontrollers used in electronics applications such as Advanced RISK

Machine (ARM) based products for many vendors.

[IR Signal Tracking System] Page 19

Page 20: IR Signal Tracking System

HARDWARE EXPLANATION

[IR Signal Tracking System] Page 20

Page 21: IR Signal Tracking System

Hardware Explanation:

RESISTOR:

Resistors "Resist" the flow of electrical current. The higher the value of resistance (measured in ohms)

the lower the current will be. Resistance is the property of a component which restricts the flow of electric

current. Energy is used up as the voltage across the component drives the current through it and this

energy appears as heat in the component.

Colour Code:

[IR Signal Tracking System] Page 21

Page 22: IR Signal Tracking System

CAPACITOR:

Capacitors store electric charge. They are used with resistors in  timing   circuits  because it takes time

for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting as a reservoir

of charge. They are also used in filter circuits because capacitors easily pass AC (changing) signals but

they block DC (constant) signals.

Circuit symbol:   

Electrolytic capacitors are polarized and they must be connected the correct way round, at

least one of their leads will be marked + or -.

Examples:  

DIODES:

Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the

direction in which the current can flow. Diodes are the electrical version of a valve and early diodes were

actually called valves.

Circuit symbol:   

Diodes must be connected the correct way round, the diagram may be labeled  a or + for anode

and k or - for cathode (yes, it really is k, not c, for cathode!). The cathode is marked by a line painted on

the body. Diodes are labeled with their code in small print; you may need

a magnifying glass to read this on small signal diodes.

Example:       

[IR Signal Tracking System] Page 22

Page 23: IR Signal Tracking System

LIGHT-EMITTING DIODE (LED):

The longer lead is the anode (+) and the shorter lead is the cathode (&minus). In the schematic

symbol for an LED (bottom), the anode is on the left and the cathode is on the right.

Lighemitting diodes are elements for light signalization in electronics.

They are manufactured in different shapes, colors and sizes. For their low price, low

consumption and simple use, they have almost completely pushed aside other light sources-

bulbs at first place.

[IR Signal Tracking System] Page 23

Page 24: IR Signal Tracking System

It is important to know that each diode will be immediately destroyed unless its current is

limited. This means that a conductor must be connected in parallel to a diode. In order to

correctly determine value of this conductor, it is necessary to know diode’s voltage drop in

forward direction, which depends on what material a diode is made of and what colors it is.

Values typical for the most frequently used diodes are shown in table below: As seen, there are

three main types of LEDs. Standard ones get full brightness at current of 20mA. Low Current

diodes get full brightness at ten time’s lower current while Super Bright diodes produce more

intensive light than Standard ones.

Since the 8052 microcontrollers can provide only low input current and since their pins are

configured as outputs when voltage level on them is equal to 0, direct confectioning to LEDs is carried

out as it is shown on figure (Low current LED, cathode is connected to output pin).

Switches and Pushbuttons:

A push button switch is used to either close or open an electrical circuit depending on the

application. Push button switches are used in various applications such as industrial equipment control

handles, outdoor controls, mobile communication terminals, and medical equipment, and etc. Push button

switches generally include a push button disposed within a housing. The push button may be depressed to

cause movement of the push button relative to the housing for directly or indirectly changing the state of

an electrical contact to open or close the contact. Also included in a pushbutton switch may be an

actuator, driver, or plunger of some type that is situated within a switch housing having at least two

contacts in communication with an electrical circuit within which the switch is incorporated.

[IR Signal Tracking System] Page 24

Page 25: IR Signal Tracking System

Typical actuators used for contact switches include spring loaded force cap actuators that reciprocate

within a sleeve disposed within the canister. The actuator is typically coupled to the movement of the cap

assembly, such that the actuator translates in a direction that is parallel with the cap. A push button switch

for a data input unit for a mobile communication device such as a cellular phone, a key board for

a personal computer or the like is generally constructed by mounting a cover member directly on a circuit

board. Printed circuit board (PCB) mounted pushbutton switches are an inexpensive means of providing

an operator interface on industrial control products. In such push button switches, a substrate which

includes a plurality of movable sections is formed of a rubber elastomeric. The key top is formed on a top

surface thereof with a figure, a character or the like by printing, to thereby provide a cover member. Push

button switches incorporating lighted displays have been used in a variety of applications. Such switches

are typically comprised of a pushbutton, an opaque legend plate, and a back light to illuminate the legend

plate.

Block Diagram For Regulated Power Supply (RPS):

Figure: Power Supply

Description :

Transformer

A transformer is a device that transfers electrical energy from one circuit to another through

inductively coupled conductors—the transformer's coils. A varying current in the first or primary

winding creates a varying magnetic flux in the transformer's core, and thus a varying magnetic

field through the secondary winding. This varying magnetic field induces a varying

electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual

induction.

[IR Signal Tracking System] Page 25

Page 26: IR Signal Tracking System

Figure: Transformer Symbol

(or)

Transformer is a device that converts the one form energy to another form of energy like a

transducer.

Figure: Transformer

Basic Principle

A transformer makes use of Faraday's law and the ferromagnetic properties of an iron core to efficiently

raise or lower AC voltages. It of course cannot increase power so that if the voltage is raised, the current

is proportionally lowered and vice versa.

[IR Signal Tracking System] Page 26

Page 27: IR Signal Tracking System

Figure: Basic Principle

Transformer Working

A transformer consists of two coils (often called 'windings') linked by an iron core, as shown in

figure below. There is no electrical connection between the coils; instead they are linked by a

magnetic field created in the core.

[IR Signal Tracking System] Page 27

Page 28: IR Signal Tracking System

Figure: Basic Transformer

Transformers are used to convert electricity from one voltage to another with minimal loss of power.

They only work with AC (alternating current) because they require a changing magnetic field to be

created in their core. Transformers can increase voltage (step-up) as well as reduce voltage (step-down).

Alternating current flowing in the primary (input) coil creates a continually changing magnetic field in the

iron core. This field also passes through the secondary (output) coil and the changing strength of the

magnetic field induces an alternating voltage in the secondary coil. If the secondary coil is connected to a

load the induced voltage will make an induced current flow. The correct term for the induced voltage is

'induced electromotive force' which is usually abbreviated to induced e.m.f.

The iron core is laminated to prevent 'eddy currents' flowing in the core. These are currents produced by

the alternating magnetic field inducing a small voltage in the core, just like that induced in the secondary

coil. Eddy currents waste power by needlessly heating up the core but they are reduced to a negligible

amount by laminating the iron because this increases the electrical resistance of the core without affecting

its magnetic properties.

Transformers have two great advantages over other methods of changing voltage:

1. They provide total electrical isolation between the input and output, so they can be safely used to

reduce the high voltage of the mains supply.

2. Almost no power is wasted in a transformer. They have a high efficiency (power out / power in)

of 95% or more.

[IR Signal Tracking System] Page 28

Page 29: IR Signal Tracking System

Classification of Transformer

Step-Up Transformer

Step-Down Transformer

Step-Down Transformer

Step down transformers are designed to reduce electrical voltage. Their primary voltage is

greater than their secondary voltage. This kind of transformer "steps down" the voltage applied

to it. For instance, a step down transformer is needed to use a 110v product in a country with a

220v supply.

Step down transformers convert electrical voltage from one level or phase configuration usually

down to a lower level. They can include features for electrical isolation, power distribution, and

control and instrumentation applications. Step down transformers typically rely on the principle

of magnetic induction between coils to convert voltage and/or current levels.

Step down transformers are made from two or more coils of insulated wire wound around a core

made of iron. When voltage is applied to one coil (frequently called the primary or input) it

magnetizes the iron core, which induces a voltage in the other coil, (frequently called the

secondary or output). The turn’s ratio of the two sets of windings determines the amount of

voltage transformation.

Figure: Step-Down Transformer

[IR Signal Tracking System] Page 29

Page 30: IR Signal Tracking System

An example of this would be: 100 turns on the primary and 50 turns on the secondary, a ratio of 2 to 1.

Step down transformers can be considered nothing more than a voltage ratio device.

With step down transformers the voltage ratio between primary and secondary will mirror the

"turn’s ratio" (except for single phase smaller than 1 kva which have compensated secondary). A

practical application of this 2 to 1 turn’s ratio would be a 480 to 240 voltage step down. Note that

if the input were 440 volts then the output would be 220 volts. The ratio between input and

output voltage will stay constant. Transformers should not be operated at voltages higher than

the nameplate rating, but may be operated at lower voltages than rated. Because of this it is

possible to do some non-standard applications using standard transformers.

Single phase step down transformers 1 kva and larger may also be reverse connected to step-

down or step-up voltages. (Note: single phase step up or step down transformers sized less than 1

KVA should not be reverse connected because the secondary windings have additional turns to

overcome a voltage drop when the load is applied. If reverse connected, the output voltage will

be less than desired.)

Step-Up Transformer

A step up transformer has more turns of wire on the secondary coil, which makes a larger induced voltage

in the secondary coil. It is called a step up transformer because the voltage output is larger than the

voltage input.

Step-up transformer 110v 220v design is one whose secondary voltage is greater than its primary voltage.

This kind of transformer "steps up" the voltage applied to it. For instance, a step up transformer is needed

to use a 220v product in a country with a 110v supply.

A step up transformer 110v 220v converts alternating current (AC) from one voltage to another

voltage. It has no moving parts and works on a magnetic induction principle; it can be designed

to "step-up" or "step-down" voltage. So a step up transformer increases the voltage and a step

down transformer decreases the voltage.

[IR Signal Tracking System] Page 30

Page 31: IR Signal Tracking System

The primary components for voltage transformation are the step up transformer core and coil.

The insulation is placed between the turns of wire to prevent shorting to one another or to

ground. This is typically comprised of Mylar, nomex, Kraft paper, varnish, or other materials. As

a transformer has no moving parts, it will typically have a life expectancy between 20 and 25

years.

Figure: Step-Up Transformer

Applications :

Generally these Step-Up Transformers are used in industries applications only.

Types of Transformer

Mains Transformers

Mains transformers are the most common type.  They are designed to reduce the AC mains supply

voltage (230-240V in the UK or 115-120V in some countries) to a safer low voltage. The standard

mains supply voltages are officially 115V and 230V, but 120V and 240V are the values usually quoted

and the difference is of no significance in most cases.

Figure: Main Transformer

[IR Signal Tracking System] Page 31

   

Page 32: IR Signal Tracking System

To allow for the two supply voltages mains transformers usually have two separate primary coils

(windings) labeled 0-120V and 0-120V. The two coils are connected in series for 240V (figure 2a) and in

parallel for 120V (figure 2b). They must be wired the correct way round as shown in the diagrams

because the coils must be connected in the correct sense (direction):

Most mains transformers have two separate secondary coils (e.g. labeled 0-9V, 0-9V) which may be used

separately to give two independent supplies, or connected in series to create a center-tapped coil (see

below) or one coil with double the voltage.

Some mains transformers have a centre-tap halfway through the secondary coil and they are labeled 9-0-

9V for example. They can be used to produce full-wave rectified DC with just two diodes, unlike a

standard secondary coil which requires four diodes to produce full-wave rectified DC.

A mains transformer is specified by:

1. Its secondary (output) voltages Vs.

2. Its maximum power, Pmax, which the transformer can pass, quoted in VA (volt-amp). This

determines the maximum output (secondary) current, Imax...

[IR Signal Tracking System] Page 32

Page 33: IR Signal Tracking System

...where Vs is the secondary voltage.  If there are two secondary coils the maximum power should

be halved to give the maximum for each coil.

3. Its construction - it may be PCB-mounting, chassis mounting (with solder tag connections) or

toroidal (a high quality design).

Audio Transformers

Audio transformers are used to convert the moderate voltage, low current output of an audio amplifier to

the low voltage, high current required by a loudspeaker.  This use is called 'impedance matching' because

it is matching the high impedance output of the amplifier to the low impedance of the loudspeaker.

Figure: Audio transformer

Radio Transformers

Radio transformers are used in tuning circuits. They are smaller than mains and audio transformers and

they have adjustable ferrite cores made of iron dust. The ferrite cores can be adjusted with a non-magnetic

plastic tool like a small screwdriver. The whole transformer is enclosed in an aluminum can which acts as

a shield, preventing the transformer radiating too much electrical noise to other parts of the circuit.

Figure: Radio Transformer

Turns Ratio and Voltage

[IR Signal Tracking System] Page 33

Page 34: IR Signal Tracking System

The ratio of the number of turns on the primary and secondary coils determines the ratio of the voltages...

...where Vp is the primary (input) voltage, Vs is the secondary (output) voltage, Np is the number of turns

on the primary coil, and Ns is the number of turns on the secondary coil.

Diodes

Diodes allow electricity to flow in only one direction.  The arrow of the circuit symbol shows the

direction in which the current can flow.  Diodes are the electrical version of a valve and early

diodes were actually called valves.

Figure: Diode Symbol

A diode is a device which only allows current to flow through it in one direction.  In this

direction, the diode is said to be 'forward-biased' and the only effect on the signal is that there

will be a voltage loss of around 0.7V.  In the opposite direction, the diode is said to be 'reverse-

biased' and no current will flow through it.

Rectifier

The purpose of a rectifier is to convert an AC waveform into a DC waveform (OR) Rectifier

converts AC current or voltages into DC current or voltage.  There are two different rectification

circuits, known as 'half-wave' and 'full-wave' rectifiers.  Both use components called diodes to

convert AC into DC.

[IR Signal Tracking System] Page 34

Page 35: IR Signal Tracking System

The Half-wave Rectifier

The half-wave rectifier is the simplest type of rectifier since it only uses one diode, as shown in

figure.

Figure: Half Wave Rectifier

Figure 2 shows the AC input waveform to this circuit and the resulting output.  As you can see,

when the AC input is positive, the diode is forward-biased and lets the current through.  When

the AC input is negative, the diode is reverse-biased and the diode does not let any current

through, meaning the output is 0V.  Because there is a 0.7V voltage loss across the diode, the

peak output voltage will be 0.7V less than Vs.

Figure: Half-Wave Rectification

[IR Signal Tracking System] Page 35

Page 36: IR Signal Tracking System

While the output of the half-wave rectifier is DC (it is all positive), it would not be suitable as a

power supply for a circuit.  Firstly, the output voltage continually varies between 0V and Vs-

0.7V, and secondly, for half the time there is no output at all. 

The Full-wave Rectifier

The circuit in figure 3 addresses the second of these problems since at no time is the output

voltage 0V.  This time four diodes are arranged so that both the positive and negative parts of the

AC waveform are converted to DC.  The resulting waveform is shown in figure 4.

Figure: Full-Wave Rectifier

Figure: Full-Wave Rectification

[IR Signal Tracking System] Page 36

Page 37: IR Signal Tracking System

When the AC input is positive, diodes A and B are forward-biased, while diodes C and D are

reverse-biased.  When the AC input is negative, the opposite is true - diodes C and D are

forward-biased, while diodes A and B are reverse-biased.

While the full-wave rectifier is an improvement on the half-wave rectifier, its output still isn't

suitable as a power supply for most circuits since the output voltage still varies between 0V and

Vs-1.4V.  So, if you put 12V AC in, you will 10.6V DC out.

Capacitor Filter

The capacitor-input filter, also called "Pi" filter due to its shape that looks like the Greek letter

pi, is a type of electronic filter. Filter circuits are used to remove unwanted or undesired

frequencies from a signal.

Figure: Capacitor Filter

A typical capacitor input filter consists of a filter capacitor C1, connected across the rectifier output, an

inductor L, in series and another filter capacitor connected across the load.

1. The capacitor C1 offers low reactance to the AC component of the rectifier output while it offers

infinite reactance to the DC component. As a result the capacitor shunts an appreciable amount of

the AC component while the DC component continues its journey to the inductor L

2. The inductor L offers high reactance to the AC component but it offers almost zero reactance to

the DC component. As a result the DC component flows through the inductor while the AC

component is blocked.

3. The capacitor C2 bypasses the AC component which the inductor had failed to block. As a result

only the DC component appears across the load RL.

[IR Signal Tracking System] Page 37

Page 38: IR Signal Tracking System

Figure: Centered Tapped Full-Wave Rectifier with a Capacitor Filter

Voltage Regulator

A voltage regulator is an electrical regulator designed to automatically maintain a constant

voltage level. It may use an electromechanical mechanism, or passive or active electronic

components. Depending on the design, it may be used to regulate one or more AC or DC

voltages. There are two types of regulator are they.

Positive Voltage Series (78xx) and

Negative Voltage Series (79xx)

78xx:

’78’ indicate the positive series and ‘xx’indicates the voltage rating. Suppose 7805 produces

the maximum 5V.’05’indicates the regulator output is 5V.

79xx:

’78’ indicate the negative series and ‘xx’indicates the voltage rating. Suppose 7905

produces the maximum -5V.’05’indicates the regulator output is -5V.

These regulators consists the three pins there are

Pin1: It is used for input pin.

[IR Signal Tracking System] Page 38

Page 39: IR Signal Tracking System

Pin2: This is ground pin for regulator

Pin3: It is used for output pin. Through this pin we get the output.

Figure: Regulator

SWITCHES:

Switches and Pushbuttons

In electronics, a switch is an electrical component that can break an electrical circuit,

interrupting the current or diverting it from one conductor to another.[1][2]

The most familiar form of switch is a manually operated electromechanical device with one or

more sets of electrical contacts, which are connected to external circuits. Each set of contacts can

be in one of two states: either "closed" meaning the contacts are touching and electricity can flow

between them, or "open", meaning the contacts are separated and the switch is non conducting.

The mechanism actuating the transition between these two states (open or closed) can be either a

"toggle" (flip switch for continuous "on" or "off") or "momentary" (push-for "on" or push-for

"off") type.

A switch may be directly manipulated by a human as a control signal to a system, such as a

computer keyboard button, or to control power flow in a circuit, such as alight switch.

Automatically operated switches can be used to control the motions of machines, for example, to

indicate that a garage door has reached its full open position or that a machine tool is in a

position to accept another work piece. Switches may be operated by process variables such as

pressure, temperature, flow, current, voltage, and force, acting as sensors in a process and used to

automatically control a system. For example, a thermostat is a temperature-operated switch used

to control a heating process. A switch that is operated by another electrical circuit is called

[IR Signal Tracking System] Page 39

Page 40: IR Signal Tracking System

a relay. Large switches may be remotely operated by a motor drive mechanism. Some switches

are used to isolate electric power from a system, providing a visible point of isolation that can be

pad-locked if necessary to prevent accidental operation of a machine during maintenance, or to

prevent electric shock.

Push Button Switch with High quality and durable square tactile button which are easily fitted in

breadboard and PCB.Dimension: 6x6mm and button height is 2.5mm.

There is nothing simpler than this! This is the simplest way of controlling appearance of some

voltage on microcontroller’s input pin. There is also no need for additional explanation of how

these components operate.

[IR Signal Tracking System] Page 40

Page 41: IR Signal Tracking System

Nevertheless, it is not so simple in practice... This is about something commonly unnoticeable

when using these components in everyday life. It is about contact bounce- a common problem

with m e c h a n i c a l switches. If contact switching does not happen so quickly, several

consecutive bounces can be noticed prior to maintain stable state. The reasons for this are:

vibrations, slight rough spots and dirt. Anyway, whole this process does not last long (a few

micro- or miliseconds), but long enough to be registered by the microcontroller. Concerning

pulse counter, error occurs in almost 100% of cases!

The simplest solution is to connect simple RC circuit which will “suppress” each quick voltage

change. Since the bouncing time is not defined, the values of elements are not strictly

determined. In the most cases, the values shown on figure are sufficient.

If complete safety is needed, radical measures should be taken! The circuit, shown on the figure

(RS flip-flop), changes logic state on its output with the first pulse triggered by contact bounce.

Even though this is more expensive solution (SPDT switch), the problem is definitely resolved!

Besides, since the condensator is not used, very short pulses can be also registered in this way. In

addition to these hardware solutions, a simple software solution is commonly applied too: when

a program tests the state of some input pin and finds changes, the check should be done one more

time after certain time delay. If the change is confirmed it means that switch (or pushbutton) has

changed its position. The advantages of such solution are obvious: it is free of charge, effects of

disturbances are eliminated too and it can be adjusted to the worst-quality contacts.

SWITCH INTERFACING:

CPU accesses the switches through ports. Therefore these switches are connected to a

microcontroller. This switch is connected between the supply and ground terminals. A single

[IR Signal Tracking System] Page 41

Page 42: IR Signal Tracking System

microcontroller (consisting of a microprocessor, RAM and EEPROM and several ports all on a

single chip) takes care of hardware and software interfacing of the switch.

These switches are connected to an input port. When no switch is pressed, reading the

input port will yield 1s since they are all connected to high (Vcc). But if any switch is pressed,

one of the input port pins will have 0 since the switch pressed provides the path to ground. It is

the function of the microcontroller to scan the switches continuously to detect and identify the

switch pressed.

The switches that we are using in our project are 4 leg micro switches of momentary

type.

Vcc

R

Gnd

Fig: Interfacing switch with the microcontroller

[IR Signal Tracking System] Page 42

P2.0

Page 43: IR Signal Tracking System

Thus now the two conditions are to be remembered:

1. When the switch is open, the total supply i.e., Vcc appears at the port pin P2.0

P2.0 = 1

2. When the switch is closed i.e., when it is pressed, the total supply path is provided to

ground. Thus the voltage value at the port pin P2.0 will be zero.

P2.0 = 0

By reading the pin status, the microcontroller identifies whether the switch is pressed or

not. When the switch is pressed, the corresponding related to this switch press written in the

program will be executed.

[IR Signal Tracking System] Page 43

Page 44: IR Signal Tracking System

AT89S52 MICROCONTROLLER

[IR Signal Tracking System] Page 44

Page 45: IR Signal Tracking System

MICROCONTROLLERS:

Microprocessors and microcontrollers are widely used in embedded systems

products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to

a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed

amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal

for many applications in which cost and space are critical.

The Intel 8052 is Harvard architecture, single chip microcontroller (µC) which was

developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early

1990s, but today it has largely been superseded by a vast range of enhanced devices with 8052-

compatible processor cores that are manufactured by more than 20 independent manufacturers

including Atmel, Infineon Technologies and Maxim Integrated Products.

8052 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a

time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8052

is available in different memory types such as UV-EPROM, Flash and NV-RAM.

The present project is implemented on Keil uVision. In order to program the device,

proload tool has been used to burn the program onto the microcontroller.

The features, pin description of the microcontroller and the software tools used are

discussed in the following sections.

[IR Signal Tracking System] Page 45

Page 46: IR Signal Tracking System

FEATURES

• Compatible with MCS-51® Products

• 8K Bytes of In-System Programmable (ISP) Flash Memory

– Endurance: 1000 Write/Erase Cycles

• 4.0V to 5.5V Operating Range

• Fully Static Operation: 0 Hz to 33 MHz

• Three-level Program Memory Lock

• 256 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Three 16-bit Timer/Counters

• Eight Interrupt Sources

• Full Duplex UART Serial Channel

• Low-power Idle and Power-down Modes

• Interrupt Recovery from Power-down Mode

• Watchdog Timer

• Dual Data Pointer

• Power-off Flag

[IR Signal Tracking System] Page 46

Page 47: IR Signal Tracking System

DESCRIPTION

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K

bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s

high-density nonvolatile memory technology and is compatible with the industry- standard

80C51 instruction set and pinout. The on-chip Flash allows the program memory to be

reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a

versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel

AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective

solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of

RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector

two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.

In addition, the AT89S52 is designed with static logic for operation down to zero frequency and

supports two software selectable power saving modes.

The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and

interrupt system to continue functioning. The Power-down mode saves the RAM contents but

freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

[IR Signal Tracking System] Page 47

Page 48: IR Signal Tracking System

PIN CONFIGURATIONS

[IR Signal Tracking System] Page 48

Page 49: IR Signal Tracking System

[IR Signal Tracking System] Page 49

Page 50: IR Signal Tracking System

PIN DESCRIPTION

[IR Signal Tracking System] Page 50

Page 51: IR Signal Tracking System

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 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.

[IR Signal Tracking System] Page 51

Page 52: IR Signal Tracking System

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 pull-

ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX

@ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the

high-order address bits and some control signals during Flash 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.

[IR Signal Tracking System] Page 52

Page 53: IR Signal Tracking System

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

[IR Signal Tracking System] Page 53

Page 54: IR Signal Tracking System

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 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.

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be

configured for use as an on-chip oscillator, as shown in Figure. Either a quartz crystal or ceramic

resonator may be used. To drive the device from an external clock source, XTAL2 should be left

[IR Signal Tracking System] Page 54

Page 55: IR Signal Tracking System

unconnected while XTAL1 is driven, as shown in the below figure. There are no requirements on

the duty cycle of the external clock signal, since the input to the internal clocking circuitry is

through a divide-by-two flip-flop, but minimum and maximum voltage high and low time

specifications must be observed.

Fig: Oscillator Connections

C1, C2 = 30 pF ± 10 pF for Crystals

= 40 pF ± 10 pF for Ceramic Resonators

[IR Signal Tracking System] Page 55

Page 56: IR Signal Tracking System

Fig: External Clock Drive Configuration

8052 MICROCONTROLLER MEMORY ORGANIZATION

The microcontroller memory is divided into Program Memory and Data Memory. Program

Memory (ROM) is used for permanent saving program being executed, while Data Memory

(RAM) is used for temporarily storing and keeping intermediate results and variables. Depending

on the model in use (still referring to the whole 8052 microcontroller family) at most a few Kb of

ROM and 128 or 256 bytes of RAM can be used. However…

All 8052 microcontrollers have 16-bit addressing bus and can address 64 kb memory. It is

neither a mistake nor a big ambition of engineers who were working on basic core development.

It is a matter of very clever memory organization which makes these controllers a real

“programmers’ tidbit“.

Program Memory

The oldest models of the 8052 microcontroller family did not have any internal program

memory. It was added from outside as a separate chip. These models are recognizable by their

label beginning with 803 (for ex. 8031 or 8032). All later models have a few Kbytes ROM

embedded, Even though it is enough for writing most of the programs, there are situations when

additional memory is necessary. A typical example of it is the use of so called lookup tables.

They are used in cases when something is too complicated or when there is no time for solving

equations describing some process. The example of it can be totally exotic (an estimate of self-

[IR Signal Tracking System] Page 56

Page 57: IR Signal Tracking System

guided rockets’ meeting point) or totally common (measuring of temperature using non-linear

thermo element or asynchronous motor speed control). In those cases all needed estimates and

approximates are executed in advance and the final results are put in the tables (similar to

logarithmic tables).

How does the microcontroller handle external memory depend on the pin EA logic state?

[IR Signal Tracking System] Page 57

Page 58: IR Signal Tracking System

EA=0 In this case, internal program memory is completely ignored, only a program stored in

external memory is to be executed.

EA=1 In this case, a program from built-in ROM is to be executed first (to the last location).

Afterwards, the execution is continued by reading additional memory.

in both cases, P0 and P2 are not available to the user because they are used for data and address

transmission. Besides, the pins ALE and PSEN are used too.

[IR Signal Tracking System] Page 58

Page 59: IR Signal Tracking System

Data Memory

As already mentioned, Data Memory is used for temporarily storing and keeping data and

intermediate results created and used during microcontroller’s operating. Besides, this

microcontroller family includes many other registers such as: hardware counters and timers,

input/output ports, serial data buffers etc. The previous versions have the total memory size of

256 locations, while for later models this number is incremented by additional 128 available

registers. In both cases, these first 256 memory locations (addresses 0-FFh) are the base of the

memory. Common to all types of the 8052 microcontrollers. Locations available to the user

occupy memory space with addresses from 0 to 7Fh. First 128 registers and this part of RAM is

divided in several blocks.

The first block consists of 4 banks each including 8 registers designated as R0 to R7. Prior to

access them, a bank containing that register must be selected. Next memory block (in the range

of 20h to 2Fh) is bit- addressable, which means that each bit being there has its own address

from 0 to 7Fh. Since there are 16 such registers, this block contains in total of 128 bits with

separate addresses (The 0th bit of the 20h byte has the bit address 0 and the 7th bit of the 2Fh

byte has the bit address 7Fh). The third groups of registers occupy addresses 2Fh-7Fh (in total of

80 locations) and does not have any special purpose or feature.

Additional Memory Block of Data Memory

In order to satisfy the programmers’ permanent hunger for Data Memory, producers have

embedded an additional memory block of 128 locations into the latest versions of the 8052

microcontrollers. Naturally, it’s not so simple…The problem is that electronics performing

addressing has 1 byte (8 bits) on disposal and due to that it can reach only the first 256 locations.

In order to keep already existing 8-bit architecture and compatibility with other existing models a

little trick has been used.

Using trick in this case means that additional memory block shares the same addresses with

existing locations intended for the SFRs (80h- FFh). In order to differentiate between these two

physically separated memory spaces, different ways of addressing are used. A direct addressing

[IR Signal Tracking System] Page 59

Page 60: IR Signal Tracking System

is used for all locations in the SFRs, while the locations from additional RAM are accessible

using indirect addressing.

Fig: Microcontroller internal structure

[IR Signal Tracking System] Page 60

Page 61: IR Signal Tracking System

[IR Signal Tracking System] Page 61

Page 62: IR Signal Tracking System

How to extend memory?

In case on-chip memory is not enough, it is possible to add two external memory chips with

capacity of 64Kb each. I/O ports P2 and P3 are used for their addressing and data transmission.

From the users’ perspective, everything functions quite simple if properly connected because the

most operations are performed by the microcontroller itself. The 8052 microcontroller has two

separate reading signals RD#(P3.7) and PSEN#. The first one is activated byte from external data

memory (RAM) should be read, while another one is activated to read byte from external

program memory (ROM). These both signals are active at logical zero (0) level. A typical

[IR Signal Tracking System] Page 62

Page 63: IR Signal Tracking System

example of such memory extension using special chips for RAM and ROM is shown on the

previous picture. It is called Hardward architecture.

Even though the additional memory is rarely used with the latest versions of the

microcontrollers, it will be described here in short what happens when memory chips are

connected according to the previous scheme. It is important to know that the whole process is

performed automatically, i.e. with no intervention in the program.

When the program during execution encounters the instruction which resides in external

memory (ROM), the microcontroller will activate its control output ALE and set the first

8 bits of address (A0-A7) on P0. In this way, IC circuit 74HCT573 which "lets in" the

first 8 bits to memory address pins is activated.

A signal on the pin ALE closes the IC circuit 74HCT573 and immediately afterwards 8

higher bits of address (A8-A15) appear on the port. In this way, a desired location in

additional program memory is completely addressed. The only thing left over is to read

its content.

Pins on P0 are configured as inputs, the pin PSEN is activated and the microcon troller

reads content from memory chip. The same connections are used both for data and lower

address byte.

Similar occurs when it is a needed to read some location from external Data Memory. Now,

addressing is performed in the same way, while reading or writing is performed via signals

which appear on the control outputs RD or WR.

Addressing

While operating, processor processes data according to the program instructions. Each

instruction consists of two parts. One part describes what should be done and another part

indicates what to use to do it. This later part can be data (binary number) or address where the

data is stored. All 8052 microcontrollers use two ways of addressing depending on which part of

memory should be accessed:

[IR Signal Tracking System] Page 63

Page 64: IR Signal Tracking System

Direct Addressing

On direct addressing, a value is obtained from a memory location while the address of that

location is specified in instruction. Only after that, the instruction can process data (how depends

on the type of instruction: addition, subtraction, copy…). Obviously, a number being changed

during operating a variable can reside at that specified address. For example:

Since the address is only one byte in size ( the greatest number is 255), this is how only the first

255 locations in RAM can be accessed in this case the first half of the basic RAM is intended to

be used freely, while another half is reserved for the SFRs.

Indirect Addressing

On indirect addressing, a register which contains address of another register is specified in the

instruction. A value used in operating process resides in that another register. For example:

Only RAM locations available for use are accessed by indirect addressing (never in the SFRs).

For all latest versions of the microcontrollers with additional memory block (those 128 locations

in Data Memory), this is the only way of accessing them. Simply, when during operating, the

instruction including “@” sign is encountered and if the specified address is higher than 128 (7F

hex.), the processor knows that indirect addressing is used and jumps over memory space

reserved for the SFRs.

On indirect addressing, the registers R0, R1 or Stack Pointer are used for specifying 8-bit

addresses. Since only 8 bits are available, it is possible to access only registers of internal RAM

in this way (128 locations in former or 256 locations in latest versions of the microcontrollers). If

memory extension in form of additional memory chip is used then the 16-bit DPTR Register

(consisting of the registers DPTRL and DPTRH) is used for specifying addresses. In this way it

is possible to access any location in the range of 64K.

[IR Signal Tracking System] Page 64

Page 65: IR Signal Tracking System

SFRs (Special Function Registers)

SFRs are a kind of control table used for running and monitoring microcontroller’s operating.

Each of these registers, even each bit they include, has its name, address in the scope of RAM

and clearly defined purpose ( for example: timer control, interrupt, serial connection etc.). Even

though there are 128 free memory locations intended for their storage, the basic core, shared by

all types of 8052 controllers, has only 21 such registers. Rest of locations are intensionally left

free in order to enable the producers to further improved models keeping at the same time

compatibility with the previous versions. It also enables the use of programs written a long time

ago for the microcontrollers which are out of production now.

[IR Signal Tracking System] Page 65

Page 66: IR Signal Tracking System

A Register (Accumulator)

This is a general-purpose register which serves for storing intermediate results during operating.

A number (an operand) should be added to the accumulator prior to execute an instruction upon

it. Once an arithmetical operation is preformed by the ALU, the result is placed into the

accumulator. If a data should be transferred from one register to another, it must go through

accumulator. For such universal purpose, this is the most commonly used register that none

microcontroller can be imagined without (more than a half 8052 microcontroller's instructions

used use the accumulator in some way).

B Register

B register is used during multiply and divide operations which can be performed only upon

numbers stored in the A and B registers. All other instructions in the program can use this

register as a spare accumulator (A).

During programming, each of registers is called by name so that their exact address is not so

important for the user. During compiling into machine code (series of hexadecimal numbers

recognized as instructions by the microcontroller), PC will automatically, instead of registers’

name, write necessary addresses into the microcontroller.

[IR Signal Tracking System] Page 66

Page 67: IR Signal Tracking System

R Registers (R0-R7)

This is a common name for the total 8 general purpose registers (R0, R1, R2 ...R7). Even they

are not true SFRs, they deserve to be discussed here because of their purpose. The bank is active

when the R registers it includes are in use. Similar to the accumulator, they are used for

temporary storing variables and intermediate results. Which of the banks will be active depends

on two bits included in the PSW Register. These registers are stored in four banks in the scope of

RAM.

Description:

The AT89S52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 4K

bytes of Flash programmable memory. 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

AT89S52 is a powerful microcomputer, which provides a highly flexible and cost-effective

solution to many embedded control applications.

[IR Signal Tracking System] Page 67

Page 68: IR Signal Tracking System

In addition, the AT89S52 is designed with static logic for operation down to zero

frequency and supports two software selectable power saving modes. The Idle Mode stops the

CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue

functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling

all other chip functions until the next hardware reset.

Machine cycle for the 8052

The CPU takes a certain number of clock cycles to execute an instruction. In the 8052 family,

these clock cycles are referred to as machine cycles. The length of the machine cycle depends on

the frequency of the crystal oscillator. The crystal oscillator, along with on-chip circuitry,

provides the clock source for the 8052 CPU.

The frequency can vary from 4 MHz to 30 MHz, depending upon the chip rating and

manufacturer. But the exact frequency of 11.0592 MHz crystal oscillator is used to make the

8052 based system compatible with the serial port of the IBM PC.

In the original version of 8052, one machine cycle lasts 12 oscillator periods. Therefore, to

calculate the machine cycle for the 8052, the calculation is made as 1/12 of the crystal frequency

and its inverse is taken.

[IR Signal Tracking System] Page 68

Page 69: IR Signal Tracking System

DC motor

A DC motor is an electric motor that runs on direct current (DC) electricity.

DC Motor Connections

Figure shows schematically the different methods of connecting the field and armature circuits in

a DC Motor. The circular symbol represents the armature circuit, and the squares at the side

of the circle represent the brush commutator system. The direction of the arrows indicates the

direction of the magnetic fields.

THEORY OF DC MOTOR

The speed of a DC motor is directly proportional to the supply voltage, so if we reduce the

supply voltage from 12 Volts to 6 Volts, the motor will run at half the speed. How can this be achieved

when the battery is fixed at 12 Volts? The speed controller works by varying the average voltage sent to

the motor. It could do this by simply adjusting the voltage sent to the motor, but this is quite inefficient to

do. A better way is to switch the motor's supply on and off very quickly. If the switching is fast enough,

the motor doesn't notice it, it only notices the average effect.

[IR Signal Tracking System] Page 69

Page 70: IR Signal Tracking System

When you watch a film in the cinema, or the television, what you are actually seeing is a series of

fixed pictures, which change rapidly enough that your eyes just see the average effect - movement. Your

brain fills in the gaps to give an average effect.

Now imagine a light bulb with a switch. When you close the switch, the bulb goes on and is at full

brightness, say 100 Watts. When you open the switch it goes off (0 Watts). Now if you close the switch

for a fraction of a second, then open it for the same amount of time, the filament won't have time to cool

down and heat up, and you will just get an average glow of 50 Watts. This is how lamp dimmers work,

and the same principle is used by speed controllers to drive a motor. When the switch is closed, the motor

sees 12 Volts, and when it is open it sees 0 Volts. If the switch is open for the same amount of time as it is

closed, the motor will see an average of 6 Volts, and will run more slowly accordingly. The graph below

shows the speed of a motor that is being turned on and off.

Principles of operation

In any electric motor, operation is based on simple electromagnetism. A current-carrying

conductor generates a magnetic field; when this is then placed in an external magnetic field, it

will experience a force proportional to the current in the conductor, and to the strength of the

external magnetic field. As you are well aware of from playing with magnets as a kid, opposite

(North and South) polarities attract, while like polarities (North and North, South and South)

repel. The internal configuration of a DC motor is designed to harness the magnetic interaction

between a current-carrying conductor and an external magnetic field to generate rotational

motion.

Let's start by looking at a simple 2-pole DC electric motor (here red represents a magnet or

winding with a "North" polarization, while green represents a magnet or winding with a "South"

polarization).

[IR Signal Tracking System] Page 70

Page 71: IR Signal Tracking System

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator, field

magnet(s), and brushes. In most common DC motors (and all that Beamers will see), the external

magnetic field is produced by high-strength permanent magnets. The stator is the stationary part

of the motor -- this includes the motor casing, as well as two or more permanent magnet pole

pieces. The rotor (together with the axle and attached commutator) rotates with respect to the

stator. The rotor consists of windings (generally on a core), the windings being electrically

connected to the commutator. The above diagram shows a common motor layout -- with the

rotor inside the stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings are such that when power

is applied, the polarities of the energized winding and the stator magnet(s) are misaligned, and

the rotor will rotate until it is almost aligned with the stator's field magnets. As the rotor reaches

alignment, the brushes move to the next commutator contacts, and energize the next winding.

Given our example two-pole motor, the rotation reverses the direction of current through the

rotor winding, leading to a "flip" of the rotor's magnetic field, driving it to continue rotating.

In real life, though, DC motors will always have more than two poles (three is a very common

number). In particular, this avoids "dead spots" in the commutator. You can imagine how with

our example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned

with the field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a

moment where the commutator shorts out the power supply (i.e., both brushes touch both

commutator contacts simultaneously). This would be bad for the power supply, waste energy,

and damage motor components as well. Yet another disadvantage of such a simple motor is that

[IR Signal Tracking System] Page 71

Page 72: IR Signal Tracking System

it would exhibit a high amount of torque "ripple" (the amount of torque it could produce is cyclic

with the position of the rotor).

So since most small DC motors are of a three-pole design, let's tinker with the workings of one

via an interactive animation.

You'll notice a few things from this -- namely, one pole is fully energized at a time (but two

others are "partially" energized). As each brush transitions from one commutator contact to the

next, one coil's field will rapidly collapse, as the next coil's field will rapidly charge up (this

occurs within a few microsecond). We'll see more about the effects of this later, but in the

meantime you can see that this is a direct result of the coil windings' series wiring:

[IR Signal Tracking System] Page 72

Page 73: IR Signal Tracking System

The use of an iron core armature (as in the Mabuchi, above) is quite common, and has a number

of advantages. First off, the iron core provides a strong, rigid support for the windings -- a

particularly important consideration for high-torque motors. The core also conducts heat away

from the rotor windings, allowing the motor to be driven harder than might otherwise be the

case. Iron core construction is also relatively inexpensive compared with other construction

types.

But iron core construction also has several disadvantages. The iron armature has a relatively high

inertia which limits motor acceleration. This construction also results in high winding

inductances which limit brush and commutator life.

In small motors, an alternative design is often used which features a 'coreless' armature winding.

This design depends upon the coil wire itself for structural integrity. As a result, the armature is

hollow, and the permanent magnet can be mounted inside the rotor coil. Coreless DC motors

have much lower armature inductance than iron-core motors of comparable size, extending brush

and commutator life.

[IR Signal Tracking System] Page 73

Page 74: IR Signal Tracking System

DC motor behavior

High-speed output

This is the simplest trait to understand and treat -- most DC motors run at very high output

speeds (generally thousands or tens of thousands of RPM). While this is fine for some BEAM

bots (say, photo poppers or solar rollers), many BEAM bots (walkers, heads) require lower

speeds -- you must put gears on your DC motor's output for these applications.

Buzzer

What does it do?

The buzzer subsystem produces an audible tone when powered.

How does it operate?

Buzzer circuit

.

Buzzers come in a variety of voltages and currents. The power supply for the buzzer (which can be separate from the supply for the rest of the electronics) must provide the voltage needed by the buzzer.

Piezo sounders are a type of buzzer. They should not be confused with Piezo transducers – which require an a.c. input voltage to drive them.

Some process units provide enough current to drive buzzers. Typical buzzers require currents in the range 10 – 35mA.

If CMOS ICs or a higher current buzzer are used then a driver (transistor, Darlington or MOFET) is needed to boost the current. The circuit on the left shows the circuit needed with a driver.

[IR Signal Tracking System] Page 74

Page 75: IR Signal Tracking System

Buzzer curcuit for use with higher current process units

.

PICs , 555 Timer ICs and the LM324 op-amp can provide higher currents and can drive some buzzers directly.

Check the data for the buzzer and the process unit to make sure that the process unit can provide more current than is needed by the buzzer.

If this is possible, the buzzer is connected to the 0V rail (as on the left) rather than to +Vs.

Buzzers can either be PCB-mounted or connected to the circuit with flying leads. Usually it is neater to mount them on the PCB.

Applications

Making a warning sound Signalling that something has happened

Making

Buzzers have a positive and a negative terminal, marked on their case. The positive terminal should be connected to the positive voltage supply. The negative terminal should be connected to the signal from the driver.

The graphic on the left shows how part of the PCB might look for a PCB-mounted buzzer connected to a driver.

How part of the PCB might look

If a buzzer with flying leads is used then a terminal block is mounted on the PCB and wires from this are connected to the buzzer.

Build and test the unit that will provide the driving input signal before adding the buzzer.

Testing

Make sure that the buzzer switches on and off as power is applied from the driver unit.

[IR Signal Tracking System] Page 75

Page 76: IR Signal Tracking System

IR Transmitter, Receiver

IR SECTION:

[IR Signal Tracking System] Page 76

Page 77: IR Signal Tracking System

WHAT IS INFRARED?

Infrared is a energy radiation with a frequency below our eyes sensitivity, so we cannot see it

Even that we can not "see" sound frequencies, we know that it exist, we can listen them.

Even that we can not see or hear infrared, we can feel it at our skin temperature sensors.

When you approach your hand to fire or warm element, you will "feel" the heat, but you can't see

it. You can see the fire because it emits other types of radiation, visible to your eyes, but it also

emits lots of infrared that you can only feel in your skin.

 INFRARED IN ELECTRONICS

Infra-Red is interesting, because it is easily generated and doesn't suffer electromagnetic

interference, so it is nicely used to communication and control, but it is not perfect, some other

light emissions could contains infrared as well, and that can interfere in this communication. The

sun is an example, since it emits a wide spectrum or radiation.

The adventure of using lots of infra-red in TV/VCR remote controls and other applications,

brought infra-red diodes (emitter and receivers) at very low cost at the market.

From now on you should think as infrared as just a "red" light. This light can means something

to the receiver, the "on or off" radiation can transmit different meanings.Lots of things can

generate infrared, anything that radiate heat do it, including out body, lamps, stove, oven, friction

your hands together, even the hot water at the faucet. 

To allow a good communication using infra-red, and avoid those "fake" signals, it is imperative

to use a "key" that can tell the receiver what is the real data transmitted and what is fake.  As an

analogy, looking eye naked to the night sky you can see hundreds of stars, but you can spot

[IR Signal Tracking System] Page 77

Page 78: IR Signal Tracking System

easily a far away airplane just by its flashing strobe light.  That strobe light is the "key", the

"coding" element that alerts us.

Similar to the airplane at the night sky, our TV room may have hundreds of tinny IR sources, our

body and the lamps around, even the hot cup of tea.  A way to avoid all those other sources, is

generating a key, like the flashing airplane. So, remote controls use to pulsate its infrared in a

certain frequency.  The IR receiver module at the TV, VCR or stereo "tunes" to this certain

frequency and ignores all other IR received.  The best frequency for the job is between 30 and 60

KHz, the most used is around 36 KHz

IR GENERATION

To generate a 36 KHz pulsating infrared is quite easy, more difficult is to receive and identify

this frequency.  This is why some companies produce infrared receives, that contains the filters,

decoding circuits and the output shaper, that delivers a square wave, meaning the existence or

not of the 36kHz incoming pulsating infrared.

It means that those 3 dollars small units, have an output pin that goes high (+5V) when there

is a pulsating 36kHz infrared in front of it, and zero volts when there is not this radiation.

[IR Signal Tracking System] Page 78

Page 79: IR Signal Tracking System

A square wave of approximately 27uS (microseconds) injected at the base of a transistor, can

drive an infrared LED to transmit this pulsating light wave.  Upon its presence, the

commercial receiver will switch its output to high level (+5V).If you can turn on and off this

frequency at the transmitter, your receiver's output will indicate when the transmitter is on or off.

Those IR demodulators have inverted logic at its output, when a burst of IR is sensed it drives its

output to low level, meaning logic level = 1.

The TV, VCR, and Audio equipment manufacturers for long use infra-red at their remote

controls.  To avoid a Philips remote control to change channels in a Panasonic TV, they use

different codification at the infrared, even that all of them use basically the same transmitted

frequency, from 36 to 50 KHz.  So, all of them use a different combination of bits or how to code

the transmitted data to avoid interference. 

RC-5

Various remote control systems are used in electronic equipment today. The RC5 control

protocol is one of the most popular and is widely used to control numerous home appliances,

entertainment systems and some industrial applications including utility consumption remote

meter reading, contact-less apparatus control, telemetry data transmission, and car security

systems. Philips originally invented this protocol and virtually all Philips’ remotes use this

protocol. Following is a description of the RC5. When the user pushes a button on the hand-held

remote, the device is activated and sends modulated infrared light to transmit the command. The

remote separates command data into packets. Each data packet consists of a 14-bit data word,

[IR Signal Tracking System] Page 79

Page 80: IR Signal Tracking System

which is repeated if the user continues to push the remote button. The data packet structure is as

follows:

2 start bits,

1 control bit,

5 address bits,

6 command bits.

The start bits are always logic ‘1’ and intended to calibrate the optical receiver automatic gain

control loop. Next, is the control bit. This bit is inverted each time the user releases the remote

button and is intended to differentiate situations when the user continues to hold the same button

or presses it again. The next 5 bits are the address bits and select the destination device. A

number of devices can use RC5 at the same time. To exclude possible interference, each must

use a different address. The 6 command bits describe the actual command. As a result, a RC5

transmitter can send the 2048 unique commands. The transmitter shifts the data word, applies

Manchester encoding and passes the created one-bit sequence to a control carrier frequency

signal amplitude modulator. The amplitude modulated carrier signal is sent to the optical

transmitter, which radiates the infrared light. In RC5 systems the carrier frequency has been set

to 36 kHz. Figure below displays the RC5 protocol.

The receiver performs the reverse function. The photo detector converts optical transmission

into electric signals, filters it and executes amplitude demodulation. The receiver output bit

stream can be used to decode the RC5 data word. This operation is done by the microprocessor

typically, but complete hardware implementations are present on the market as well. Single-die

optical receivers are being mass produced by a number of companies such as Siemens, Temic,

Sharp, Xiamen Hualian, Japanese Electric and others. Please note that the receiver output is

inverted (log. 1 corresponds to illumination absence).

[IR Signal Tracking System] Page 80

Page 81: IR Signal Tracking System

IR TRANSMITTER:

The IR LED emitting infrared light is put on in the transmitting unit. To generate IR signal, 555

IC based astable multivibrator is used. Infrared LED is driven through transistor BC 548.

IC 555 is used to construct an astable multivibrator which has two quasi-stable states. It generates

a square wave of frequency 38 kHz and amplitude 5Volts. It is required to switch ‘ON’ the IR LED. The

IR transmitter circuit is as shown below:

555 TIMER:

The 555 is an integrated circuit (chip) implementing a variety of timer and multivibrator

applications. It was designed in 1970 and introduced in 1971 by Signetics (later acquired by

Philips). The original name was the SE555/NE555 and was called "The IC Time Machine". It

[IR Signal Tracking System] Page 81

Page 82: IR Signal Tracking System

is still in wide use, thanks to its ease of use, low price and good stability. As of 2003, 1 billion

units are manufactured every year.

The 555 timer is one of the most popular and versatile integrated circuits ever produced.

It includes 23 transistors, 2 diodes and 16 resistors on a silicon chip installed in an 8-pin mini

dual-in-line package (DIP-8). The 556 is a 14-pin DIP that combines two 555s on a single chip.

Fig: 555 timer

Pin Functions - 8 pin package

Ground (Pin 1)

  This pin is connected directly to ground.

Trigger (Pin 2)

[IR Signal Tracking System] Page 82

Page 83: IR Signal Tracking System

   This pin is the input to the lower comparator and is used to set the latch, which in turn causes the output

to go high.

Output (Pin 3)

  Output high is about 1.7V less than supply. Output high is capable of sourcing up to 200mA while

output low is capable of sinking up to 200mA.

Reset (Pin 4)

This is used to reset the latch and return the output to a low state. The reset is an overriding function.

When not used connect to V+.

Control (Pin 5)

Allows access to the 2/3V+ voltage divider point when the 555 timer is used in voltage control mode.

When not used connect to ground through a 0.01 uF capacitor.

Threshold (Pin 6)

 This is an input to the upper comparator.

Discharge (Pin 7)

This is the open collector to Q14.

V+ (Pin 8)

 This connects to Vcc and the Philips data book states the ICM7555 CMOS version operates 3V - 16V

DC while the NE555 version is 3V - 16V DC.

[IR Signal Tracking System] Page 83

Page 84: IR Signal Tracking System

The 555 has three operating modes:

Monostable mode: in this mode, the 555 functions as a "one-shot". Applications include timers,

missing pulse detection, bounce free switches, touch switches, Frequency Divider, Capacitance

Measurement, Pulse Width Modulation (PWM) etc

Astable mode: Free Running mode: the 555 can operate as an oscillator. Uses include LED and

lamp flashers, pulse generation, logic clocks, tone generation, security alarms, pulse position

modulation, etc.

Bistable mode: The 555 can operate as a flip-flop, if the DIS pin is not connected and no

capacitor is used. Uses include bounce free latched switches, etc.

How to generate frequency with astable multi based on 555 timer?

This circuit diagram shows how a 555 timer IC is configured to function as an astable

multivibrator.  An astable multivibrator is a timing circuit whose 'low' and 'high' states are

both unstable.  As such, the output of an astable multivibrator toggles between 'low' and 'high'

continuously, in effect generating a train of pulses. This circuit is therefore also known as a

'pulse generator' circuit.

   

In this circuit, capacitor C1 charges through R1 and R2, eventually building up

enough voltage to trigger an internal comparator to toggle the output flip-flop.  Once toggled,

the flip-flop discharges C1 through R2 into pin 7, which is the discharge pin.  When C1's

voltage becomes low enough, another internal comparator is triggered to toggle the output

flip-flop. This once again allows C1 to charge up through R1 and R2 and the cycle starts all

over again.

     

C1's charge-up time t1 is given by: t1 = 0.693(R1+R2) C1. C1's discharge time t2 is

given by: t2 = 0.693(R2) C1.  Thus, the total period of one cycle is t1+t2 = 0.693 C1

(R1+2R2).  The frequency f of the output wave is the reciprocal of this period, and is

therefore given by:

[IR Signal Tracking System] Page 84

Page 85: IR Signal Tracking System

f = 1.44/ (C1 (R1+2R2))

where f is in Hz if R1 and R2 are in megaohms and C1 is in microfarads.  

IR RECEIVER

Description

The TSOP17.. – Series are miniaturized receivers for infrared remote control systems.

PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR

filter.

The demodulated output signal can directly be decoded by a microprocessor. TSOP17.. is

the standard IR remote control receiver series, supporting all major transmission codes.

[IR Signal Tracking System] Page 85

Page 86: IR Signal Tracking System

Features

Photo detector and preamplifier in one package

Internal filter for PCM frequency

Improved shielding against electrical field disturbance

TTL and CMOS compatibility

Output active low

Low power consumption

High immunity against ambient light

Continuous data transmission possible (up to 2400 bps)

Suitable burst length .10 cycles/burst

[IR Signal Tracking System] Page 86

Page 87: IR Signal Tracking System

Suitable Data Format

The circuit of the TSOP17 is designed in that way that unexpected output pulses due to

noise or disturbance signals are avoided. A bandpass filter, an integrator stage and an automatic

gain control are used to suppress such disturbances. The distinguishing mark between data signal

and disturbance signal are carrier frequency, burst length and duty cycle. The data signal should

fulfil the following condition:

• Carrier frequency should be close to center frequency of the bandpass (e.g. 38 KHz).

• Burst length should be 10 cycles/burst or longer.

• After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is

necessary.

• For each burst which is longer than 1.8ms a corresponding gap time is necessary at some time

in the data stream. This gap time should have at least same length as the burst.

• Up to 1400 short bursts per second can be received continuously.

Some examples for suitable data format are: NEC Code, Toshiba Micom Format, Sharp

Code, RC5 Code, RC6 Code, R–2000 Code and Sony Format (SIRCS). When a disturbance

signal is applied to the TSOP17.. It can still receive the data signal. However the sensitivity is

reduced to that level that no unexpected pulses will occur. Some examples for such disturbance

signals which are suppressed by the TSOP17 are:

• DC light (e.g. from tungsten bulb or sunlight)

• Continuous signal at 38 kHz or at any other frequency

• Signals from fluorescent lamps with electronic ballast (an example of the signal modulation is

in the figure below).

[IR Signal Tracking System] Page 87

Page 88: IR Signal Tracking System

IR Emitter and IR phototransistor:

An infrared emitter is an LED made from gallium arsenide, which emits near-infrared

energy at about 880nm. The infrared phototransistor acts as a transistor with the base voltage

determined by the amount of light hitting the transistor. Hence it acts as a variable current

source. Greater amount of IR light cause greater currents to flow through the collector-emitter

leads. As shown in the diagram below, the phototransistor is wired in a similar configuration to

the voltage divider.

The variable current traveling through the resistor causes a voltage drop in the pull-up resistor.

This voltage is measured as the output of the device

[IR Signal Tracking System] Page 88

Page 89: IR Signal Tracking System

Photo

IR reflectance sensors contain a matched infrared transmitter and infrared receiver pair. These

devices work by measuring the amount of light that is reflected into the receiver. Because the

receiver also responds to ambient light, the device works best when well shielded from abient

light, and when the distance between the sensor and the reflective surface is small(less than

5mm).

IR reflectance sensors are often used to detect white and black surfaces. White surfaces generally

reflect well, while black surfaces reflect poorly. One of such applications is the line follower of a

robot.

[IR Signal Tracking System] Page 89

Page 90: IR Signal Tracking System

Schematic Diagram for a Single Pair of Infrared Transmitter and Receiver

Theory of Sensor Circuit

To get a good voltage swing , the value of R1 must be carefully chosen. If Rsensor = a when no

light falls on it and Rsensor = b when light falls on it. The difference in the two potentials is:

Vcc * { a/(a+R1) - b/(b+R1) }

Relative voltage swing = Actual Voltage Swing / Vcc

= Vcc * { a/(a+R1) - b/(b+R1) } / Vcc

= a/(a+R1) - b/(b+R1)

The resistance of the sensor decreases when IR light falls on it. A good sensor will have near

zero resistance in presence of light and a very large resistance in absence of light. We have used

this property of the sensor to form a potential divider. The potential at point ‘2’ is Rsensor /

(Rsensor + R1). Again, a good sensor circuit should give maximum change in potential at point

[IR Signal Tracking System] Page 90

Page 91: IR Signal Tracking System

‘2’ for no-light and bright-light conditions. This is especially important if you plan to use an

ADC in place of the comparator

To get a good voltage swing , the value of R1 must be carefully chosen. If Rsensor = a when no

light falls on it and Rsensor = b when light falls on it. The difference in the two potentials is:

Vcc * { a/(a+R1) - b/(b+R1) }

Relative voltage swing = Actual Voltage Swing / Vcc

= Vcc * { a/(a+R1) - b/(b+R1) } / Vcc

= a/(a+R1) - b/(b+R1)

If

the

[IR Signal Tracking System] Page 91

Page 92: IR Signal Tracking System

emitter and detector (aka phototransistor) are not blocked, then the output on pin 2 of the 74LS14

will be high (apx. 5 Volts). When they are blocked, then the output will be low (apx. 0 Volts).

The 74LS14 is a Schmitt triggered hex inverter. A Schmitt trigger is a signal conditioner. It

ensures that above a threshold value, we will always get "clean" HIGH and LOW signals. Not

Blocked Case: Pin 2 High Current from Vcc flows through the detector. The current continues to

flow through the base of Q2. Current from Vcc also flows through R2, and Q2's Drain and

Emitter to ground. As a result of this current path, there will be no current flowing through Q1's

base. The signal at U1's pin 1 will be low, and so pin 2 will be high. Blocked Case: Pin 2 Low

Current "stops" at the detector.

Q2's base is not turned on. The current is re-routed passing through R2 and into the base of Q1.

This allows current to flow from Q1's detector and exiting out Q1's emitter. Pin 1 is thus high

and pin 2 will be low. To detect a line to be followed, we are using two or more number of poto-

reflectors. Its output current that proportional to reflection rate of the floor is converted to

voltage with a resister and tested it if the line is detected or not.

However the threshold voltage cannot be fixed to any level because optical current by ambient

light is added to the output current.

Most photo-detecting modules are using moderated light to avoid interference by the ambient

light. The detected signal is filtered with a band pass filter and disused signals are filtered out.

Therefore only the moderated signal from the light emitter can be detected.

[IR Signal Tracking System] Page 92

Page 93: IR Signal Tracking System

Of course the detector must not be saturated by ambient light, this is effective when the detector

is working in linear region.

The line position is compared to the center value to be tracked, the position error is processed with

Proportional/Integral/Diffence filters to generate steering command. The line following robot tracks the

line in PID control that the most popular algorithm for servo control.

The proportional term is the common process in the servo system. It is only a gain amplifier without time

dependent process.

The differential term is applied in order to improve the response to disturbance, and it also compensate

phase lag at the controlled object.

The D term will be required in most case to stabilize tracking motion. The I term that boosts DC gain is

applied in order to remove left offset error, however, it often decrease servo stability due to its phase lag.

When any line sensing error has occurred for a time due to getting out of line or end of line, the motors

are stopped and the microcontroller enters sleep state of zero power consumption.

[IR Signal Tracking System] Page 93

Page 94: IR Signal Tracking System

LIQUID CRYSTAL DISPLAY:

LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven segment

LEDs or other multi segment LEDs) because of the following reasons:

1. The declining prices of LCDs.

2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited

to numbers and a few characters.

3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of

refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data.

4. Ease of programming for characters and graphics.

These components are “specialized” for being used with the microcontrollers, which means that they

cannot be activated by standard IC circuits. They are used for writing different messages on a miniature

LCD.

A model described here is for its low price and great possibilities most frequently used in practice. It is

based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16

characters each. It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols etc.

In addition, it is possible to display symbols that user makes up on its own. Automatic shifting message

on display (shift left and right), appearance of the pointer, backlight etc. are considered as useful

characteristics.

[IR Signal Tracking System] Page 94

Page 95: IR Signal Tracking System

Pins Functions

There are pins along one side of the small printed board used for connection to the microcontroller.

There are total of 14 pins marked with numbers (16 in case the background light is built in). Their

function is described in the table below:

Function Pin Number NameLogic

StateDescription

Ground 1 Vss - 0V

Power supply 2 Vdd - +5V

Contrast 3 Vee - 0 - Vdd

Control of

operating

4 RS0

1

D0 – D7 are interpreted as

commands

D0 – D7 are interpreted as data

5 R/W0

1

Write data (from controller to

LCD)

Read data (from LCD to

controller)

6 E

0

1

From 1 to 0

Access to LCD disabled

Normal operating

Data/commands are transferred to

LCD

Data / commands 7 D0 0/1 Bit 0 LSB

8 D1 0/1 Bit 1

9 D2 0/1 Bit 2

10 D3 0/1 Bit 3

11 D4 0/1 Bit 4

[IR Signal Tracking System] Page 95

Page 96: IR Signal Tracking System

12 D5 0/1 Bit 5

13 D6 0/1 Bit 6

14 D7 0/1 Bit 7 MSB

LCD screen:

LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot matrix.

Contrast on display depends on the power supply voltage and whether messages are displayed in one or

two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as Vee. Trimmer

potentiometer is usually used for that purpose. Some versions of displays have built in backlight (blue or

green diodes). When used during operating, a resistor for current limitation should be used (like with any

LE diode).

[IR Signal Tracking System] Page 96

Page 97: IR Signal Tracking System

LCD Basic Commands

All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data, which

depends on logic state on pin RS:

RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor addresses

built in “map of characters” and displays corresponding symbols. Displaying position is determined by

DDRAM address. This address is either previously defined or the address of previously transferred

character is automatically incremented.

RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands which LCD

recognizes are given in the table below:

Command RS RW D7 D6 D5 D4 D3 D2 D1 D0Execution

Time

Clear display 0 0 0 0 0 0 0 0 0 1 1.64mS

Cursor home 0 0 0 0 0 0 0 0 1 x 1.64mS

Entry mode set 0 0 0 0 0 0 0 1 I/D S 40uS

Display on/off control 0 0 0 0 0 0 1 D U B 40uS

Cursor/Display Shift 0 0 0 0 0 1 D/C R/L x x 40uS

Function set 0 0 0 0 1 DL N F x x 40uS

Set CGRAM address 0 0 0 1 CGRAM address 40uS

Set DDRAM address 0 0 1 DDRAM address 40uS

Read “BUSY” flag (BF) 0 1 BF DDRAM address -

Write to CGRAM or DDRAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS

Read from CGRAM or 1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS

[IR Signal Tracking System] Page 97

Page 98: IR Signal Tracking System

DDRAM

I/D 1 = Increment (by 1) R/L 1 = Shift right

0 = Decrement (by 1) 0 = Shift left

S 1 = Display shift on DL 1 = 8-bit interface

0 = Display shift off 0 = 4-bit interface

D 1 = Display on N 1 = Display in two lines

0 = Display off 0 = Display in one line

U 1 = Cursor on F 1 = Character format 5x10 dots

0 = Cursor off 0 = Character format 5x7 dots

B 1 = Cursor blink on D/C 1 = Display shift

0 = Cursor blink off 0 = Cursor shift

[IR Signal Tracking System] Page 98

Page 99: IR Signal Tracking System

LCD Initialization:

Once the power supply is turned on, LCD is automatically cleared. This process lasts for approximately

15mS. After that, display is ready to operate. The mode of operating is set by default. This means that:

1. Display is cleared

2. Mode

DL = 1 Communication through 8-bit interface

N = 0 Messages are displayed in one line

F = 0 Character font 5 x 8 dots

3. Display/Cursor on/off

D = 0 Display off

U = 0 Cursor off

B = 0 Cursor blink off

4. Character entry

ID = 1 Addresses on display are automatically incremented by 1

S = 0 Display shift off

Automatic reset is mainly performed without any problems. Mainly but not always! If for any reason

power supply voltage does not reach full value in the course of 10mS, display will start perform

completely unpredictably. If voltage supply unit can not meet this condition or if it is needed to provide

completely safe operating, the process of initialization by which a new reset enabling display to operate

normally must be applied. Algorithm according to the initialization is being performed depends on

whether connection to the microcontroller is through 4- or 8-bit interface. All left over to be done after

that is to give basic commands and of course- to display messages.

[IR Signal Tracking System] Page 99

Page 100: IR Signal Tracking System

Fig: Procedure on 8-bit initialization.

CONTRAST CONTROL:

To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust the

contrast, the voltage should be varied. For this, a preset is used which can behave like a variable

voltage device. As the voltage of this preset is varied, the contrast of the LCD can be adjusted.

[IR Signal Tracking System] Page 100

Page 101: IR Signal Tracking System

Fig: Variable resistor

Potentiometer

Variable resistors used as potentiometers have all three terminals connected.

This arrangement is normally used to vary voltage, for example to set the switching point of a circuit

with a sensor, or control the volume (loudness) in an amplifier circuit. If the terminals at the ends of the

track are connected across the power supply, then the wiper terminal will provide a voltage which can be

varied from zero up to the maximum of the supply.

[IR Signal Tracking System] Page 101

Potentiometer Symbol

 

Page 102: IR Signal Tracking System

Presets

These are miniature versions of the standard variable resistor. They are designed to be mounted

directly onto the circuit board and adjusted only when the circuit is built. For example to set the frequency

of an alarm tone or the sensitivity of a light-sensitive circuit. A small screwdriver or similar tool is

required to adjust presets.

Presets are much cheaper than standard variable resistors so they are sometimes used in projects

where a standard variable resistor would normally be used.

Multiturn presets are used where very precise adjustments must be made. The screw must be

turned many times (10+) to move the slider from one end of the track to the other, giving very

fine control.

[IR Signal Tracking System] Page 102

Preset Symbol

 

Page 103: IR Signal Tracking System

LCD INTERFACING WITH THE MICROCONTROLLER:

[IR Signal Tracking System] Page 103

Vcc

Gnd

PRESET

(CONTRAST CONTROL)

Vcc FOR BACKLIGHT PURPOSE

P2.0

P2.1

P2.2

4 (RS) 1

5 (R/W) 2

6(EN) 3

LCD

D0

Gnd

Page 104: IR Signal Tracking System

Relays

A relay is an electrically controllable switch widely used in industrial controls, automobiles

and appliances.

The relay allows the isolation of two separate sections of a system with two different voltage

sources i.e., a small amount of voltage/current on one side can handle a large amount of

voltage/current on the other side but there is no chance that these two voltages mix up.

Inductor

Fig: Circuit symbol of a relay

Operation:

When a current flow through the coil, a magnetic field is created around the coil i.e., the

coil is energized. This causes the armature to be attracted to the coil. The armature’s

contact acts like a switch and closes or opens the circuit. When the coil is not energized, a

spring pulls the armature to its normal state of open or closed. There are all types of

relays for all kinds of applications.

[IR Signal Tracking System] Page 104

Page 105: IR Signal Tracking System

Fig: Relay Operation and use of protection diodes

Transistors and ICs must be protected from the brief high voltage 'spike' produced when the

relay coil is switched off. The above diagram shows how a signal diode (eg 1N4148) is

connected across the relay coil to provide this protection. The diode is connected 'backwards' so

that it will normally not conduct. Conduction occurs only when the relay coil is switched off, at

this moment the current tries to flow continuously through the coil and it is safely diverted

through the diode. Without the diode no current could flow and the coil would produce a

damaging high voltage 'spike' in its attempt to keep the current flowing.

In choosing a relay, the following characteristics need to be considered:

1. The contacts can be normally open (NO) or normally closed (NC). In the NC type, the

contacts are closed when the coil is not energized. In the NO type, the contacts are closed when

the coil is energized.

2. There can be one or more contacts. i.e., different types like SPST (single pole single throw),

SPDT (single pole double throw) and DPDT (double pole double throw) relays.

3. The voltage and current required to energize the coil. The voltage can vary from a few volts to

50 volts, while the current can be from a few milliamps to 20milliamps. The relay has a

[IR Signal Tracking System] Page 105

Page 106: IR Signal Tracking System

minimum voltage, below which the coil will not be energized. This minimum voltage is called

the “pull-in” voltage.

4. The minimum DC/AC voltage and current that can be handled by the contacts. This is in the

range of a few volts to hundreds of volts, while the current can be from a few amps to 40A or

more, depending on the relay.

A relay is used to isolate one electrical circuit from another. It allows a low current control

circuit to make or break an electrically isolated high current circuit path. The basic relay consists

of a coil and a set of contacts. The most common relay coil is a length of magnet wire wrapped

around a metal core. When voltage is applied to the coil, current passes through the wire and

creates a magnetic field. This magnetic field pulls the contacts together and holds them there

until the current flow in the coil has stopped. The diagram below shows the parts of a simple

relay.

Figure: Relay

Operation:

When a current flows through the coil, the resulting magnetic field attracts an armature that is

mechanically linked to a moving contact. The movement either makes or breaks a connection

with a fixed contact. When the current is switched off, the armature is usually returned by a

spring to its resting position shown in figure 6.6(b). Latching relays exist that require operation

of a second coil to reset the contact position.

[IR Signal Tracking System] Page 106

Page 107: IR Signal Tracking System

By analogy with the functions of the original electromagnetic device, a solid-state relay operates

a thyristor or other solid-state switching device with a transformer or light-emitting diode to

trigger it.

Pole and throw

SPST

SPST relay stands for Single Pole Single Throw relay. Current will only flow through the

contacts when the relay coil is energized.

Figure: SPST Relay

SPDT Relay

SPDT Relay stands for Single Pole Double Throw relay. Current will flow between the movable

contact and one fixed contact when the coil is De-energized and between the movable contact

and the alternate fixed contact when the relay coil is energized. The most commonly used relay

in car audio, the Bosch relay, is a SPDT relay.

Figure: SPDT Relay

DPST Relay

[IR Signal Tracking System] Page 107

Page 108: IR Signal Tracking System

DPST relay stands for Double Pole Single Throw relay. When the relay coil is energized, two

separate and electrically isolated sets of contacts are pulled down to make contact with their

stationary counterparts. There is no complete circuit path when the relay is De-energized.

Figure: DPST Relay

DPDT Relay

DPDT relay stands for Double Pole Double Throw relay. It operates like the SPDT relay but has

twice as many contacts. There are two completely isolated sets of contacts.

Figure: DPDT Relay

This is a 4 Pole Double Throw relay. It operates like the SPDT relay but it has 4 sets of isolated

contacts.

[IR Signal Tracking System] Page 108

Page 109: IR Signal Tracking System

Figure: 4 Pole Double Throw relay

Types of relay:

1. Latching Relay

2. Reed Relay

3. Mercury Wetted Relay

4. Machine Tool Relay

5. Solid State Relay (SSR)

Latching relay

Latching relay, dust cover removed, showing pawl and ratchet mechanism. The ratchet operates

a cam, which raises and lowers the moving contact arm, seen edge-on just below it. The moving

and fixed contacts are visible at the left side of the image.

A latching relay has two relaxed states (bi-stable). These are also called "impulse", "keep", or

"stay" relays. When the current is switched off, the relay remains in its last state. This is achieved

with a solenoid operating a ratchet and cam mechanism, or by having two opposing coils with an

over-center spring or permanent magnet to hold the armature and contacts in position while the

coil is relaxed, or with a remanent core. In the ratchet and cam example, the first pulse to the coil

turns the relay on and the second pulse turns it off. In the two coil example, a pulse to one coil

turns the relay on and a pulse to the opposite coil turns the relay off. This type of relay has the

advantage that it consumes power only for an instant, while it is being switched, and it retains its

[IR Signal Tracking System] Page 109

Page 110: IR Signal Tracking System

last setting across a power outage. A remnant core latching relay requires a current pulse of

opposite polarity to make it change state.

Figure: Latching relay

Reed relay

A reed relay has a set of contacts inside a vacuum or inert gas filled glass tube, which protects

the contacts against atmospheric corrosion. The contacts are closed by a magnetic field generated

when current passes through a coil around the glass tube. Reed relays are capable of faster

switching speeds than larger types of relays, but have low switch current and voltage ratings.

Mercury-wetted Relay

A mercury-wetted reed relay is a form of reed relay in which the contacts are wetted with

mercury. Such relays are used to switch low-voltage signals (one volt or less) because of their

low contact resistance, or for high-speed counting and timing applications where the mercury

eliminates contact bounce. Mercury wetted relays are position-sensitive and must be mounted

vertically to work properly. Because of the toxicity and expense of liquid mercury, these relays

are rarely specified for new equipment. See also mercury switch.

Machine tool relay

A machine tool relay is a type standardized for industrial control of machine tools, transfer

machines, and other sequential control. They are characterized by a large number of contacts

(sometimes extendable in the field) which are easily converted from normally-open to normally-

closed status, easily replaceable coils, and a form factor that allows compactly installing many

[IR Signal Tracking System] Page 110

Page 111: IR Signal Tracking System

relays in a control panel. Although such relays once were the backbone of automation in such

industries as automobile assembly, the programmable logic controller (PLC) mostly displaced

the machine tool relay from sequential control applications.

Solid-state relay

A solid state relay (SSR) is a solid state electronic component that provides a similar function to

an electromechanical relay but does not have any moving components, increasing long-term

reliability. With early SSR's, the tradeoff came from the fact that every transistor has a small

voltage drop across it. This voltage drop limited the amount of current a given SSR could handle.

As transistors improved, higher current SSR's, able to handle 100 to 1,200 Amperes, have

become commercially available. Compared to electromagnetic relays, they may be falsely

triggered by transients.

Figure: Solid relay, which has no moving parts

Specification

Number and type of contacts – normally open, normally closed, (double-throw)

Contact sequence – "Make before Break" or "Break before Make". For example, the old

style telephone exchanges required Make-before-break so that the connection didn't get

dropped while dialing the number.

Rating of contacts – small relays switch a few amperes, large contactors are rated for up

to 3000 amperes, alternating or direct current

Voltage rating of contacts – typical control relays rated 300 VAC or 600 VAC,

automotive types to 50 VDC, special high-voltage relays to about 15 000 V

[IR Signal Tracking System] Page 111

Page 112: IR Signal Tracking System

Coil voltage – machine-tool relays usually 24 VAC, 120 or 250 VAC, relays for

switchgear may have 125 V or 250 VDC coils, "sensitive" relays operate on a few milli-

amperes

Applications:

Relays are used:

To control a high-voltage circuit with a low-voltage signal, as in some types of modems,

To control a high-current circuit with a low-current signal, as in the starter solenoid of an

automobile,

To detect and isolate faults on transmission and distribution lines by opening and closing

circuit breakers (protection relays),

To isolate the controlling circuit from the controlled circuit when the two are at different

potentials, for example when controlling a mains-powered device from a low-voltage

switch. The latter is often applied to control office lighting as the low voltage wires are

easily installed in partitions, which may be often moved as needs change. They may also

be controlled by room occupancy detectors in an effort to conserve energy,

To perform logic functions. For example, the boolean AND function is realized by

connecting relay contacts in series, the OR function by connecting contacts in parallel.

Due to the failure modes of a relay compared with a semiconductor, they are widely used

in safety critical logic, such as the control panels of radioactive waste handling

machinery.

As oscillators, also called vibrators. The coil is wired in series with the normally closed

contacts. When a current is passed through the relay coil, the relay operates and opens the

contacts that carry the supply current. This stops the current and causes the contacts to

close again. The cycle repeats continuously, causing the relay to open and close rapidly.

Vibrators are used to generate pulsed current.

To generate sound. A vibrator, described above, creates a buzzing sound because of the

rapid oscillation of the armature. This is the basis of the electric bell, which consists of a

vibrator with a hammer attached to the armature so it can repeatedly strike a bell.

[IR Signal Tracking System] Page 112

Page 113: IR Signal Tracking System

To perform time delay functions. Relays can be used to act as an mechanical time delay

device by controlling the release time by using the effect of residual magnetism by means

of a inserting copper disk between the armature and moving blade assembly.

[IR Signal Tracking System] Page 113

Page 114: IR Signal Tracking System

H Bridge

[IR Signal Tracking System] Page 114

Page 115: IR Signal Tracking System

H bridge:

An H bridge is an electronic circuit that enables a voltage to be applied across a load in either

direction. These circuits are often used inrobotics and other applications to allow DC motors to

run forwards and backwards. H bridges are available as integrated circuits, or can be built

from discrete components

The term H bridge is derived from the typical graphical representation of such a circuit. An H

bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4

(according to the first figure) are closed (and S2 and S3 are open) a positive voltage will be

applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this

voltage is reversed, allowing reverse operation of the motor.

Using the nomenclature above, the switches S1 and S2 should never be closed at the same time,

as this would cause a short circuit on the input voltage source. The same applies to the switches

S3 and S4. This condition is known as shoot-through.

[IR Signal Tracking System] Page 115

Page 116: IR Signal Tracking System

Operation:

The H-bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to

'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to

let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. The following

table summarises operation, with S1-S4 corresponding to the diagram above.

S1 S2 S3 S4 Result

1 0 0 1Motor moves right

0 1 1 0 Motor moves left

0 0 0 0 Motor free runs

0 1 0 1 Motor brakes

1 0 1 0 Motor brakes

Pin Diagram:

[IR Signal Tracking System] Page 116

Page 117: IR Signal Tracking System

The L293D is a quadruple push-pull 4 channel driver capable of delivering 600 mA (1.2 A peak

surge) per channel. The L293D is ideal for controlling the forward/reverse/brake motions of

small DC motors controlled by a microcontroller such as a PIC or BASIC Stamp.

The L293D is a high voltage, high current four channel driver designed to accept standard TTL

logic levels and drive inductive loads (such as relays solenoids, DC and stepping motors) and

switching power transistors. The L293D is suitable for use in switching applications at

frequencies up to 5 KHz.

Features Include :

600 mA Output Current Capability Per Driver

Pulsed Current 1.2 A / Driver

Wide Supply Voltage Range: 4.5 V to 36 V

Separate Input-Logic Supply

NE Package Designed for Heat Sinking

Thermal Shutdown & Internal ESD Protection

[IR Signal Tracking System] Page 117

Page 118: IR Signal Tracking System

High-Noise-Immunity Inputs

What does it do?

The relay subsystem is an electrically-operated switch. It requires a separate electrical supply to provide power to an output device. It is often used for reversing motors.

How does it operate?

Relay circuit

.

Like ordinary switches, relay switches are available as single-pole

single-throw (SPST), single-pole double-throw (SPDT), and double-

pole double-throw (DPDT). The circuit diagram on the left shows a

DPDT relay.

The switching is done by a coil of wire (an electromagnet) that creates

a magnetic field when a current passes through it.

The switch contacts in the relay change over due to the force from the

magnetic field when a current passes through the coil.

The reverse biased diode is included because, when relays are

switched off, they can generate a ‘back e.m.f.’ that can damage the

driver. When the relay is switched off the diode conducts current and

prevents the damage.

[IR Signal Tracking System] Page 118

Page 119: IR Signal Tracking System

The driver subsystem that provides the input signal to the relay must

be able to supply enough current for the coil.

A DPDT relay has three pairs of connections known as common

(CO), normally open (NO) and normally closed (NC).

Relay circuit for reversing a motor

A DPDT relay is often used to reverse a motor. The circuit diagram on

the left shows how the motor is connected to the relay.

When the input signal to the relay is high there is no current in the

relay coil (as on the left), the positive side of the battery B1 is

connected to the right-hand terminal of the motor, so the current in

the motor flows from right to left.

When the input signal to the relay is low there is current in the relay

coil (as on the left) and the switch contacts change over. So now the

positive side of the battery is connected to the left-hand terminal of

the motor, the current in the motor flows from left to right and so the

direction of rotation of the motor reverses.

The circuit diagram shows the basic principles. If it is necessary to

stop and start the motor this can be done with a separate driver or a

SPST relay.

A few relays need relatively low currents and can be driven directly from a PIC, 555 Timer IC or

LM324 op-amp. In these cases the relay coil is connected to the input signal and to 0V.

Applications

Reversing a motor

Providing electrical isolation between a noisy output device (such as a motor) and the

processing electronics.

[IR Signal Tracking System] Page 119

Page 120: IR Signal Tracking System

Controlling a low voltage a.c. output device, e.g. a low voltage halogen bulb (hotlink to

bulb data sheet, section that refers to halogen bulb)

IR SENSORS

IR sensors are keeping track with the target in all the directions. If the target is found to be

moved in any direction and then it gives a control signal to the microcontroller and the status is

displayed on the LCD for user identification. This project consists of two sections i.e., infrared

transmitter and receiver. The transmitter section is built around 555 timer . Here the 555 timer

working as an astable multivibrators. The IR led’s transmit 38kHz square wave pulses which are

generated by in astable mode.

The receiver circuit comprises of an IR sensor TSOP 1738, a timer, relay driver

transistor and its associated components. The time period can be changed by changing the

respective resistor and capacitor values in the receiver section.

[IR Signal Tracking System] Page 120

Page 121: IR Signal Tracking System

[IR Signal Tracking System] Page 121

RELAY RELAY

DEVICE DEVICE

INFRA RED

TRANSMITTER

INFRA RED

TRANSMITTER

INFRARED

RECEIVER

INFRARED

RECEIVER

Page 122: IR Signal Tracking System

FREQUENCY MODULATION

[IR Signal Tracking System] Page 122

Page 123: IR Signal Tracking System

In telecommunications and signal processing, frequency modulation (FM) conveys information

over a carrier wave by varying its instantaneous frequency. This contrasts with amplitude

modulation, in which the amplitude of the carrier is varied while its frequency remains constant.

In analog applications, the difference between the instantaneous and the base frequency of the

carrier is directly proportional to the instantaneous value of the input-signal amplitude. Digital

data can be sent by shifting the carrier's frequency among a range of settings, a technique known

as frequency-shift keying. FSK (digital FM) is widely used in data and fax modems. Morse code

transmission has been sent this way, and FASK was used in early telephone-line modems.[1]

Radioteletype also uses FSK.[2] FM modulation is also used in telemetry, radar, seismic

prospecting and newborn EEG seizure monitoring.[3] Frequency modulation is known as phase

modulation when the carrier phase modulation is the time integral of the FM signal. FM is

widely used for broadcasting music and speech, two-way radio systems, magnetic tape-recording

systems and some video-transmission systems. In radio systems, frequency modulation with

sufficient bandwidth provides an advantage in cancelling naturally-occurring noise.

Frequency Modulation (FM) means varying a radio signal's frequency (instead of amplitude) to

transmit useful information.

Some assistive listening devices, ALDs, and some assistive listening systems, ALSs, use FM to

transmit the signal representing sound from a transmitter to a receiver.

Many movie theaters now transmit the soundtrack of the movie in a low powered FM signal

throughout the theater. The theater will loan hard of hearing people a special receiver they can

use to receive that FM signal and therefore to hear better. You can buy personal FM systems that

you can use at home, in restuarants or in the car to hear someone you are with better ... or even to

hear the television at home.

Now, even some hearing aids can receive FM with an integrated (built-in) or boot receiver.

There is even a special frequency ranges that are assigned for use by assistive listening systems.

FM has advantages and disadvantages. It can be used outdoors, and it can transmit through walls

-- there is an alternative transmission method, IR, that uses infrared light to transmit the signal

that has different advantages and disadvantages.

[IR Signal Tracking System] Page 123

Page 124: IR Signal Tracking System

Whether the signal is transmitted via FM or IR, the advantage of using an ALD to transmit the

signal is that it overcomes distance and can eliminate background noise.

FM RADIO:

Radio is the transmission of signals through free space by electromagnetic waves with

frequencies significantly below visible light, in the radio frequency range, from about 3 kHz to

300 GHz. These waves are called radio waves. Electromagnetic radiation travels by means of

oscillating electromagnetic fields that pass through the air and the vacuum of space.

Information, such as sound, is carried by systematically changing (modulating) some property of

the radiated waves, such as their amplitude, frequency, phase, or pulse width. When radio waves

strike an electrical conductor, the oscillating fields induce an alternating current in the conductor.

The information in the waves can be extracted and transformed back into its original form.

[IR Signal Tracking System] Page 124

Page 125: IR Signal Tracking System

Software Tools

[IR Signal Tracking System] Page 125

Page 126: IR Signal Tracking System

KEIL SOFTWARE:

Keil compiler is a software used where the machine language code is written and

compiled. After compilation, the machine source code is converted into hex code which is to be

dumped into the microcontroller for further processing. Keil compiler also supports C language

code.

STEPS TO WRITE AN ASSEMBLY LANGUAGE PROGRAM IN KEIL AND HOW TO

COMPILE IT:

1. Install the Keil Software in the PC in any of the drives.

2. After installation, an icon will be created with the name “Keil uVision3”. Just drag this

icon onto the desktop so that it becomes easy whenever you try to write programs in keil.

3. Double click on this icon to start the keil compiler.

4. A page opens with different options in it showing the project workspace at the leftmost

corner side, output window in the bottom and an ash coloured space for the program to be

written.

5. Now to start using the keil, click on the option “project”.

6. A small window opens showing the options like new project, import project, open project

etc. Click on “New project”.

7. A small window with the title bar “Create new project” opens. The window asks the user

to give the project name with which it should be created and the destination location. The

project can be created in any of the drives available. You can create a new folder and then

a new file or can create directly a new file.

8. After the file is saved in the given destination location, a window opens where a list of

vendors will be displayed and you have to select the device for the target you have

created.

9. The most widely used vendor is Atmel. So click on Atmel and now the family of

microcontrollers manufactured by Atmel opens. You can select any one of the

microcontrollers according to the requirement.

[IR Signal Tracking System] Page 126

Page 127: IR Signal Tracking System

10. When you click on any one of the microcontrollers, the features of that particular

microcontroller will be displayed on the right side of the page. The most appropriate

microcontroller with which most of the projects can be implemented is the AT89S52.

Click on this microcontroller and have a look at its features. Now click on “OK” to select

this microcontroller.

11. A small window opens asking whether to copy the startup code into the file you have

created just now. Just click on “No” to proceed further.

12. Now you can see the TARGET and SOURCE GROUP created in the project workspace.

13. Now click on “File” and in that “New”. A new page opens and you can start writing

program in it.

14. After the program is completed, save it with any name but with the .asm extension. Save

the program in the file you have created earlier.

15. You can notice that after you save the program, the predefined keywords will be

highlighted in bold letters.

16. Now add this file to the target by giving a right click on the source group. A list of

options open and in that select “Add files to the source group”. Check for this file where

you have saved and add it.

17. Right click on the target and select the first option “Options for target”. A window opens

with different options like device, target, output etc. First click on “target”.

18. Since the set frequency of the microcontroller is 11.0592 MHz to interface with the PC,

just enter this frequency value in the Xtal (MHz) text area and put a tick on the Use on-

chip ROM. This is because the program what we write here in the keil will later be

dumped into the microcontroller and will be stored in the inbuilt ROM in the

microcontroller.

19. Now click the option “Output” and give any name to the hex file to be created in the

“Name of executable” text area and put a tick to the “Create HEX file” option present in

the same window. The hex file can be created in any of the drives. You can change the

folder by clicking on “Select folder for Objects”.

[IR Signal Tracking System] Page 127

Page 128: IR Signal Tracking System

20. Now to check whether the program you have written is errorless or not, click on the icon

exactly below the “Open file” icon which is nothing but Build Target icon. You can even

use the shortcut key F7 to compile the program written.

21. To check for the output, there are several windows like serial window, memory window,

project window etc. Depending on the program you have written, select the appropriate

window to see the output by entering into debug mode.

22. The icon with the letter “d” indicates the debug mode.

23. Click on this icon and now click on the option “View” and select the appropriate window

to check for the output.

24. After this is done, click the icon “debug” again to come out of the debug mode.

25. The hex file created as shown earlier will be dumped into the microcontroller with the

help of another software called Proload.

[IR Signal Tracking System] Page 128

Page 129: IR Signal Tracking System

PROLOAD:

Proload is a software which accepts only hex files. Once the machine code is converted

into hex code, that hex code has to be dumped into the microcontroller placed in the programmer

kit and this is done by the Proload. Programmer kit contains a microcontroller on it other than the

one which is to be programmed. This microcontroller has a program in it written in such a way

that it accepts the hex file from the keil compiler and dumps this hex file into the microcontroller

which is to be programmed. As this programmer kit requires power supply to be operated, this

power supply is given from the power supply circuit designed above. It should be noted that this

programmer kit contains a power supply section in the board itself but in order to switch on that

power supply, a source is required. Thus this is accomplished from the power supply board with

an output of 12volts or from an adapter connected to 230 V AC.

1. Install the Proload Software in the PC.

2. Now connect the Programmer kit to the PC (CPU) through serial cable.

3. Power up the programmer kit from the ac supply through adapter.

4. Now place the microcontroller in the GIF socket provided in the programmer kit.

5. Click on the Proload icon in the PC. A window appears providing the information like

Hardware model, com port, device type, Flash size etc. Click on browse option to select

the hex file to be dumped into the microcontroller and then click on “Auto program” to

program the microcontroller with that particular hex file.

6. The status of the microcontroller can be seen in the small status window in the bottom of

the page.

7. After this process is completed, remove the microcontroller from the programmer kit and

place it in your system board. Now the system board behaves according to the program

written in the microcontroller.

[IR Signal Tracking System] Page 129

Page 130: IR Signal Tracking System

[IR Signal Tracking System] Page 130

Page 131: IR Signal Tracking System

Advantages:

highly-flexible

Fit & Forget System

No need of human effort

Easily locate different radio frequencies.

Path Tracking

Direction Identification

[IR Signal Tracking System] Page 131

Page 132: IR Signal Tracking System

Applications:

Detection and search radar

Missile guidance systems are radar used to locate the target of a missile. This is often

present in military aircraft.

Radar for biological research

Air traffic control and navigation radar

Weather-sensing radar systems

[IR Signal Tracking System] Page 132

Page 133: IR Signal Tracking System

CONCLUSION:

This project presents an implementation of Advanced User Controlled Roof Top Antenna Signal

Tracking System using AT89S52 MCU using IR sensor. Experimental work has been carried out

carefully.

[IR Signal Tracking System] Page 133

Page 134: IR Signal Tracking System

REFERENCE

1. WWW. howstuffworks.com

2. EMBEDDED SYSTEM BY RAJ KAMAL

3. 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS BY MAZZIDI

4. Magazines

5. Electronics for you

6. Electrikindia

7. WWW.google.com

8. WWW.Electronic projects.com

[IR Signal Tracking System] Page 134