project landrover

136
Submitted for partial fulfillment of award of BACHELOR OF TECHNOLOGY DEGREE IN E&C ENGG. (2007-2011) A Project Report On CELL PHONE OPERATED LAND ROVER SUBMITTED TO: SUBMITTED BY: Mrs. Ritu Singh Akash Chandel (0821331005) Electronics & Communication Engineering Deptt. Anupam Singh (0821331018) Hindustan Institute of Technology, Ashutosh Singh (08 21331024) Gr. Noida --------------------------------------------------------------------------------------------------- Department of Electronics and Communication Engineering

Upload: ashu0711

Post on 06-May-2015

1.865 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Project landrover

Submitted for partial fulfillment of award ofBACHELOR OF TECHNOLOGY

DEGREE IN E&C ENGG.(2007-2011)

A Project Report On

CELL PHONE OPERATED LAND ROVER

SUBMITTED TO: SUBMITTED BY:

Mrs. Ritu Singh Akash Chandel (0821331005)

Electronics & Communication Engineering Deptt. Anupam Singh (0821331018) Hindustan

Institute of Technology, Ashutosh Singh (08 21331024)

Gr. Noida

---------------------------------------------------------------------------------------------------Department of Electronics and Communication Engineering

Hindustan Institute of Technology32, 34, Knowledge Park-III, Greater Noida, U.P

TABLE OF CONTENTS

Page 2: Project landrover

Abstract……………………………………………………………....6 List Of Abbreviations………………………………………………...7 CHAPTER 1:- INTRODUCTION………………………………....9

1.1 Project overview……………………………………………….101.2 Significance of project………………………………………..121.3 History of remote controlled vehicle…………………..............131.4 First Remote control vehicles……………..................................151.5 Use of Remote control vehicles during world war II………..

CHAPTER 2:- WORKING.........……………………………..172.1 Cell Phone used as DTMF transmitter………………………………182.2 Cell Phone used as DTMF receiver …………………………212.3 D.C Motor Driver……………………………………..................242.4 Microcontroller Logic…………………………………

CHAPTER 3:- PCB CONSTRUCTION……………………...…273.1 Shear raw material…………………………………………..283.2 Apply image…………………………………………………3.3 Pattern plate…………………………………………………3.4 Strip & Etch………………………………………………..3.5 Solder Marks………………………………………………..3.6 Nomenclature & Fabrication………………………………..

CHAPTER 4:- CIRCUIT DIAGRAM..………………364.1 Microcontroller device overview………………………4.2 PIN Diagram…………………………………………….434.3 PIN Description………………………………………….464.4 RISC Architecture……………………………………………514.5 Memory & Register………………………………………. 4.5.6 SFRs ………………………………………………

CHAPTER 5:- OTHER COMPONENTS……......535.1 Diode & V-I characteristics………………………................................555.2 LED……………………………………...685.3 Motor Driver IC L-293 5.4.1 H- Bridge

5.4.2 Concept of H- Bridge CONCLUSION……………………………………………………....125

Page 3: Project landrover

REFERENCE…………………………….........................................126

ABSTRACT

As today the world of mobile is going to overlap all the old traditional devices. We are now

using mobile for controlling the household appliances like television, fan, refrigerator etc.

Page 4: Project landrover

The mobile is used to capture the video audio files, to store them, to transmit them to other

mobiles. The mobile is used for internet, commutation etc as well as the original use i.e. for

communication. Mobiles are coming with the features like clock, stop watch, world clock,

calculator, currency converter, spot light, audio/video player etc. the user needs a device

which can solve his all the problems and fulfill all the needs. So why can’t we use this

popular device for controlling the ROBOT which may be a car or a personal assistant.

In this project we tried to overcome with this feature of mobile. In this project we

show that how we control the movement of any small robot with the help of mobile

phone. By using this logic we not only control the movement of vehicle but also switch

on/off other accessories on robot.

Mobile as a transmitter is used having 12 keypad for control operation and can be used

from anywhere in the world.

Programmable, multifunctional, DTMF based receiver because of PIC16F877, which can

be reprogrammed 10000 times.

Robot is self powered by 12V battery

High power DC motor is used to control Robot moment.

LIST OF COMPONENTS

PIC-16F877A (MICRICONTROLLER)

Page 5: Project landrover

DTMF DECODER 8870

L293D (MOTOR DRIVER IC)

7805 (VOLTAGE REGULATER)

555 TIMER

ELECTROLYTE CAPACITOR 1000 µf

CRYSTAL OSCILLATOR-12MHz

AMPLIFIER

TRANSFORMER(STEP DOWN 500mili amp)

DIODE

LED’s

RESISTOR’s

CERAMIC CAPACITOR (O.1 PICO FARAD)

358 AMPLIFIER

TRANSISTOR

CHAPTER-1

Introduction Robotics

Page 6: Project landrover

Robotics develop man-made mechanical devices that can move by themselves, whose motion

must be modeled, planned, sensed, actuated and controlled, and whose motion behavior can

be influenced by “programming”. Robots are called “intelligent” if they succeed in moving in

safe interaction with an unstructured environment, while autonomously achieving their speci-

fied tasks.

This definition implies that a device can only be called a “robot” if it contains a movable

mechanism, influenced by sensing, planning, and actuation and control components

Robotics is, to a very large extent, all about system integration, achieving a task by an actu -

ated mechanical device, via an “intelligent” integration of components, many of which it

shares with other domains, such as systems and control, computer science, character anima-

tion, machine design, computer vision, artificial intelligence, cognitive science, biomechanics,

etc. In addition, the boundaries of robotics cannot be clearly defined, since also its “core”

ideas, concepts and algorithms are being applied in an ever increasing number of “external”

applications, and, vice versa, core technology from other domains (vision, biology, cognitive

science or biomechanics, for example) are becoming crucial components in more and more

modern robotic systems.

Research in engineering robotics follows the bottom-up approach: existing and working sys-

tems are extended and made more versatile. Research in artificial intelligence robotics is top-

down: assuming that a set of low-level primitives is available, how could one apply them in

order to increase the “intelligence” of a system. The border between both approaches shifts

continuously, as more and more “intelligence” is cast into algorithmic, system-theoretic form.

For example, the response of a robot to sensor input was considered “intelligent behaviour” in

the late seventies and even early eighties. Hence, it belonged to A.I. Later it was shown that

many sensor-based tasks such as surface following or visual tracking could be formulated as

control problems with algorithmic solutions. From then on, they did not belong to A.I. any

more

Page 7: Project landrover

BLOCK DIAGRAM:

Fig:-1.1

DTMF Decoder

PIC Microcontroller

Mobile as Receiver

Left H Bridge

Right H Bridge

Left Motor

Right Motor

Page 8: Project landrover

1.1PROJECT OVERVIEW :

Fig:-1.2

In this project, the robot is controlled by a mobile phone that makes a call to the mobile phone

attached to the robot. In the coarse of a call, if any button is pressed, a tone corresponding to the

button pressed is heard at the other end of the call. This tone is called ‘dual-tone multiplefre-

quency’ (DTMF) tone. The robot perceives this DTMF tone with thehelp of the phone stacked in

the robot.

Page 9: Project landrover

The received tone is processed by the ATmega16 microcontroller with the help of DTMF

decoder MT8870. The decoder decodes the DTMF tone into its equivalent binary digit and this

binary number is sent to the microcontroller. The microcontroller is pre programmed to take a

decision for any given input and outputs its decision to motor drivers in order to drive the motors

for forward or backward motion or a turn.

The mobile that makes a call to the mobile phone stacked in the robot acts as a remote. So this

simple robotic project does not require the construction of receiver and transmitter units. DTMF

signaling is used for telephone signaling over the line in the voice-frequency band to the call

switching centre.

The version of DTMF used for telephone tone dialing is known as ‘Touch-Tone’. DTMF assigns

a specific frequency (consisting of two separate tones) to each key so that it can easily be identi-

fied by the electronic circuit. The signal generated by the DTMF encoder is a direct algebraic

summation, in real time, of the amplitudes of two sine (cosine) waves of different frequencies,

i.e., pressing ‘5’ will send a tone made by adding 1336 Hz and 770 Hz to the other end of the

mobile phone.

1.2SIGNIFICANCE OF THE PROJECT :

Robotics is an interesting field where every engineer can showcase his creative and technical

skills. Radio control (often abbreviated to R/C or simply RC) is the use of radio signals to re-

Page 10: Project landrover

motely control a device. The term is used frequently to refer to the control of model vehicles

from a hand-held radio transmitter.

Industrial, military, and scientific research organizations make [traffic] use of radio-controlled

vehicles as well. A remote control vehicle is defined as any mobile device that is controlled by a

means that does not restrict its motion with an origin external to the device. This is often a radio

control device, cable between control and vehicle, or an infrared controller. A remote control ve-

hicle (Also called as RCV) differs from a robot in that the RCV is always controlled by a human

and takes no positive action autonomously.

One of the key technologies which underpin this field is that of remote vehicle control. It is vital

that a vehicle should be capable of proceeding accurately to a target area; maneuvering within

that area to fulfill its mission and returning equally accurately and safely to base.

Recently, Sony Ericsson released a remote control car that could be controlled by any Bluetooth

cell phone. Radio is the most popular because it does not require the vehicle to be limited by the

length of the cable or in a direct line of sight with the controller (as with the infrared set-up).

1.3HISTORY OF REMOTE CONTROLLED VEHICLES :

1.3.1The First Remote Control Vehicle :

Page 11: Project landrover

Precision Guided Weapon : This propeller-driven radio controlled boat, built by Nikola Tesla in

1898 , is the original prototype of all modern-day uninhabited aerial vehicles and precision

guided weapons. In fact , all remotely operated vehicles in air, land or sea. Powered by lead-acid

batteries and an electric drive motor, the vessel was designed to be maneuvered alongside a tar-

get using instructions received from a wireless remote control transmitter. Once in position, a

command would be sent to detonate an explosive charge contained within the boat!s forward

compartment.

The weapon!s guidance system incorporated a secure communications link between the pilot!s

controller and the surfacerunning torpedo in an effort to assure that control could be maintained

even in the presence of electronic countermeasures. To learn more about Tesla!s system for se-

cure wireless communications and his pioneering imp lementation of the electronic logic-gate

circuit read ‘Nikola Tesla — Guided Weapons & Computer Technology’, Tesla Presents Series

Part 3, with commentary by Leland Anderson.

1.3.2Use of Remote Controlled Vehicles During World War II :

Page 12: Project landrover

During World War II in the Europe an Theater the U.S. Air Force experimented with three basic

forms radio control guided weapons. In each case, the weapon would be directed to its target by

a crew member on a control plane. The first weapon was essentially a standard bomb fitted with

steering controls. The next evolution involved the fitting of a bomb to a glider airframe, one ver-

sion, the GB-4 having a TV camera to assist the controller with targeting. The third class of

guided weapon was the remote controlled B-17. It!s known that Germany deployed a number

of more advanced guided strike weapons that saw combat before either the V-1 or V-2. They

were the radio-controlled Henschel!s Hs 293A and Ruhrstahl!s SD1400X, known as ’Fritz X,’

both air-launched, primarily against ships at sea.

CHAPTER- 2

Page 13: Project landrover

Working:

2.1Mobile as DTMF Transmitter :

Mobile is based on DTMF Technology. When you press a button of mobile keypad, a connec-

tion is made that generates a resultant signal of two tones at the same time. These two tones are

taken from a row frequency and a column frequency. The resultant frequency signal is called

"Dual Tone Multiple Frequency". These tones are identical and unique.

          A DTMF signal is the algebraic sum of two different audio frequencies, one from

low frequency group and other from high frequency group.

          Each of the low and high frequency groups comprise four frequencies from the various

keys present on the telephone keypad; two different frequencies, one from the high frequency

group and another from the low frequency group are used to produce a DTMF signal to represent

the pressed key.

          When you send  these DTMF signals to the telephone exchange through cables, the servers

in the telephone exchange identifies these signals and makes the connection to the person you are

calling.

The row and column frequencies are given below: 

 

Page 14: Project landrover

 When you press the digit 5 in the keypad it generates a resultant tone signal which is made up of

frequencies 770Hz and 1336Hz. Pressing digit 8 will produce the tone taken from tones 852Hz

and 1336Hz. In both the cases, the column frequency 1336 Hz is the same. These signals are

digital signals which are symmetrical with the sinusoidal wave.

2.2Receiver Part:

The whole Receiver circuit consists of 6 major parts

DTMF Receiver

Light Sensor

DC Motor driver

Microcontroller logic

DTMF Receiver: Mobile work as a DTMF receiver and encoded hybrid frequency DTMF

code tone is decoded by 8870 IC. 8870 Decode DTMF tone and convert into BCD code,

output depending upon which key is pressed at the transmitter side. The table shows decoded

output.

Page 15: Project landrover

D3 D2 D1 D0

1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

* 1 0 1 0

0 1 0 1 1

# 1 1 0 0

Fig:-2.1

This four digit output is directly given to 89C51. It will collect this code and start comparing it

with inbuilt code. When it founds perfect match it display code on 7 segment display and

switch to that subroutine and perform that particular task.

2.3 DC motor driver: The H-Bridge is used for motor driver. The H-Bridge is widely used in

Robotics for driving DC motor in both clockwise and anticlockwise. As shown in the circuit dia-

gram in H Bridge two NPN and two PNP transistors is used.

Page 16: Project landrover

Let us consider microcontroller provide high at pin No 13 and low at Pin No 14 thus right side

NPN transistor conducts and left side PNP transistor conducts.this means M12 is 12v and M11 is

grounded thus motor rotate clockwise

Again let us consider microcontroller provide low at pin No 13 and high at Pin No 14 thus right

side PNP transistor conducts and left side NPN transistor conducts. this means M12 is grounded

and M11 is 12v thus motor rotate anticlockwise..

2.4 Microcontroller Logic: The function of microcontroller is to control input output based on

the programmed embedded hex logic. The microcontroller continuously scans input logic. The

input logic is 4BCD data from 8870 one from fire sensor and one from light sensor. If any one of

them changes their logic level microcontroller goes to particular subroutine and perform particu-

lar task.

Let us consider a case at the transmitter mobile I have pressed number 2, thus at receiver side

8870 generate corresponding BCD logic 0010. The microcontroller receive 0010 at pin no

1,2,3,4. The microcontroller is programmed if input is 0010, move to robot left. The robot will

moves left if left DC motor rotate slow and right DC motor rotate fast. This slow and fast mo-

ment is dine by microcontroller using pulse width modulation. Thus when we press 2 key micro-

controller provide different pulse to left right motor. The right motor gets pulse having mote on

time then left. In the same way all microcontroller subroutine gets executed and perform corre-

sponding task.

If microcontroller sense 0001 input then it goes to right subroutine and moves robot right.

If microcontroller sense 0010 inputs then it goes to left subroutine and moves robot left.

If microcontroller sense 0011 input then it goes to stop subroutine and goes to standby

mode.

If microcontroller sense 0100 input then it goes to forward subroutine and moves robot

forward.

Page 17: Project landrover

If microcontroller sense 0101 input then it goes to backward subroutine and moves robot

backward.

If microcontroller sense low input at pin No 5 then it goes to day night subroutine and

supply high pulse to on light.

Page 18: Project landrover

CHAPTER-3

.PCB CONSTRUCTION :Step 1:Generated from your design files, we create an exact film representation of your design. We will create one film per layer.

Fig:-3.1Step 2 :3.1Shear Raw Material

Industry standard 0.059" thick, copper clad, two sides. Panels will be sheared to accommodate

many borads. Fig:-3.2

Page 19: Project landrover

Step 3:

3.2Apply Image:

Apply photosensitive dryfilm (plate resist) to panel. Use light source and film to expose panel.

Develop selected areas from panel.

Fig:-3.4Step 4 :

3.3Pattern Plate:

Electrochemical process to build copper in the holes and on the trace area. Apply tin to surface.

note: All PCB express boards are plated through holes.

Page 20: Project landrover

Fig:3.5

Step 5 :

3.4Strip & Etch:

Remove dryfilm, then etch exposed copper. The tin protects the copper circuitry from being

etched.

Fig:3.6

Step 6 :

3.5Solder mask:

Apply solder mask area to entire board with the exception of solder pads

Page 21: Project landrover

Fig:-3.7

Step 7 :

3.6Solder coat:

Apply solder to pads by immersing into tank of solder. Hot air knives level the solder when re-

moved from the tank.

Fig:-3.8

Step 8 :

3.7Nomenclature & FabricationApply white letter marking using screen printing process. Route the perimeter of the board using NC equipment.

Page 22: Project landrover

Fig:3.9

Page 23: Project landrover
Page 24: Project landrover

Fig:3.11

Page 25: Project landrover

Fig:3.12

CIRCUIT DIAGRAM OF CELL PHONE OPERATED LAND ROVER

Page 26: Project landrover

CHAPTER-4

PIC16F887A Microcontroller Device OverviewPIC16F877 belongs to a class of 8-bit microcontrollers of RISC architecture. It has 8kb flash

memory for storing a written program.  Since memory made in FLASH technology can be

programmed and cleared more than once, it makes this microcontroller suitable for device

development. IT has data memory that needs to be saved when there is no supply. It is usually

used for storing important data that must not be lost if power supply suddenly stops. For

instance, one such data is an assigned temperature in temperature regulators. If during a loss of

power supply this data was lost, we would have to make the adjustment once again upon return

of supply.

RISC architecture

o Only 35 instructions to learn

o All single-cycle instructions except branches

Operating frequency 0-20 MHz

Precision internal oscillator

o Factory calibrated

o Software selectable frequency range of 8MHz to 31KHz

Power supply voltage 2.0-5.5V

o Consumption: 220uA (2.0V, 4MHz), 11uA (2.0 V, 32 KHz) 50nA (stand-by

mode)

Power-Saving Sleep Mode

Brown-out Reset (BOR) with software control option

35 input/output pins

o High current source/sink for direct LED drive

o software and individually programmable pull-up resistor

o Interrupt-on-Change pin

8K ROM memory in FLASH technology

o Chip can be reprogrammed up to 100.000 times

Page 27: Project landrover

In-Circuit Serial Programming Option

o Chip can be programmed even embedded in the target device

Data can be written more than 1.000.000 times

368 bytes RAM memory

A/D converter:

o 14-channels

o 10-bit resolution

3 independent timers/counters

Watch-dog timer

Analogue comparator module with

o Two analogue comparators

o Fixed voltage reference (0.6V)

o Programmable on-chip voltage reference

PWM output steering control

Eight level deep hardware stack

Power-on Reset (POR)

Power-up Timer (PWRT) and

Oscillator Start-up Timer (OST)

Programmable code protection

Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation

Direct, indirect and relative addressing modes

Interrupt capability (up to 14 sources)

Enhanced USART module

o Supports RS-485, RS-232 and LIN2.0 o Auto-Baud Detect

Master Synchronous Serial Port (MSSP) o supports SPI and I2C mode

Page 28: Project landrover

PIN Diagram:-

Fig:4.1 MICROCONTROLLER

Page 29: Project landrover

BLOCK DIAGRAM:

Fig-4.2

4.1PIN DESCRIPTION

As seen in Fig. 1-1 above, the most pins are multi-functional. For example, designator RA3/AN3/Vref+/C1IN+ for the fifth pin specifies the following functions:

RA3 Port A third digital input/output AN3 Third analog input Vref+ Positive voltage reference C1IN+ Comparator C1positive input

This small trick is often used because it makes the microcontroller package more compact with-out affecting its functionality. These various pin functions cannot be used simultaneously, but can be changed at any point during operation.

Page 30: Project landrover
Page 31: Project landrover

Fig4.3

Page 32: Project landrover

4.2Central Processor Unit (CPU)

I’m not going to bore you with the operation of the CPU at this stage, however it is important to state that the CPU is manufactured with in RISC technology an important factor when deciding which microprocessor to use.

RISC Reduced Instruction Set Computer, gives the PIC16F887 two great advantages:

The CPU can recognizes only 35 simple instructions (In order to program some other mi-crocontrollers it is necessary to know more than 200 instructions by heart).

The execution time is the same for all instructions except two and lasts 4 clock cycles (oscillator frequency is stabilized by a quartz crystal). The Jump and Branch instructions execution time is 2 clock cycles. It means that if the microcontroller’s operating speed is 20MHz, execution time of each instruc tion will be 200nS, i.e. the program will be exe-cuted at the speed of 5 million instructions per second!

Fig.4.4 CPU Memory

Page 33: Project landrover

Memory

This microcontroller has three types of memory- ROM, RAM and EEPROM. All of them will be separately discussed since each has specific functions, features and organization.

ROM Memory

ROM memory is used to permanently save the program being executed. This is why it is often called “program memory”. The PIC16F887 has 8Kb of ROM (in total of 8192 locations). Since this ROM is made with FLASH technology, its contents can be changed by providing a special programming voltage (13V).

Anyway, there is no need to explain it in detail because it is automatically performed by means of a special program on the PC and a simple electronic device called the Programmer.

Fig:4.5 ROM Memory Concept

EEPROM Memory

Similar to program memory, the contents of EEPROM is permanently saved, even the power goes off. However, unlike ROM, the contents of the EEPROM can be changed during operation of the microcontroller. That is why this memory (256 locations) is a perfect one for permanently saving results created and used during the operation.

RAM Memory

This is the third and the most complex part of microcontroller memory. In this case, it consists of two parts: general-purpose registers and special-function registers (SFR).

Page 34: Project landrover

Even though both groups of registers are cleared when power goes off and even though they are manufactured in the same way and act in the similar way, their functions do not have many things in common.

Fig.4.6 SFR and General Purpose Registers

General-Purpose Registers

General-Purpose registers are used for storing temporary data and results created during opera-tion. For example, if the program performs a counting (for example, counting products on the as-sembly line), it is necessary to have a register which stands for what we in everyday life call “sum”. Since the microcontroller is not creative at all, it is necessary to specify the address of

Page 35: Project landrover

some general purpose register and assign it a new function. A simple program to increment the value of this register by 1, after each product passes through a sensor, should be created.

Therefore, the microcontroller can execute that program because it now knows what and where the sum which must be incremented is. Similarly to this simple example, each program variable must be pre-assigned some of general-purpose register.

SFR Registers

Special-Function registers are also RAM memory locations, but unlike general-purpose registers, their purpose is predetermined during manufacturing process and cannot be changed. Since their bits are physically connected to particular circuits on the chip (A/D converter, serial communica-tion module, etc.), any change of their contents directly affects the operation of the microcon-troller or some of its circuits. For example, by changing the TRISA register, the function of each port A pin can be changed in a way it acts as input or output. Another feature of these memory locations is that they have their names (registers and their bits), which considerably facilitates program writing. Since high-level programming language can use the list of all registers with their exact addresses, it is enough to specify the register’s name in order to read or change its contents.

RAM Memory Banks

The data memory is partitioned into four banks. Prior to accessing some register during program writing (in order to read or change its contents), it is necessary to select the bank which contains that register. Two bits of the STATUS register are used for bank selecting, which will be dis-cussed later. In order to facilitate operation, the most commonly used SFRs have the same ad-dress in all banks which enables them to be easily accessed.

Page 36: Project landrover

4.3 STACK

A part of the RAM used for the stack consists of eight 13-bit registers. Before the microcon-troller starts to execute a subroutine (CALL instruction) or when an interrupt occurs, the address of first next instruction being currently executed is pushed onto the stack, i.e. onto one of its reg-isters. In that way, upon subroutine or interrupt execution, the microcontroller knows from where to continue regular program execution. This address is cleared upon return to the main program because there is no need to save it any longer, and one location of the stack is automatically available for further use.

It is important to understand that data is always circularly pushed onto the stack. It means that af-ter the stack has been pushed eight times, the ninth push overwrites the value that was stored with the first push. The tenth push overwrites the second push and so on. Data overwritten in this way is not recoverable. In addition, the programmer cannot access these registers for write or read and there is no Status bit to indicate stack overflow or stack underflow conditions. For that reason, one should take special care of it during program writing.

Interrupt System

The first thing that the microcontroller does when an interrupt request arrives is to execute the current instruction and then stop regular program execution. Immediately after that, the current program memory address is automatically pushed onto the stack and the default address (prede-fined by the manufacturer) is written to the program counter. That location from where the pro-gram continues execution is called the interrupt vector. For the PIC16F887 microcontroller, this address is 0004h. As seen in Fig. 1-7 below, the location containing interrupt vector is passed over during regular program execution.

Part of the program being activated when an interrupt request arrives is called the interrupt rou-tine. Its first instruction is located at the interrupt vector. How long this subroutine will be and what it will be like depends on the skills of the programmer as well as the interrupt source itself. Some microcontrollers have more interrupt vectors (every interrupt request has its vector), but in this case there is only one. Consequently, the first part of the interrupt routine consists in inter -rupt source recognition.

Finally, when the interrupt source is recognized and interrupt routine is executed, the microcon-troller reaches the RETFIE instruction, pops the address from the stack and continues program ex-ecution from where it left off.

Page 37: Project landrover

Fig.4.7 Interrupt System

How to use SFRs

You have bought the microcontroller and have a good idea how to use it...There is a long list of SFRs with all bits. Each of them controls some process. All in all, it looks like a big control table with a lot of instruments and switches. Now you are concerned about whether you will manage to learn how to use them all? You will probably not, but don’t worry, you don’t have to! Such powerful microcontrollers are similar to a supermarkets: they offer so many things at low prices and it is only up to you to choose. Therefore, select the field you are interested in and study only what you need to know. Afterwards, when you completely understand hardware operation, study SFRs which are in control of it ( there are usually a few of them). To reiterate, during program writing and prior to changing some bits of these registers, do not forget to select the appropriate bank. This is why they are listed in the tables above.

Page 38: Project landrover

4.4 Core SFRs

Features and Function

The special function registers can be classified into two categories:

Core (CPU) registers - control and monitor operation and processes in the central proces-sor. Even though there are only a few of them, the operation of the whole microcontroller depends on their contents.

Peripheral SFRs- control the operation of peripheral units (serial communication module, A/D converter etc.). Each of these registers is mainly specialized for one circuit and for that reason they will be described along with the circuit they are in control of.

The core (CPU) registers of the PIC16F887 microcontroller are described in this chapter. Since their bits control several different circuits within the chip, it is not possible to classify them into some special group. These bits are described along with the processes they control.

STATUS Register

The STATUS register contains: the arithmetic status of the W register, the RESET status and the bank select bits for data memory. One should be careful when writing a value to this register be-cause if you do it wrong, the results may be different than expected. For example, if you try to clear all bits using the CLRF STATUS instruction, the result in the register will be 000xx1xx in-stead of the expected 00000000. Such errors occur because some of the bits of this register are set or cleared according to the hardware as well as because the bits 3 and 4 are readable only. For these reasons, if it is required to change its content (for example, to change active bank), it is rec-ommended to use only instructions which do not affect any Status bits (C, DC and Z).

OPTION_REG Register

Fig:-4.8

The OPTION_REG register contains various control bits to configure: Timer0/WDT prescaler, timer TMR0, external interrupt and pull-ups on PORTB.

Page 39: Project landrover

Interrupt System Registers

When an interrupt request arrives it does not mean that interrupt will automatically occur, be-cause it must also be enabled by the user (from within the program). Because of that, there are special bits used to enable or disable interrupts. It is easy to recognize these bits by IE contained in their names (stands for Interrupt Enable). Besides, each interrupt is associated with another bit called the flag which indicates that interrupt request has arrived regardless of whether it is en-abled or not. They are also easily recognizable by the last two letters contained in their names- IF (Interrupt Flag).

As seen, everything is based on a simple and efficient idea. When an interrupt request arrives, the flag bit is to be set first.

Fig:-4.9 Interrupt System Registers

If the appropriate IE bit is not set (0), this event will be completely ignored. Otherwise, an inter-rupt occurs! In case several interrupt sources are enabled, it is necessary to detect the active one before the interrupt routine starts execution. Source detection is performed by checking flag bits.

It is important to understand that the flag bits are not automatically cleared, but by software dur-ing interrupt routine execution. If this detail is neglected, another interrupt will occur immedi-ately upon return to the program, even though there are no more requests for its execution! Sim-ply put, the flag as well as IE bit remained set.

All interrupt sources typical of the PIC16F887 microcontroller are shown on the next page. Note several things:

GIE bit - enables all unmasked interrupts and disables all interrupts simultaneously. PEIE bit - enables all unmasked peripheral interrupts and disables all peripheral interrupts (This does not

concern Timer TMR0 and port B interrupt sources).

To enable interrupt caused by changing logic state on port B, it is necessary to enable it for each bit separately. In this case, bits of the IOCB register have the function to control IE bits.

Page 40: Project landrover

Fig:-4.10 Interrupt SFRs

INTCON Register

The INTCON register contains various enable and flag bits for TMR0 register overflow, PORTB change and external INT pin interrupts.

Fig:-4.11

Page 41: Project landrover

PIE1 Register The PIE1 register contains the peripheral interrupt enable bits.

Fig:-4.12PIE2 Register

The PIE2 Register also contains the various interrupt enable bits.

Fig:-4.13PIR1 Register

The PIR1 register contains the interrupt flag bits.

Fig:-4.14

Page 42: Project landrover

PIR2 Register

The PIR2 register contains the interrupt flag bits.

Fig:-4.15PCON register

The PCON register contains only two flag bits used to differentiate between a: power-on reset, brown-out reset, Watchdog Timer Reset and external reset (through MCLR pin).

Fig:-4.16PCL and PCLATH Registers

The size of the program memory of the PIC16F887 is 8K. Therefore, it has 8192 locations for program storing. For this reason the program counter must be 13-bits wide (2^13 = 8192). In or-der that the contents of some location may be changed in software during operation, its address must be accessible through some SFR. Since all SFRs are 8-bits wide, this register is “artifi-cially” created by dividing its 13 bits into two independent registers: PCLATH and PCL.

If the program execution does not affect the program counter, the value of this register is auto-matically and constantly incremented +1, +1, +1, +1... In that way, the program is executed just as it is written- instruction by instruction, followed by a constant address increment.

Fig:-4.17 PCL and PCLATH Registers

Page 43: Project landrover

If the program counter is changed in software, then there are several things that should be kept in mind in order to avoid problems:

Eight lower bits (the low byte) come from the PCL register which is readable and writable, whereas five upper bits coming from the PCLATH register are writable only.

The PCLATH register is cleared on any reset.

In assembly language, the value of the program counter is marked with PCL, but it obvi-ously refers to 8 lower bits only. One should take care when using the “ADDWF PCL” instruction. This is a jump instruction which specifies the target location by adding some number to the current address. It is often used when jumping into a look-up table or pro-gram branch table to read them. A problem arises if the current address is such that addi-tion causes change on some bit belonging to the higher byte of the PCLATH register. Do you see what is going on?

Executing any instruction upon the PCL register simultaneously causes the Prog ram Counter bits to be replaced by the contents of the PCLATH register. However, the PCL register has access to only 8 lower bits of the instruction result and the following jump will be completely incorrect. The problem is solved by setting such instructions at ad-dresses ending by xx00h. This enables the program to jump up to 255 locations. If longer jumps are executed by this instruction, the PCLATH register must be incremented by 1 for each PCL register overflow.

On subroutine call or jump execution (instructions CALL and GOTO), the microcontroller is able to provide only 11-bit addressing. For this reason, similar to RAM which is divided in “banks”, ROM is divided in four “pages” in size of 2K each. Such instructions are exe-cuted within these pages without any problems. Simply, since the processor is provided with 11-bit address from the program, it is able to address any location within 2KB. Fig-ure 2-17 below illustrates this situation as a jump to the subroutine PP1 address.

However, if a subroutine or jump address are not within the same page as the location from where the jump is, two “missing”- higher bits should be provided by writing to the PCLATH register. It is illustrated in figure 2-17 below as a jump to the subroutine PP2 address.

Page 44: Project landrover

Fig:-4.18 PCLATH Registers

In both cases, when the subroutine reaches instructions RETURN, RETLW or RETFIE (to return to the main program), the microcontroller will simply continue program execution from where it left off because the return address is pushed and saved onto the stack which, as mentioned, con-sists of 13-bit registers.

Indirect addressing

In addition to direct addressing which is logical and clear by itself (it is sufficient to specify ad-dress of some register to read its contents), this microcontroller is able to perform indirect ad-dressing by means of the INDF and FSR registers. It sometimes considerably simplifies program writing. The whole procedure is enabled because the INDF register is not true one (physically does not exist), but only specifies the register whose address is located in the FSR register. Be-cause of this, write or read from the INDF register actually means write or read from the register whose address is located in the FSR register. In other words, registers’ addresses are specified in the FSR register, and their contents are stored in the INDF register. The difference between di-rect and indirect addressing is illustrated in the figure 2-18 below:

As seen, the problem with the “missing addressing bits” is solved by “borrowing” from another register. This time, it is the seventh bit called IRP from the STATUS register.

Page 45: Project landrover

Fig:-4.19Direct and indirect addressing

Page 46: Project landrover

4.5 TIMER

The timers of the PIC16F887 microcontroller can be briefly described in only one sentence. There are three completely independent timers/counters marked as TMR0, TMR1 and TMR2. But it’s not as simple as that.

Timer TMR0 The timer TMR0 has a wide range of applications in practice. Very few programs don't use it in some way. It is very convenient and easy to use for writing programs or subroutines for generat-ing pulses of arbitrary duration, time measurement or counting external pulses (events) with al-most no limitations.The timer TMR0 module is an 8-bit timer/counter with the following features:

8-bit timer/counter; 8-bit prescaler (shared with Watchdog timer); Programmable internal or external clock source; Interrupt on overflow; and Programmable external clock edge selection.

Figure below represents the timer TMR0 schematic with all bits which determine its operation. These bits are stored in the OPTION_REG Register.

Fig:-4.20

Page 47: Project landrover

The function of the PSA bit 0 is shown in the two figures below:

Fig:-4.21

The function of the PSA bit 1 is shown in the two figures below:

Fig:-4.22

Page 48: Project landrover

As seen, the logic state of the PSA bit determines whether the prescaler is to be assigned to the timer/counter or watch-dog timer.

Additionally it is also worth mentioning:

When the prescaler is assigned to the timer/counter, any write to the TMR0 register will clear the prescaler;

When the prescaler is assigned to watch-dog timer, a CLRWDT instruction will clear both the prescaler and WDT;

Writing to the TMR0 register used as a timer, will not cause the pulse counting to start immediately, but with two instruction cycles delay. Accordingly, it is necessary to adjust the value written to the TMR0 register;

When the microcontroller is setup in sleep mode, the oscillator is turned off. Overflow cannot occur since there are no pulses to count. This is why the TMR0 overflow interrupt cannot wake up the processor from Sleep mode;

When used as an external clock counter without prescaler, a minimal pulse length or a pause between two pulses must be 2 Tosc + 20 nS. Tosc is the oscillator signal period;

When used as an external clock counter with prescaler, a minimal pulse length or a pause between two pulses is 10nS;

The 8-bit prescaler register is not available to the user, which means that it cannot be di-rectly read or written to;

When changing the prescaler assignment from TMR0 to the watch-dog timer, the follow-ing instruction sequence must be executed in order to avoid reset:

To select mode:

Timer mode is selected by the T0CS bit of the OPTION_REG register, (T0CS: 0=timer, 1=counter);

When used, the prescaler should be assigned to the timer/counter by clearing the PSA bit of the OPTION_REG register. The prescaler rate is set by using the PS2-PS0 bits of the same register; and

When using interrupt, the GIE and TMR0IE bits of the INTCON register should be set.

Reset the TMR0 register or write some well-known value to it;

To measure time:

Elapsed time (in microseconds when using quartz 4MHz) is measured by reading the TMR0 register; and

The flag bit TMR0IF of the INTCON register is automatically set every time the TMR0 register overflows. If enabled, an interrupt occurs.

To count pulses:

The polarity of pulses are to be counted is selected on the RA4 pin are selected by the TOSE bit of the OPTION register (T0SE: 0=positive, 1=negative pulses); and

Page 49: Project landrover

Number of pulses may be read from the TMR0 register. The prescaler and interrupt are used in the same manner as in timer mode.

Timer TMR1

Timer TMR1 module is a 16-bit timer/counter, which means that it consists of two registers (TMR1L and TMR1H). It can count up 65.535 pulses in a single cycle, i.e. before the counting starts from zero.

Fig:-4.23 Timer TMR1

Similar to the timer TMR0, these registers can be read or written to at any moment. In case an overflow occurs, an interrupt is generated.

The timer TMR1 module may operate in one of two basic modes- as a timer or a counter. How-ever, unlike the timer TMR0, each of these modules has additional functions.

Parts of the T1CON register are in control of the operation of the timer TMR1.

Fig:-4.24 Timer TMR1 Prescaler

Page 50: Project landrover

Timer TMR1 has a completely separate prescaler which allows 1, 2, 4 or 8 divisions of the clock input. The prescaler is not directly readable or writable. However, the prescaler counter is auto-matically cleared upon write to the TMR1H or TMR1L register.

Timer TMR1 Oscillator

RC0/T1OSO and RC1/T1OSI pins are used to register pulses coming from peripheral electron-ics, but they also have an additional function. As seen in figure 4-7, they are simultaneously con-figured as both input (pin RC1) and output (pin RC0) of the additional LP quartz oscillator (low power).

This additional circuit is primarily designed for operating at low frequencies (up to 200 KHz), more precisely, for using the 32,768 KHz quartz crystal. Such crystals are used in quartz watches because it is easy to obtain one-second-long pulses by simply dividing this frequency.

Since this oscillator does not depend on internal clocking, it can operate even in sleep mode. It is enabled by setting the T1OSCEN control bit of the T1CON register. The user must provide a software time delay (a few milliseconds) to ensure proper oscillator start-up.

Fig:-4.25

Table below shows the recommended values of capacitors to suit the quartz oscillator. These val-ues do not have to be exact. However, the general rule is: the higher the capacitor's capacity the higher the stability, which, at the same time, prolongs the time needed for the oscillator stability.

Oscillator Frequency C1 C2

LP32 kHz 33 pF 33 pF

100 kHz 15 pF 15 pF

200 kHz 15 pF 15 pF

Fig:-4.26 Timer TMR1 Oscillator

Page 51: Project landrover

Timer TMR1 Gate

Timer 1 gate source is software configurable to be the T1G pin or the output of comparator C2. This gate allows the timer to directly time external events using the logic state on the T1G pin or analog events using the comparator C2 output. Refer to figure 4-7 above. In order to time a sig-nals duration it is sufficient to enable such gate and count pulses having passed through it.

TMR1 in timer mode

In order to select this mode, it is necessary to clear the TMR1CS bit. After this, the 16-bit regis-ter will be incremented on every pulse coming from the internal oscillator. If the 4MHz quartz crystal is in use, it will be incremented every microsecond.

In this mode, the T1SYNC bit does not affect the timer because it counts internal clock pulses. Since the whole electronics uses these pulses, there is no need for synchronization.

Fig:-4.27

The microcontroller’s clock oscillator does not run during sleep mode so the timer register over-flow cannot cause any interrupt.

Timer TMR1 Oscillator

The power consumption of the microcontroller is reduced to the lowest level in Sleep mode. The point is to stop the oscillator. Anyway, it is easy to set the timer in this mode- by writing a SLEEP instruction to the program. A problem occurs when it is necessary to wake up the micro-controller because only an interrupt can do that. Since the microcontroller “sleeps”, an interrupt must be triggered by external electronics. It can all get incredibly complicated if it is necessary the ‘wake up’ occurs at regular time intervals...

Page 52: Project landrover

Fig:-4.28

In order to solve this problem, a completely independent Low Power quartz oscillator, able to op-erate in sleep mode, is built into the PIC16F887 microcontroller. Simply, what previously has been a separate circuit, it is now built into the microcontroller and assigned to the timer TMR1. The oscillator is enabled by setting the T1OSCEN bit of the T1CON register. After that, the TM-R1CS bit of the same register then is used to determine that the timer TMR1 uses pulse se-quences from that oscillator.

The signal from this quartz oscillator is synchronized with the microcontroller clock by clearing the T1SYNC bit. In that case, the timer cannot operate in sleep mode. You wonder why? Because the circuit for synchronization uses the clock of microcontroller!; and

The TMR1 register overflow interrupt may be enabled. Such interrupts will occur in sleep mode as well.

TMR1 in counter mode

Timer TMR1 starts to operate as a counter by setting the TMR1CS bit. It means that the timer TMR1 is incremented on the rising edge of the external clock input T1CKI. If control bit T1SYNC of the T1CON register is cleared, the external clock inputs will be synchronized on their way to the TMR1 register. In other words, the timer TMR1 is synchronized to the micro-controller system clock and called a synchronous counter.

When the microcontroller ,operating in this way, is set in sleep mode, the TMR1H and TMR1L timer registers are not incremented even though clock pulses appear on the input pins. Simply, since the microcontroller system clock does not run in this mode, there are no clock inputs to use for synchronization. However, the prescaler will continue to run if there are clock pulses on the pins since it is just a simple frequency divider.

Page 53: Project landrover

Fig:-4.29

This counter registers a logic one (1) on input pins. It is important to understand that at least one falling edge must be registered prior to the first increment on rising edge. Refer to figure on the left. The arrows in figure 4-11 denote counter increments.

T1CON Register

Fig:-4.30

T1GINV - Timer1 Gate Invert bit acts as logic state inverter on the T1G pin gate or the com-parator C2 output (C2OUT) gate. It enables the timer to mea sure time whilst the gate is high or low.

1 - Timer 1 counts when the pin T1G or bit C2OUT gate is high (1); and 0 - Timer 1 counts when the pin T1G or bit C2OUT gate is low (0).

Page 54: Project landrover

TMR1GE - Timer1 Gate Enable bit determines whether the pin T1G or comparator C2 output (C2OUT) gate will be active or not. This bit is functional only in the event that the timer TMR1 is on (bit TMR1ON = 1). Otherwise, this bit is ignored.

1 Timer TMR1 is on only if timer 1 gate is not active; and 0 Gate does not affect the timer TMR1.

T1CKPS1, T1CKPS0 - Timer1 Input Clock Prescale Select bits determine the rate of the prescaler assigned to the timer TMR1.

T1CKPS1 T1CKPS0 Prescaler Rate

0 0 1:1

0 1 1:2

1 0 1:4

1 1 1:8

Fig:- 4-2 Prescaler Rate

T1OSCEN - LP Oscillator Enable Control bit

1 - LP oscillator is enabled for timer TMR1 clock (oscillator with low power consumption and frequency 32.768 kHz); and

0 - LP oscillator is off.

T1SYNC - Timer1 External Clock Input Synchronization Control bit enables synchronization of the LP oscillator input or T1CKI pin input with the microcontroller internal clock. When count-ing pulses from the local clock source (bit TMR1CS = 0), this bit is ignored.

1 - Do not synchronize external clock input; and 0 - Synchronize external clock input.

TMR1CS - Timer TMR1 Clock Source Select bit

1 - Counts pulses on the T1CKI pin (on the rising edge 0-1); and 0 - Counts pulses of the internal clock of microcontroller.

TMR1ON - Timer1 On bit

1 - Enables Timer TMR1; and 0 - Stops Timer TMR1.

In order to use the timer TMR1 properly, it is necessary to perform the following:

Since it is not possible to turn off the prescaler, its rate should be adjusted by using bits T1CKPS1 and T1CKPS0 of the register T1CON (Refer to table 4-2);

Page 55: Project landrover

The mode should be selected by the TMR1CS bit of the same register (TMR1CS: 0= the clock source is quartz oscillator, 1= the clock source is supplied externally);

By setting the T1OSCEN bit of the same register, the timer TMR1 is turned on and the TMR1H and TMR1L registers are incremented on every clock input. Counting stops by clearing this bit;

The prescaler is cleared by clearing or writing the counter registers; and By filling both timer registers, the flag TMR1IF is set and counting starts from zero.

Timer TMR2

Timer TMR2 module is an 8-bit timer which operates in a very specific way.

Fig:-4.32

The pulses from the quartz oscillator first pass through the prescaler whose rate may be changed by combining the T2CKPS1 and T2CKPS0 bits. The output of the prescaler is then used to incre-ment the TMR2 register starting from 00h. The values of TMR2 and PR2 are constantly com-pared and the TMR2 register keeps on being incremented until it matches the value in PR2. When a match occurs, the TMR2 register is automatically cleared to 00h. The timer TMR2 Postscaler is incremented and its output is used to generate an interrupt if it is enabled.

The TMR2 and PR2 registers are both fully readable and writable. Counting may be stopped by clearing the TMR2ON bit, which contributes to power saving.

As a special option, the moment of TMR2 reset may be also used to determine synchronous se-rial communication baud rate.

The timer TMR2 is controlled by several bits of the T2CON register.

Page 56: Project landrover

T2CON Register

Fig:-4.33 T2CON Register

TOUTPS3 - TOUTPS0 - Timer2 Output Postscaler Select bits are used to determine the postscaler rate according to the following table:

TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 Postscaler Rate

0 0 0 0 1:1

0 0 0 1 1:2

0 0 1 0 1:3

0 0 1 1 1:4

0 1 0 0 1:5

0 1 0 1 1:6

0 1 1 0 1:7

0 1 1 1 1:8

1 0 0 0 1:9

1 0 0 1 1:10

1 0 1 0 1:11

1 0 1 1 1:12

1 1 0 0 1:13

1 1 0 1 1:14

1 1 1 0 1:15

1 1 1 1 1:16

Fig:4.34 Postscaler Rate

TMR2ON - Timer2 On bit turns the timer TMR2 on.

1 - Timer T2 is on; and 0 - Timer T2 is off.

Page 57: Project landrover

T2CKPS1, T2CKPS0 - Timer2 Clock Prescale bits determine prescaler rate:

T2CKPS1 T2CKPS0 Prescaler Rate

0 0 1:1

0 1 1:4

1 X 1:16

Fig:-4.35 Prescaler Rate

When using the TMR2 timer, one should know several specific details that have to do with its registers:

Upon power-on, the PR2 register contains the value FFh; Both prescaler and postscaler are cleared by writing to the TMR2 register; Both prescaler and postscaler are cleared by writing to the T2CON register; and On any reset, both prescaler and postscaler are cleared.

Page 58: Project landrover

CHAPTER-5

OTHER COMPONENTS:

5.1DIODE:

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

Although a transistor is also a semiconductor device, it does not operate the way a diode does. A diode

is specifically made to allow current to flow through it in only one direction. Some ways in which the

diode can be used are listed here.

A diode can be used as a rectifier that converts AC (Alternating Current) to DC (Direct Current) for a

power supply device.

Diodes can be used to separate the signal from radio frequencies.

Diodes can be used as an on/off switch that controls current.

Fig:-5.1

This symbol is used to indicate a diode in a circuit diagram. The meaning of the symbol is

(Anode) (Cathode). Current flows from the anode side to the cathode side.

Although all diodes operate with the same general principle, there are different types suited to different

applications. For example, the following devices are best used for the applications noted.

Page 59: Project landrover

Fig:-5.2

Diode symbols: a - standard diode, b - LED, c, d - Zener, e - photo, f,g - tunnel, h - Schottky, i -

breakdown, j - capacitative

V-I characteristics:

FIG:-5.3

The graph on the right shows the electrical characteristics of a typical diode.

When a small voltage is applied to the diode in the forward direction, current flows easily. Because the

diode has a certain amount of resistance, the voltage will drop slightly as current flows through the

diode. A typical diode causes a voltage drop of about 0.6 - 1V (VF) (In the case of silicon diode, almost

0.6V)

Page 60: Project landrover

This voltage drop needs to be taken into consideration in a circuit which uses many diodes in series.

Also, the amount of current passing through the diodes must be considered. When voltage is applied in

the reverse direction through a diode, the diode will have a great resistance to current flow. Different

diodes have different characteristics when reverse-biased. A given diode should be selected depending

on how it will be used in the circuit. The current that will flow through a diode biased in the reverse

direction will vary from several mA to just µA, which is very small.

The limiting voltages and currents permissible must be considered on a case by case basis. For example,

when using diodes for rectification, part of the time they will be required to withstand a reverse voltage.

If the diodes are not chosen carefully, they will break down

Rectification / Switching / Regulation Diode:

The stripe stamped on one end of the diode shows indicates the polarity of the diode. The stripe shows

the cathode side. The top two devices shown in the picture are diodes used for rectification. They are

made to handle relatively high currents. The device on top can handle as high as 6A, and the one below

it can safely handle up to 1A.

However, it is best used at about 70% of its rating because this current value is a maximum rating.

The third device from the top (red color) has a part number of 1S1588. This diode is used for switching,

because it can switch on and off at very high speed.

However, the maximum current it can handle is 120 mA.

This makes it well suited to use within digital circuits. The

maximum reverse voltage (reverse bias).this diode can

handle is 30V

Page 61: Project landrover

The device at the bottom of the picture is a voltage regulation diode with a rating of 6V. When this type

of diode is reverse biased, it will resist changes in voltage. If the input voltage is increased, the output

voltage will not change. (Or any change will be an insignificant amount.) While the output voltage does

not increase with an increase in input voltage, the output current will.

This requires some thought for a protection circuit so that too much current does not flow.

The rated current limit for the device is 30 mA.

Generally, a 3-terminal voltage regulator is used for the stabilization of a power supply. Therefore, this

diode is typically used to protect the circuit from momentary voltage spikes. 3 terminal regulators use

voltage regulation diodes inside.

Rectification diodes are used to make DC from AC. It is possible to do only 'half wave rectification'

using 1 diode. When 4 diodes are combined, 'full wave rectification' occurrs.

Devices that combine 4 diodes in one package are called diode bridges. They are used for full-wave

rectification.

Fig:-5.4

5.2 Light Emitting Diode (LED):

Page 62: Project landrover

Fig:-5.5

Light emitting diodes must be chosen according to how they will be used, because there are

various kinds. The diodes are available in several colors. The most common colors are red and

green, but there are even blue ones.The device on the far right in the photograph combines a red

LED and green LED in one package.The component lead in the middle is common to both

LEDs. As for the remains two leads, one side is for the green, the other for the red LED. When

both are turned on simultaneously, it becomes orange.

When an LED is new out of the package, the polarity of the device can be determined by looking

at the leads. The longer lead is the Anode side, and the short one is the Cathode side.

The polarity of an LED can also be determined using a resistance meter, or even a 1.5 V battery.

When using a test meter to determine polarity, set the meter to a low resistance measurement

range. Connect the probes of the meter to the LED. If the polarity is correct, the LED will glow.

If the LED does not glow, switch the meter probes to the opposite leads on the LED. In either

case, the side of the diode which is connected to the black meter probe when the LED glows, is

the Anode side. Positive voltage flows out of the black probe when the meter is set to measure

resistance.

Fig:-5.6

Page 63: Project landrover

It is possible to use an LED to obtain a fixed voltage. The voltage drop (forward voltage, or VF)

of an LED is comparatively stable at just about 2V. I explain a circuit in which the voltage was

stabilized with an LED in "Thermometer of bending apparatus-2"..

Shottky barrier diode:

Diodes are used to rectify alternating current into direct current. However, rectification will not occur

when the frequency of the alternating current is too high. This is due to what is known as the "reverse

recovery characteristic."

The reverse recovery characteristic can be explained as follows:

IF the opposite voltage is suddenly applied to a forward-biased diode, current will continue to flow in

the forward direction for a brief moment. This time until the current stops flowing is called the Reverse

Recovery Time. The current is considered to be stopped when it falls to about 10% of the value of the

peak reverse current.

The Shottky barrier diode has a short reverse recovery time, which makes it ideally suited to use in high

frequency rectification.

Fig:-5.7

The Shottky barrier diode has the following characteristics.

The voltage drop in the forward direction is low.

The reverse recovery time is short.

However, it has the following disadvantages.

The diode can have relatively high leakage current.

Page 64: Project landrover

The surge resistance is low. Because the reverse recovery time is short, this diode is often used for the

switching regulator in a high frequency circuit

Diode Marking:

European diodes are marked using two or three letters and a number. The first letter is used to identify

the material used in manufacturing the component (A - germanium, B - silicon), or, in case of letter Z, a

Zener diode.

The second and third letters specify the type and usage of the diode. Some of the verities are:

A - low power diode, like the AA111, AA113, AA121, etc. - they are used in the detector of a radio re-

ceiver; BA124, BA125 : varicap diodes used instead of variable capacitors in receiving devices, oscilla-

tors, etc., BAY80, BAY93, etc. - switching diodes used in devices using logic circuits. BA157, BA158,

etc. - these are switching diodes with short recovery time.

B - two capacitive (varicap) diodes in the same housing, like BB104, BB105, etc.

Y - regulation diodes, like BY240, BY243, BY244, etc. - these regulation diodes come in a plastic pack-

aging and operate on a maximum current of 0.8A. If there is another Y, the diode is intended for higher

current. For example, BYY44 is a diode whose absolute maximum current rating is 1A. When Y is the

second letter in a Zener diode mark (ZY10, ZY30, etc.) it means it is intended for higher current.

G, G, PD - different tolerance marks for Zener diodes. Some of these are ZF12 (5% tolerance), ZG18

(10% tolerance), ZPD9.1 (5% tolerance).

The third letter is used to specify a property (high current, for example).

American markings begin with 1N followed by a number, 1N4001, for example (regulating diode),

1N4449 (switching diode), etc.

Japanese style is similar to American, the main difference is that instead of N there is S, 1S241 being

one of them.

Page 65: Project landrover

Practical examples:

The diagram of a power supply in figure (3.8) uses several diodes. The first four are in a single package,

identified by B40C1500. This is a bridge rectifier.

The LED in the circuit indicates the transformer is working. Resistor R1 is used to limit the current

through the LED and the brightness of the LED indicates the approximate voltage.

Diodes marked 1N4002 protect the integrated circuit.

Figure 5.3 below shows some other examples of diodes. The life of a globe can be increased by adding a

diode as shown in 5.3a. By simply connecting it in series, the current passing through the globe is halved

and it lasts a lot longer. However the brightness is reduced and the light becomes yellow. The Diode

should have a reverse voltage of over 400V, and a current higher than the globe. A 1N4004 or BY244 is

suitable.A very simple DC voltage stabilizer for low currents can be made using 5.3c as a reference.

Page 66: Project landrover

Fig:-5.8 - using a diode to prolong the light bulb's life span, b - stair-light LED indicator,

c - voltage stabilizer, d - voltage rise indicator, e - rain noise synthesizer, f  - backup supply

Unstabilized voltage is marked "U", and stabilized with "UST." Voltage on the Zener diode is

equal to UST, so if we want to achieve a stabilized 9V, we would use a ZPD9.1 diode. Although

this stabilize has limited use it is the basis of all designs found in power supplies.

Page 67: Project landrover

We can also devise a voltage overload detector as shown in figure. A LED indicates when a

voltage is over a predefined value. When the voltage is lower than the operating voltage of the

Zener, the zener acts as a high value resistor, so DC voltage on the base of the transistor is very

low, and the transistor does not "turn on." When the voltage rises to equal the Zener voltage, its

resistance is lowered, and transistor receives current on its base and it turns on to illuminate the

LED. This example uses a 6V Zener diode, which means that the LED is illuminated when the

voltage reaches that value. For other voltage values, different Zener diodes should be used.

Brightness and the exact moment of illuminating the LED can be set with the value of Rx.

To modify this circuit so that it signals when a voltage drops below some predefined level, the

Zener diode and Rx are swapped. For example, by using a 12V Zener diode, we can make a car battery

level indicator. So, when the voltage drops below 12V, the battery is ready for recharge.

Figure 5.3e shows a noise-producing circuit, which produces a rain-like sound. DC current flowing

through diode AA121 isn't absolutely constant and this creates the noise which is amplified by the

transistor (any NPN transistor) and passed to a filter (resistor-capacitor circuit with values 33nF and

100k).

5.3Resistor

Resistors are the most commonly used component in electronics and their purpose is to create specified

values of current and voltage in a circuit. A number of different resistors are shown in the photos. (The

resistors are on millimeter paper, with 1cm spacing to give some idea of the dimensions).  Photo 1.1a

shows some low-power resistors, while photo 1.1b shows some higher-power resistors. Resistors with

power dissipation below 5 watt (most commonly used types) are cylindrical in shape, with a wire

protruding from each end for connecting to a circuit . Resistors with power dissipation above 5 watt are

shown below.

Page 68: Project landrover

High-po resistors and rheostats power resistors

The symbol for a resistor is shown in the following diagram (upper: American symbol, lower: European

symbol.)

Resistor symbols

The unit for measuring resistance is the OHM. (the Greek letter Ω - called Omega). Higher resistance values

are represented by "k" (kilo-ohms) and M (meg ohms). For example, 120 000 Ω is represented as 120k, while 1

200 000 Ω is represented as 1M2. The dot is generally omitted as it can easily be lost in the printing process. In

some circuit diagrams, a value such as 8 or 120 represents a resistance in ohms. Another common practice is to

use the letter E for resistance in ohms. The letter R can also be used. For example, 120E (120R) stands for 120

Ω, 1E2 stands for 1R2 etc.

1.1 Carbon film resistors:

This is the most general purpose, cheap resistor. Usually the tolerance of the resistance value is ±5%. Power

ratings of 1/8W, 1/4W and 1/2W are frequently used.

Carbon film resistors have a disadvantage; they tend to be electrically noisy. Metal film resistors are

Page 69: Project landrover

recommended for use in analog circuits. However, I have never experienced any problems with this noise. The

physical size of the different resistors is as follows.

From the top of the photograph

Rough size

Rating powerThicknessLength

Fig:5.10

This resistor is called a Single-In-Line(SIL) resistor network. It is made with many resistors of the same value,

all in one package. One side of each resistor is connected with one side of all the other resistors inside. One

example of its use would be to control the current in a circuit powering many light emitting diodes (LEDs).

In the photograph on the left, 8 resistors are housed in the package. Each of the leads on the package is one

resistor. The ninth lead on the left side is the common lead. The face value of the resistance is printed. ( It

depends on the supplier. )

Some resistor networks have a "4S" printed on the top of the resistor network. The 4S indicates that the package

contains 4 independent resistors that are not wired together inside. The housing has eight leads instead of nine.

The internal wiring of these typical resistor networks has been illustrated below. The size (black part) of the

resistor network which I have is as follows: For the type with 9 leads, the thickness is 1.8 mm, the height 5mm,

and the width 23 mm. For the types with 8 component leads, the thickness is 1.8 mm, the height 5 mm, and the

width 20 mm.

Fig:- 5.11

Page 70: Project landrover

Metal film resistors :

Metal film resistors are used when a lower tolerance (more accurate value) is needed. They are much more

accurate in value than carbon film resistors. They have about ±0.05% tolerance. They have about ±0.05%

tolerance. I don't use any high tolerance resistors in my circuits. Resistors that are about ±1% are more than

sufficient. Ni-Cr (Nichrome) seems to be used for the material of resistor. The metal film resistor is used for

bridge circuits, filter circuits, and low-noise analog signal circuits.

From the top of the photograph

1/8W (tolerance ±1%)

1/4W (tolerance ±1%)

1W (tolerance ±5%)

2W (tolerance ±5%)

Rough size

Rating powerThicknessLength

Nonlinear resistors

Resistance values detailed above are a constant and do not change if the voltage or current-flow alters. But there

are circuits that require resistors to change value with a change in temperate or light. This function may not be

linear, hence the name NONLINEAR RESISTORS.

There are several types of nonlinear resistors, but the most commonly used include : NTC resistors (figure a)

(Negative Temperature Co-efficient) - their resistance lowers with temperature rise. PTC resistors (figure b)

(Positive Temperature Co-efficient) - their resistance increases with the temperature rise. LDR resistors (figure

c) (Light Dependent Resistors) - their resistance lowers with the increase in light. VDR resistors (Voltage de-

Page 71: Project landrover

pendent Resistors) - their resistance critically lowers as the voltage exceeds a certain value. Symbols represent-

ing these resistors are shown below.

Fig:-5.12: Nonlinear resistors - a. NTC, b. PTC, c. LDR

In amateur conditions where nonlinear resistor may not be available, it can be replaced with other components.

For example, NTC resistor may be replaced with a transistor with a trimmer potentiometer, for adjusting the re-

quired resistance value. Automobile light may play the role of PTC resistor, while LDR resistor could be re-

placed with an open transistor. As an example, figure on the right shows the 2N3055, with its upper part re -

moved, so that light may fall upon the crystal inside.

Cds Elements (LDR)light dependent resister :

Some components can change resistance value by changes in the amount of light hitting them. One type is the

Cadmium Sulfide Photocell. (Cd) The more light that hits it, the smaller its resistance value becomes. There are

many types of these devices. They vary according to light sensitivity, size, resistance value etc.

Pictured at the left is a typical CDS photocell. Its diameter is 8 mm, 4 mm high, with a cylinder form. When

bright light is hitting it, the value is about 200 ohms, and when in the dark, the resistance value is about 2M

ohms. This device is using for the head lamp illumination confirmation device of the car, for example.

Page 72: Project landrover

Fig:-5.13

Resistor Power Dissipation

If the flow of current through a resistor increases, it heats up, and if the temperature exceeds a certain critical value, it can be damaged. The wattage rating of a resistor is the power it can dissipate over a long period of time. Wattage rating is not identified on small resistors. The following diagrams show the size and wattage rat-ing:

Fig:-5.14 Resistor dimensions

Most commonly used resistors in electronic circuits have a wattage rating of 1/2W or 1/4W. There are smaller resistors  (1/8W and 1/16W) and higher (1W, 2W, 5W, etc).

In place of a single resistor with specified dissipation, another one with the same resistance and higher rating may be used, but its larger dimensions increase the space taken on a printed circuit board as well as the added cost.

Power (in watts) can be calculated according to one of the following formulae, where U is the symbol for Volt-age across the resistor (and is in Volts), I is the symbol for Current in Amps and R is the resistance in ohms:

Page 73: Project landrover

For example, if the voltage across an 820W resistor is 12V, the wattage dissipated by the resistors is:

A 1/4W resistor can be used.

In many cases, it is not easy to determine the current or voltage across a resistor. In this case the wattage dissi -pated by the resistor is determined for the "worst" case. We should assume the highest possible voltage across a resistor, i.e. the full voltage of the power supply (battery, etc). If we mark this voltage as VB, the highest dissipation is:

For example, if VB=9V, the dissipation of a 220W resistor is:

A 0.5W or higher wattage resistor should be used

Page 74: Project landrover

Fig:-5.15

Resistor Markings

Resistance value is marked on the resistor body. Most resistors have 4 bands. The first two bands provide the numbers for the resistance and the third band provides the number of zeros. The fourth band indicates the toler -ance. Tolerance values of  5%, 2%, and 1% are most commonly available. The following table shows the colors used to identify resistor values:

COLOR DIGIT MULTIPLIER TOLERANCE TC Silver    x 0.01 ±10%   Gold    x 0.1 ±5%   Black 0  x 1     Brown 1  x 10 ±1% ±100*10-6/K Red 2  x 100 ±2% ±50*10-6/K Orange 3  x 1 k   ±15*10-6/K Yellow 4  x 10 k   ±25*10-6/K Green 5  x 100 k ±0.5%   Blue 6  x 1 M ±0.25% ±10*10-6/K Violet 7  x 10 M ±0.1% ±5*10-6/K Grey 8  x 100 M     White 9  x 1 G   ±1*10-6/K

Fig. 5.14: b. Four-band resistor, c. Five-band resistor, d. Cylindrical SMD resistor, e. Flat SMD resistor

Page 75: Project landrover

CAPACITORS:

The capacitor's function is to store electricity, or electrical energy. The capacitor also functions

as a filter, passing alternating current (AC), and blocking direct current (DC). This symbol ‘F’ is

used to indicate a capacitor in a circuit diagram. The capacitor is constructed with two electrode

plates facing each other, but separated by an insulator. When DC voltage is applied to the

capacitor, an electric charge is stored on each electrode. While the capacitor is charging up,

current flows. The current will stop flowing when the capacitor has fully charged.

Types of Capacitor:

Fig. 5.15 Types of Capacitor

Breakdown voltage

when using a capacitor, we must pay attention to the maximum voltage which can be used. This

is the "breakdown voltage." The breakdown voltage depends on the kind of capacitor being used.

We must be especially careful with electrolytic capacitors because the breakdown voltage is

comparatively low. The breakdown voltage of electrolytic capacitors is displayed as Working

Voltage. The breakdown voltage is the voltage that when exceeded will cause the dielectric

Page 76: Project landrover

(insulator) inside the capacitor to break down and conduct. When this happens, the failure can be

catastrophic.

Electrolytic Capacitors (Electrochemical type capacitors)

Aluminum is used for the electrodes by using a thin oxidization membrane.

Large values of capacitance can be obtained in comparison with the size of the capacitor,

because the dielectric used is very thin. The most important characteristic of electrolytic

capacitors is that they have polarity. They have a positive and a negative electrode. [Polarised]

This means that it is very important which way round they are connected. If the capacitor is

subjected to voltage exceeding its working voltage, or if it is connected with incorrect polarity, it

may burst. It is extremely dangerous, because it can quite literally explode. Make absolutely no

mistakes. Generally, in the circuit diagram, the positive side is indicated by a "+" (plus) symbol.

Electrolytic capacitors range in value from about 1µF to thousands of µF. Mainly this type of

capacitor is used as a ripple filter in a power supply circuit, or as a filter to bypass low frequency

signals, etc. Because this type of capacitor is comparatively similar to the nature of a coil in

construction, it isn't possible to use for high-frequency circuits. (It is said that the frequency

characteristic is bad.)

The photograph on the left is an example of the different values of electrolytic capacitors in

which the capacitance and voltage differ.

Fig:-5.16 Electrolytic Capacitors

From the left to right:

1µF (50V) [diameter 5 mm, high 12 mm]

47µF (16V) [diameter 6 mm, high 5 mm]

100µF (25V) [diameter 5 mm, high 11 mm]

Page 77: Project landrover

220µF (25V) [diameter 8 mm, high 12 mm]

1000µF (50V) [diameter 18 mm, high 40 mm]

The size of the capacitor sometimes depends on the manufacturer. So the sizes shown here on

this page are just examples.

Ceramic Capacitors

Ceramic capacitors are constructed with materials such as titanium acid barium used as the

dielectric. Internally, these capacitors are not constructed as a coil, so they can be used in high

frequency applications. Typically, they are used in circuits which bypass high frequency signals

to ground. These capacitors have the shape of a disk. Their capacitance is comparatively small.

The capacitor on the left is a 100pF capacitor with a diameter of about 3 mm. The capacitor on

the right side is printed with 103, so 10 x 103pF becomes 0.01 µF. The diameter of the disk is

about 6 mm. Ceramic capacitors have no polarity. Ceramic capacitors should not be used for

analog circuits, because they can distort the signal.

Fig:- 5.17Ceramic Capacitors

Variable Capacitors:

Variable capacitors are used for adjustment etc. of frequency mainly. On the left in the

photograph is a "trimmer," which uses ceramic as the dielectric. Next to it on the right is one that

uses polyester film for the dielectric. The pictured components are meant to be mounted on a

printed circuit board.

Page 78: Project landrover

Fig:-5.18 Variable Capacitors

When adjusting the value of a variable capacitor, it is advisable to be careful. One of the

component's leads is connected to the adjustment screw of the capacitor. This means that the

value of the capacitor can be affected by the capacitance of the screwdriver in your hand. It is

better to use a special screwdriver to adjust these components.

Page 79: Project landrover

5.4 Motor Driver ICs: L293/L293D and L298

L293D L298 Fig:-5.19 Fig:-5.20

The current provided by the MCU is of the order of 5mA and that required by a motor is ~500mA. Hence, motor can’t be controlled directly by MCU and we need an interface between the MCU and the motor.

A Motor Driver IC like L293D or L298 is used for this purpose which has two H-bridge drivers. Hence, each IC can drive two motors.

Note that a motor driver does not amplify the current; it only acts as a switch (An H bridge is nothing but 4 switches).

Fig:-5.21

Drivers are enabled in pairs, with drivers 1 and 2 being enabled by the Enable pin. When an enable input is high (logic 1 or +5V), the associated drivers are enabled and their outputs are active and in phase with their inputs.

Page 80: Project landrover

When the enable pin is low, the output is neither high nor low (disconnected), irrespective of the input.

Direction of the motor is controlled by asserting one of the inputs to motor to be high (logic 1) and the other to be low (logic 0).

To move the motor in opposite direction just interchange the logic applied to the two

inputs of the motors.

Asserting both inputs to logic high or logic low will stop the motor.

Resistance of our motors is about 26 ohms i.e. its short circuit current will be around.

0.46Amp which is below the maximum current limit.

It is always better to use high capacitance (~1000μF) in the output line of a motor driver

which acts as a small battery at times of current surges and hence improves battery life.

Difference between L293 and L293D: Output current per channel = 1A for L293 and

600mA for L293D.

Page 81: Project landrover

Motor Driver:

H- Bridge Concept :

It is an electronic circuit which enables a voltage to be applied across a load in either di-

rection.

It allows a circuit full control over a standard electric DC motor. That is, with an H-

bridge, a microcontroller, logic chip, or remote control can electronically command the

motor to go forward, reverse, brake, and coast.

H-bridges are available as integrated circuits, or can be built from discrete components

A "double pole double throw" relay can generally achieve the same electrical functional-

ity as an H-bridge, but an H-bridge would be preferable where a smaller physical size is

needed, high speed switching, low driving voltage, or where the wearing out of mechan-

ical parts is undesirable.

The term "H-bridge" is derived from the typical graphical representation of such a

circuit, which is built with four switches, either solid-state (eg, L293/ L298) or

mechanical (eg, relays).

Fig:-5.23 Structure of an H-bridge

Page 82: Project landrover

S1 S2 S3 S4 RESULT

1 0 0 1 MOTOR

ROTATE IN

ONE

DIRECTION

0 1 1 0 MOTOR

ROTATE IN

OPP.

DIRECTION

0 0 0 0 MOTOR FREE

TO

RUN(COASTS)

1 0 1 0 MOTOR

BRAKE

0 1 0 1 MOTOR

BRAKE

Fig:-5.24 H-BRIDGE MOTOR DRIVER CONCEPT

Page 83: Project landrover

5.5Sensors:

5.5.1ANALOG SENSOR

Fig:-5.24

Fig:-5.25

The IR analog sensor consists of:

Transmitter: An Infra Red emitting diode

Receiver: A Phototransistor (also referred as photodiode)

It is better to keep R2 as a variac to vary the sensitivity.

Page 84: Project landrover

The output varies from 0V to 5V depending upon the amount of IR it receives, hence the name

analog.

The output can be taken to a microcontroller either to its ADC (Analog to Digital Converter) or

LM 339 can be used as a comparator.

Digital IR Sensor - TSOP Sensor

Fig:-5.26

TSOP 1738 Sensor is a digital IR Sensor; It is logic 1 (+5V) when IR below a threshold

is falling on it and logic 0 (0V) when it receives IR above threshold.

It does not respond to any stray IR, it only responds to IR falling on it at a pulse rate of

38 KHz. Hence we have a major advantage of high immunity against ambient light.

No comparator is required and the range of the sensor can be varied by varying the inten-

sity of the IR emitting diode (the variac in figure).

Page 85: Project landrover

5.6 8870 DTMF DECODER IC

The M-8870 is a full DTMF Receiver that integrates both band split filter and decoder functions into a single18-pin DIP or SOIC package. Manufactured using CMOS process technology, the M-8870 offers low power consumption (35 mW max) and precise data handling. Its filter section uses switched capacitor technology for both the high and low group filters and for dial tone rejection. Its decoder uses digital counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit code. External component count is minimized by provision of an on-chip differential input amplifier, clock generator, and latched tri-state interface bus. Minimal external components required include a low-cost 3.579545 MHz color burst crystal, a timing resistor, and a timing capacitor. The M-8870-02 provides a “power-down” option which, when enabled, drops consumption to less than 0.5 mW. The M-8870-02 can also inhibit the decoding of fourth column digits

Fig:-5.27Functional Description

M-8870 operating functions include a band split filter that separates the high and low tones of the received pair, and a digital decoder that verifies both the frequency and duration of the received tones before passing the resulting 4-bit code to the output bus.

Page 86: Project landrover

Filter:

The low and high group tones are separated by applying the dual-tone signal to the inputs of two

6th order switched capacitor band pass filters with bandwidths

That corresponds to the bands enclosing the low and high group tones. The filter also

incorporates notches at 350 and 440 Hz, providing excellent dial tone rejection. Each filter

output is followed by a single-order switched capacitor section that smoothes the signals prior to

limiting. Signal limiting is performed by high gain

comparators provided with hysteresis to prevent detection of unwanted low-level signals and

noise. The comparator outputs provide full-rail logic swings at the frequencies of the incoming

tones.

The M-8870 decoder uses a digital counting technique to determine the frequencies of the

limited tones and to verify that they correspond to standard DTMF frequencies. A complex

averaging algorithm is used to protect against tone simulation by extraneous signals (such as

voice) while tolerating small frequency variations. The algorithm ensures an optimum

combination of immunity to talk off and tolerance to interfering signals

(Third tones) and noise. When the detector recognizes the simultaneous presence of two valid

tones (known as signal condition), it raises the Early Steering flag (Est.). Any subsequent loss of

signal condition will cause Est. to fall.

Page 87: Project landrover

STRIP

OUT N/C

OUT N/O

SPRING

MAGNET

230V P

5.7RELAYS

A relay is an electrically operated switch. The relay contacts can be made to operate in

the pre-arranged fashion. For instance, normally open contacts close and normally closed

contacts open. In electromagnetic relays, the contacts however complex they might be,

they have only two position i.e. OPEN and CLOSED, whereas in case of electromagnetic

switches, the contacts can have multiple positions.

Page 88: Project landrover

NEED FOR THE USE OF RELAY

The reason behind using relay for switching loads is to provide complete electrical isola-

tion. The means that there is no electrical connection between the driving circuits and the

driven circuits. The driving circuit may be low voltage operated low power circuits that

control several kilowatts of power. In our circuit where a high fan could be switched on

or off depending upon the output from the telephone.

Since the relay circuit operated on a low voltage, the controlling circuit is quite safe. In

an electromagnetic relay the armature is pulled by a magnetic force only. There is no

electrical connection between the coil of a relay and the switching contacts of the relay. If

there are more than one contact they all are electrically isolated from each other by

mounting them on insulating plates and washers. Hence they can be wired to control dif-

ferent circuits independently.

Some of the popular contacts forms are described below:

1. Electromagnetic relay

2. Power Relay.

3. Time Delay Relay.

4. Latching Relay.

5. Crystal Can Relay.

6. Co-axial Relay.

1. Electromagnetic relay:

An electromagnetic relay in its simplest form consists of a coil, a DC current passing

through which produces a magnetic field. This magnetic field attracts an armature, which

Page 89: Project landrover

in turn operates the contacts. Normally open contacts close and normally closed contacts

open. Electromagnetic relays are made in a large variety of contacts forms.

2. Power relays:

Power relays are multi-pole heavy duty lapper type relays that are capable of switching

resistive loads of upto 25amp.. These relays are widely used for a variety of industrial ap-

plication like control of fractional horse power motors, solenoids, heating elements and

so on. These relays usually have button like silver alloy contacts and the contact welding

due to heavy in rush current is avoided by wiping action of the contacts to quench the arc

during high voltage DC switching thus avoiding the contact welding.

3. Time Delay Relay:

A time delay relay is the one in which there is a desired amount of time delay between

the application of the actuating signal and operation of the load switching devices.

4. Latching Relay:

In a Latching Relay, the relay contacts remain in the last energized position even after re-

moval of signal in the relay control circuit. The contacts are held in the last relay-ener-

gized position after removal of energisation either electrically or magnetically. The con-

tacts can be released to the normal position electrically or mechanically.

Page 90: Project landrover

5. Crystal Can Relay:

They are so called, as they resemble quartz crystal in external shapes. These are high per-

formance hermetically sealed miniature or sub-miniature relay widely used in aerospace

and military application. These relays usually have gold plated contacts and thus have ex-

tremely low contact resistance. Due to low moment of inertia of the armature and also

due to statically and dynamically balanced nature of armature, these relays switch quite

reliably even under extreme condition of shock and vibration.

6. Co-axial Relay:

A Co-axial Relay has two basic parts, an actuator which is nothing but some kind of a

coil and a cavity, housing the relay contacts. The co-axial relay are extensively used for

radio frequency switching operations of equipment

Page 91: Project landrover

Power Supply

5.8TRANSFORMER:

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

inductively coupled conductors — the transformer's coils or "windings". Except for air-core

transformers, the conductors are commonly wound around a single iron-rich core, or around

separate but magnetically-coupled cores. A varying current in the first or "primary" winding

creates a varying magnetic field in the core (or cores) of the transformer. This varying magnetic

field induces a varying electromotive force (EMF) or "voltage" in the "secondary" winding. This

effect is called mutual induction.

Fig:-5.29

If a load is connected to the secondary circuit, electric charge will flow in the secondary winding

of the transformer and transfer energy from the primary circuit to the load connected in the sec -

ondary circuit.

The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP by a

factor equal to the ratio of the number of turns of wire in their respective windings:

Page 92: Project landrover

5.8.1BASIC PARTS OF A TRANSFORMER :

In its most basic form a transformer consists of:

A primary coil or winding.

A secondary coil or winding.

A core that supports the coils or windings.

Refer to the transformer circuit in figure as you read the following explanation: The primary

winding is connected to a 60-hertz ac voltage source. The magnetic field (flux) builds up (ex-

pands) and collapses (contracts) about the primary winding. The expanding and contracting mag-

netic field around the primary winding cuts the secondary winding and induces an alternating

voltage into the winding. This voltage causes alternating current to flow through the load. The

voltage may be stepped up or down depending on the design of the primary and secondary wind-

ings.

Fig:-5.30

Page 93: Project landrover

5.8.2THE COMPONENTS OF A TRANSFORMER :

Two coils of wire (called windings) are wound on some type of core material. In some cases the

coils of wire are wound on a cylindrical or rectangular cardboard form. In effect, the core mate-

rial is air and the transformer is called an AIR-CORE TRANSFORMER. Transformers used at

low frequencies, such as 60 hertz and 400 hertz, require a core of low-reluctance magnetic mate-

rial, usually iron. This type of transformer is called an IRON-CORE TRANSFORMER. Most

power transformers are of the iron-core type. The principle parts of a transformer and their func-

tions are:

The CORE, which provides a path for the magnetic lines of flux.

The PRIMARY WINDING, which receives energy from the ac source.

The SECONDARY WINDING, which receives energy from the primary winding and de-

livers it to the load.

The ENCLOSURE, which protects the above components from dirt, moisture, and me-

chanical damage.

5.9BRIDGE RECTIFIER

A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave

rectification. This is a widely used configuration, both with individual diodes wired as shown

and with single component bridges where the diode bridge is wired internally.

Page 94: Project landrover

Basic operation

According to the conventional model of current flow originally established by Benjamin Franklin

and still followed by most engineers today, current is assumed to flow through electrical conduc-

tors from the positive to the negative pole. In actuality, free electrons in a conductor nearly al-

ways flow from the negative to the positive pole. In the vast majority of applications, however,

the actual direction of current flow is irrelevant. Therefore, in the discussion below the conven-

tional model is retained.

In the diagrams below, when the input connected to the left corner of the diamond is positive,

and the input connected to the right corner is negative, current flows from the upper supply ter-

minal to the right along the red (positive) path to the output, and returns to the lower supply ter-

minal via the blue (negative) path.

Fig:-5.31

When the input connected to the left corner is negative, and the input connected to the right cor-

ner is positive, current flows from the lower supply terminal to the right along the red path to

the output, and returns to the upper supply terminal via the blue path.

Page 95: Project landrover

Fig:-5.32

In each case, the upper right output remains positive and lower right output negative. Since this

is true whether the input is AC or DC, this circuit not only produces a DC output from an AC in -

put, it can also provide what is sometimes called "reverse polarity protection". That is, it permits

normal functioning of DC-powered equipment when batteries have been installed backwards, or

when the leads (wires) from a DC power source have been reversed, and protects the equipment

from potential damage caused by reverse polarity.

Prior to availability of integrated electronics, such a bridge rectifier was always constructed from

discrete components. Since about 1950, a single four-terminal component containing the four

diodes connected in the bridge configuration became a standard commercial component and is

now available with various voltage and current ratings.

Output smoothing

For many applications, especially with single phase AC where the full-wave bridge serves to

convert an AC input into a DC output, the addition of a capacitor may be desired because the

bridge alone supplies an output of fixed polarity but continuously varying or "pulsating" magni-

tude (see diagram above).

Page 96: Project landrover

Fig:-5.32

The function of this capacitor, known as a reservoir capacitor (or smoothing capacitor) is to

lessen the variation in (or 'smooth') the rectified AC output voltage waveform from the bridge.

One explanation of 'smoothing' is that the capacitor provides a low impedance path to the AC

component of the output, reducing the AC voltage across, and AC current through, the resistive

load. In less technical terms, any drop in the output voltage and current of the bridge tends to be

canceled by loss of charge in the capacitor. This charge flows out as additional current through

the load. Thus the change of load current and voltage is reduced relative to what would occur

without the capacitor. Increases of voltage correspondingly store excess charge in the capacitor,

thus moderating the change in output voltage / current.

The simplified circuit shown has a well-deserved reputation for being dangerous, because, in

some applications, the capacitor can retain a lethal charge after the AC power source is removed.

If supplying a dangerous voltage, a practical circuit should include a reliable way to safely dis-

charge the capacitor. If the normal load cannot be guaranteed to perform this function, perhaps

because it can be disconnected, the circuit should include a bleeder resistor connected as close as

practical across the capacitor. This resistor should consume a current large enough to discharge

the capacitor in a reasonable time, but small enough to minimize unnecessary power waste.

Because a bleeder sets a minimum current drain, the regulation of the circuit, defined as percent-

age voltage change from minimum to maximum load, is improved. However in many cases the

improvement is of insignificant magnitude.

Page 97: Project landrover

The capacitor and the load resistance have a typical time constant τ = RC where C and R are the

capacitance and load resistance respectively. As long as the load resistor is large enough so that

this time constant is much longer than the time of one ripple cycle, the above configuration will

produce a smoothed DC voltage across the load.

In some designs, a series resistor at the load side of the capacitor is added. The smoothing can

then be improved by adding additional stages of capacitor–resistor pairs, often done only for sub-

supplies to critical high-gain circuits that tend to be sensitive to supply voltage noise.

The idealized waveforms shown above are seen for both voltage and current when the load on

the bridge is resistive. When the load includes a smoothing capacitor, both the voltage and the

current waveforms will be greatly changed. While the voltage is smoothed, as described above,

current will flow through the bridge only during the time when the input voltage is greater than

the capacitor voltage. For example, if the load draws an average current of n Amps, and the

diodes conduct for 10% of the time, the average diode current during conduction must be 10n

Amps. This non-sinusoidal current leads to harmonic distortion and a poor power factor in the

AC supply.

In a practical circuit, when a capacitor is directly connected to the output of a bridge, the bridge

diodes must be sized to withstand the current surge that occurs when the power is turned on at

the peak of the AC voltage and the capacitor is fully discharged. Sometimes a small series resis-

tor is included before the capacitor to limit this current, though in most applications the power

supply transformer's resistance is already sufficient.

Output can also be smoothed using a choke and second capacitor. The choke tends to keep the

current (rather than the voltage) more constant. Due to the relatively high cost of an effective

choke compared to a resistor and capacitor this is not employed in modern equipment.

Some early console radios created the speaker's constant field with the current from the high

voltage ("B +") power supply, which was then routed to the consuming circuits, (permanent

magnets were then too weak for good performance) to create the speaker's constant magnetic

field. The speaker field coil thus performed 2 jobs in one: it acted as a choke, filtering the power

supply, and it produced the magnetic field to operate the speaker.

Page 98: Project landrover

5.10 VOLTAGE REGULATOR IC (78XX):

It is a three pin IC used as a voltage regulator. It converts unregulated DC current into regulated

DC current.

Fig:-5.33

Normally we get fixed output by connecting the voltage regulator at the output of the filtered

DC (see in above diagram). It can also be used in circuits to get a low DC voltage from a high

DC voltage (for example we use 7805 to get 5V from 12V). There are two types of voltage regu-

lators 1. fixed voltage regulators (78xx, 79xx) 2. variable voltage regulators (LM317) In fixed

voltage regulators there is another classification 1. +ve voltage regulators 2. -ve voltage regula-

tors POSITIVE VOLTAGE REGULATORS This include 78xx voltage regulators. The most

Page 99: Project landrover

commonly used ones are 7805 and 7812. 7805 gives fixed 5V DC voltage if input voltage is in

(7.5V, 20V).

CHAPTER-6

SCOPE OF THE PROJECT :

6.1 APPLICATIONS :

Scientific :

Page 100: Project landrover

Remote control vehicles have various Scientific uses including hazardous environments, working

in the deep ocean , and space exploration. The majority of the probes to the other planets in our

solar system have been remote control vehicles, although some of the more recent ones were

partially autonomous. The sophistication of these devices has fueled greater debate on the need

for manned spaceflight and exploration. The Voyager I spacecraft is the first craft of any kind to

leave the solar system. The Martian explorers Spirit and Opportunity have provided continuous

data about the surface of Mars since January 3, 2004 .

Military and Law Enforcement :

Military usage of remotely controlled military vehicles dates back to the first half of 20th century.

Soviet Red Army used remotely controlled Teletanks during 1930s in the Winter War and early

stage of World War II. There were also remotely controlled cutters and experimental remotely

Controlled planes in the Red Army

Search and Rescue :

UAVs will likely play an increased role in search and rescue in the United States. This was

demonstrated by the successful use of UAVs during the 2008 hurricanes that struck Louisiana

and Texas.

Recreation and Hobby:

See Radio-controlled model. Small scale remote control vehicles have long been popular among

hobbyists. These remote controlled vehicles span a wide range in terms of price and sophistica-

tion .There are many types of radio controlled vehicles. These include on-road cars, off road

trucks, boats, airplanes, and even helicopters. The ’robots’ now popular in television shows such

as Robot Wars, are a recent extension of this hobby (these vehicles do not meet the classical defi-

nition of a robot; they are remotely controlled by a human). Radio-controlled submarine also

exist.

ADVANTAGES :

Page 101: Project landrover

1.Wireless control

2. Surveillance System.

3. Vehicle Navigation with use of 3G technology.

3. Takes in use of the mobile technology which is almost

available everywhere.

4. This wireless device has no boundation of range and

can be controlled as far as network of cell phone

DISADVANTAGES :

1. Cell phone bill.

2. Mobile batteries drain out early so charging problem.

3. Cost of project if Cell phone cost included.

4. Not flexible with all cell phones as only a particular ,cell

phone whose earpiece is attached can only be used.

FURTHER IMPROVEMENTS & FUTURE

6.2SCOPE :

1. IR Sensors:

Page 102: Project landrover

IR sensors can be used to automatically detect & avoid obstacles if the robot goes beyond line of

sight. This avoids damage to the vehicle if we are maneuvering it from a dist ant place.

2. Password Protection:

Project can be modified in order to password protect the robot so that it can be operated only if

correct password is entered. Either cell phone should be password protected or necessary modifi-

cation should be made in the assembly language code. This introduces conditioned access & in-

creases security to a great extent.

3. Alarm Phone Dialer:

By replacing DTMF Decoder IC CM8870 by a !DTMF Transceiver IC’ CM8880 , DTMF tones

can be generated from the robot. So, a project called !Alarm Phone Dialer! can be built which

will generate necessary alarms for something that is desired to be monitored (usually by trigger-

ing a relay). For example, a high water alarm, low temperature alarm, opening of back window,

garage door, etc. When the system is activated it will call a number of programmed numbers to

let the user know the alarm has been activated. This would be great to get alerts of

alarm conditions from home when user is at work.

4. Adding a Camera:

If the current project is interfaced with a camera(e.g. a Webcam) robot can be driven beyond

line-of-sight & range becomes practically unlimited as GSM networks have a very large range.

CONCLUSION

Page 103: Project landrover

In the designing of Project has been an exhilarating and enriching experience. Here during the

designing of Project I came to know about all the processes of designing of Pcb related to Project

the up various machines, maintaining and designing of projects tempo to achieve best knowledge

and keeping high knowledge of the project designing. I also tried to study about various projects

prepared to achieve best experience about projects . To have knowledge of project designing and

maintenance of the same in such a big quantum has been highly enriching to me.

To sum up, in these 06 weeks I had come across all the processes Related to the electronics

Project designing.

REFERENCE

Page 104: Project landrover

www.projectguidance.com

Electronics for u

Electronics-project-design

Hobbyprojects

Mazidi and mazidi

Electronics-lab.com