You are on page 1of 74

TABLE OF CONTENTS

TITLE PAGE NO.


Declaration ii
Certificate iii
Acknowledgement iv
Abstract v
List of figures vi

CHAPTER 1: PLAT FORM USED & SOFTWARE REQUIRED

1.0 Introduction 4
1.1 Platform used
1.1.0 Software Requirements 5
1.1.1 Hardware requirements 5

CHAPTER 2:

2.0 Aim of the project 6


2.1 Block diagram 7

CHAPTER 3:
3.0 Working of the project 8
3.1 Circuit Diagram 9
3.2 Circuit Description
3.2.1 Power Supply Section 10
3.2.2 Microcontroller Section 10
3.2.3 Buzzer Section 10
3.3 Printed Circuit Boards Description
3.3.1 Manufacturing 12
3.3.2 Lamination 14
3.3.3 Drilling 14
3.3.4 Protection and packaging 17
1
3.3.5 Steps involved in making PCB 18
3.4 Component list 20
CHAPTER 4: SOFTWARE PROGRAM

4.0 SOFTWARE SPECIFICATION 21


4.0.1 Prog -Studio 6 software v6.09 21
4.0.2 Areas of use 21
4.0.3 Overview of the Hex editor mode 21
4.0.4 Overview of the MC Editor mode 22
(Compiler/assembler/debugger)
4.1 PROGRAMMING 23

CHAPTER 5: Sensing unit

5.1 LDR 27
5.2 IR SENSOR TX & RX 27
5.3 RAIN OPERATED WIPER SENSOR 30
5.4 FIRE SENSOR 32
5.4.1 Features 32
5.4.2 Functional description 33
5.5 Temperature sensor readings 34

CHAPTER 6:

6.0 MICROCONTROLLER UNIT


6.0.1 ITRODUCTION OF MICROCONTROLLER 36
6.0.2 MICROCONTROLLER INTERFACE 36
89s52 (8051)
6.1 Port Pin Alternate Functions 37
6.2 Description 38
6.3 Pin Descript 38
6.4 Special Microcontroller Features 39
6.5 Data Memory 39
6.5.1Special Function Registers 40
6.5.2 Timer 2 Registers 40
6.5.3 Interrupt Registers 40
6.5.4 Table 2 41
6.5.5 Symbol Function 41
6.6 AT89C52 42
6.6.1 Timer 0 and 1 42
2
6.6.2 Timer 2 42
6.6.3 Capture Mode 42
6.6.4 Auto-Reload (Up or Down Counter) 42
6.6.5 Baud Rate Generator 43
6.6 Pin Diagram 45

CHAPTER 7: Component description

7.0 DC Motors 46
7.1 Transformers 48
7.1.1 Basic principle 48
7.2 Rectifier 50
7.2.1 Basic Operation 51
7.2.2 Output Smoothing 52
7.2.3 LM7805 (3-Terminal Fixed Voltage 54
Regulator)
7.2.4 Features 55
7.3 RELAYS 56
7.3.1 Advantages of relays 57
7.3.2 Disadvantages of relays 58
7.4 Crystal Oscillator 58
7.5 CAPACITRO 59
7.6 RESISTOR 60
7.7 TRANSISTORS 61
7.8 Buzzer 62
7.9 DIODE 63
CHAPTER 8:
Conclusion of project 65
8.0 APLICATION 66
8.1 Features 66
8.2 Future scope 67
8.3 Result 68
8.4 Physical hard ware view 69

Annexures
Annexures 1 70
Annexures 2 71
References

3
CHAPTER 1

PLAT FORM USED & SOFTWARE REQUIRED

1.0 INTRODUCTION

Our purpose behind this project to develop an application which


can be useful in the areas where human beings cannot tackle the
situation, where automatic car can be very useful. This application will
show method through which automatic car can be accessed
remotely. This protocol works with low power consumption. Using this
project it will be easy to control automatic car. They give information
each moment.

Our motive behind this project to develop an application which


will provide automatic car. In practical scenario there are many
situations where human beings can face accident because of they
cannot control the car. Automatic braking is a technology for
automobiles to sense an imminent collision with another vehicle,
person or obstacle; or a danger such as a high brakes or by
applying the brakes to slow the vehicle without any driver input.
Sensors to detect other vehicles or obstacles can include radar,
video, infrared, ultrasonic or other Technologies.
Microcontroller is similar to the microprocessor but the basic
difference between tow is the inbuilt memory In the controller which
make it a chip IC cost about Rs.50.Whereas the cost of the processor
is about Rs.500.
This heart of this project is ATMEL microcontroller and the
controller available in the market has to be used so we have used
89s52 (8051), 40 pin controller according to the requirement.

Sensing plates can be connected remotely


Adjustable response time
Adjustable sensitivities
Continuous auto-calibration
Digital processing method

4
1.1 Platform used

1.1.1 Software Requirements

1. INFONICS: Serial Programmer Software Hex files editor

2. MTLAB IDE v7.00: Source code Editor Assembler

3. Orcad for Circuit Designing


4. Pad for PCB Designing

1.1.1 Hardware requirements

1) Microcontroller 8051(89s52)

2) LM7805 Regulator

3) Power Supply

4) Resistors

5) Capacitors

6) Transistors

7) LEDs

8) Connectors

9) Relays

10) Liquid crystal display

11) Motor

12) Buzzer

13) switches

5
CHAPTER 2

2.0 AIM OF THE PROJECT

This system is 8051 microcontroller based project since this


project controlling signal and track monitoring system and taking
the required decisions according to that.
Our main aim is to protect the automatic car system and
stop each types of accident so keeping this in mind we have
designed our project.

6
2.1 Block diagram

8051
Motor Motor
Regulat Microcont
ed
Drivin
roller Mot
g IC

IR
Receiv

IR
Trans
BLOCK DIGRAM OF REVERSE
SYSTEM
Microco IR
Regulat ntroller TRANSMI
ed
IR
RECEI
Moto Moto
r Whe
Mot el
Drivi

7
CHAPTER 3

3.0 WORKING OF THE PROJECT

I designed a circuit on P.C.B board, then tested the circuit and


found some errors which were removed then.

I have written a program and installed in the circuit. Then I


have designed a model and executed the project.

The computer uses sensors on the engine and transmission to detect such
things as throttle position, vehicle speed, engine speed, engine load, brake
pedal position, etc. to control exact shift points as well as how soft or firm
the shift should be. Once the computer receives this information, it then
sends signals to a solenoid pack inside the transmission.

8
3.1 CIRCUIT DIAGRAM

9
3.2 CIRCUIT DESCRIPTION

3.2.1 POWER SUPPLY SECTION:

1. RLMT Connector--- It is a connector used to connect the step


down transformer to the bridge rectifier.

2. Bridge Rectifier --- It is a full wave rectifier used to convert


ac into dc , 9-15v ac made by transformer is converted into dc
with the help of rectifier.

3. Capacitor: -----It is an electrolytic capacitor of rating


1000M/35V used for filtering to give the peak dc. Capacitor is
the component used to pass the ac and block the dc.

4. Regulator: ----LM7805 is used to give a fixed 5v regulated


supply.

5. Capacitor: -----It is again an electrolytic capacitor 10M/65v


used for filtering to give pure dc.

6. Capacitor: ----- It is an ceramic capacitor used to remove the


spikes generated when frequency is high(spikes).So the output
of supply section is 5v regulated dc.

3.2.2 MICROCONTROLLER SECTION:

The microcontroller incorporates all the features that are


found in microprocessor. The microcontroller has built in ROM, RAM,
Input Output ports, Serial Port, timers, interrupts and clock circuit. A
microcontroller is an entire computer manufactured on a single chip.

3.2.3 BUZZER SECTION

This section includes a buzzer as well as a resistance to limit


the current. The buzzer operates in the range of 20-25mA. The
10
voltage given to the buzzer is 5v and also the buzzer can operate
between 3V-24V. The resistance used is calculated by using the
ohm’s law. Buzzer is an indicating device which is used for checking
the software condition and also used for indicating any specific
condition.

3.3 Printed Circuit Boards DESCRIPTION

In electronics, printed circuit boards, or PCBs, are used to


mechanically support and electrically connect electronic components
using conductive pathways, or traces, etched from copper sheets
laminated onto a non-conductive substrate. Alternative names are
printed wiring board (PWB),and etched wiring board. Populating the
board with electronic components forms a printed circuit assembly
(PCA), also known as a printed circuit board assembly (PCBA). PCBs
are rugged, inexpensive, and can be highly reliable. They require
much more layout effort and higher initial cost than either wire-
wrapped or point-to-point constructed circuits, but are much cheaper,
faster, and consistent in high volume production.
Printed circuit boards fall into the following categories:
Motherboard The principal board that has connectors for attaching
devices to the bus. Typically, the mother board contains the CPU,
memory, and basic controllers for the system. On PCs, the
motherboard is often called the system board or main board.

Expansion board Any board that plugs into one of the computer's
expansion slots. Expansion boards include controller boards, LAN
cards, and video adapters.
Daughter card Any board that attaches directly to another board.

11
Controller board A special type of expansion board that contains a
controller for a peripheral device. When you attach new devices, such
as a disk drive or graphics monitor, to a computer, you often need to
add a controller board.

Network Interface Card (NIC) : An expansion board that enables a


PC to be connected to a local-area network (LAN).
Video adapter: An expansion board that contains a controller for a
graphics monitor.
Printed circuit boards are also called cards.

3.3.1 Manufacturing

Patterning (etching)
The vast majority of printed circuit boards are made by adhering a
layer of copper over the entire substrate, sometimes on both sides,
(creating a "blank PCB") then removing unwanted copper after
applying a temporary mask (eg. by etching), leaving only the desired
copper traces. A few PCBs are made by adding traces to the bare
substrate (or a substrate with a very thin layer of copper) usually by a
complex process of multiple electroplating steps.
There are three common "subtractive" methods (methods that
remove copper) used for the production of printed circuit boards:

1. Silk screen printing uses etch-resistant inks to protect the


copper foil. Subsequent etching removes the unwanted copper.
Alternatively, the ink may be conductive, printed on a blank

12
(non-conductive) board. The latter technique is also used in the
manufacture of hybrid circuits.
2. Photoengraving uses a photomask and chemical etching to
remove the copper foil from the substrate. The photomask is
usually prepared with a photoplotter from data produced by a
technician using CAM, or computer-aided manufacturing
software. Laser-printed transparencies are typically employed
for phototools; however, direct laser imaging techniques are
being employed to replace phototools for high-resolution
requirements.
3. PCB milling uses a two or three-axis mechanical milling
system to mill away the copper foil from the substrate. A PCB
milling machine (referred to as a 'PCB Prototyper') operates in a
similar way to a plotter, receiving commands from the host
software that control the position of the milling head in the x, y,
and (if relevant) z axis. Data to drive the Prototype is extracted
from files generated in PCB design software and stored in
HPGL or Gerber file format.

"Additive" processes also exist. The most common is the "semi-


additive process. In this version, the unpatterned board has a thin
layer of copper already on it. A reverse mask is then applied. (Unlike
a subtractive process mask, this mask exposes those parts of the
substrate that will eventually become the traces.) Additional copper is
then plated onto the board in the unmasked areas; copper may be
plated to any desired weight. Tin-lead or other surface plating are
then applied. The mask is stripped away and a brief etching step
removes the now-exposed original copper laminate from the board,

13
isolating the individual traces. The additive process is commonly used
for multi-layer boards as it facilitates the plating-through of the holes
(vias) in the circuit board.

3.3.2 Lamination
Some PCBs have trace layers inside the PCB and are called multi-
layer PCBs. These are formed by bonding together separately etched
thin boards.

3.3.3 Drilling

Holes, or vias, through a PCB are typically drilled with tiny drill bits
made of solid tungsten carbide. The drilling is performed by
automated drilling machines with placement controlled by a drill tape
or drill file. These computer-generated files are also called
numerically controlled drill (NCD) files or "Excellon files". The drill file
describes the location and size of each drilled hole. When very small
vias are required, drilling with mechanical bits is costly because of
high rates of wear and breakage. In this case, the vias may be
evaporated by lasers. Laser-drilled vias typically have an inferior
surface finish inside the hole. These holes are called micro vias. It is
also possible with controlled-depth drilling, laser drilling, or by pre-
drilling the individual sheets of the PCB before lamination, to produce
holes that connect only some of the copper layers, rather than
passing through the entire board. These holes are called blind vias
when they connect an internal copper layer to an outer layer, or
buried vias when they connect two or more internal copper layers.
14
The walls of the holes, for boards with 2 or more layers, are plated
with copper to form plated-through holes that electrically connect the
conducting layers of the PCB. For multilayer boards, those with 4
layers or more, drilling typically produces a smear comprised of the
bonding agent in the laminate system. Before the holes can be plated
through, this smear must be removed by a chemical de-smear
process, or by plasma-etch.

Exposed conductor plating and coating

The pads and lands to which components will be mounted are


typically plated, because bare copper oxidizes quickly, and therefore
is not readily solder able. Traditionally, any exposed copper was
plated with solder. This solder was a tin-lead alloy, however new
solder compounds are now used to achieve compliance with the
RoHS directive in the EU, which restricts the use of lead. Other
plating’s used are OSP (organic surface protect ant), immersion
silver, electrolysis nickel with immersion gold coating (ENIG), and
direct gold. Edge connectors, placed along one edge of some boards,
are often gold plated.
Solder resist
Areas that should not be soldered to may be covered with a
polymer solder resist (solder mask) coating. The solder resist
prevents solder from bridging between conductors and thereby
creating short circuits. Solder resist also provides some protection
from the environment.

15
Screen printing
Line art and text may be printed onto the outer surfaces of a PCB by
screen printing. When space permits, the screen print text can
indicate component designators, switch setting requirements, test
points, and other features helpful in assembling, testing, and
servicing the circuit board.Screen print is also known as the silk
screen, or, in one sided PCBs, the red print.
Test
Unpopulated boards may be subjected to a bare-board test where
each circuit connection (as defined in a netlist) is verified as correct
on the finished board. For high-volume production, a Bed of nails
tester or fixture is used to make contact with copper lands or holes on
one or both sides of the board to facilitate testing. A computer will
instruct the electrical test unit to send a small amount of current
through each contact point on the bed-of-nails as required, and verify
that such current can be seen on the other appropriate contact points.
For small- or medium-volume boards, flying-probe testers use moving
test heads to make contact with the copper lands or holes to verify
the electrical connectivity of the board under test.

Populating
After the PCB is completed, electronic components must be attached
to form a functional printed circuit assembly, or PCA. In through-hole
construction, component leads may be inserted in holes and
electrically and mechanically fixed to the board with a molten metal
solder, while in surface-mount construction, the components are
16
simply soldered to pads or lands on the outer surfaces of the
PCB.Often, through-hole and surface-mount construction must be
combined in a single PCA because some required components are
available only in surface-mount packages, while others are available
only in through-hole packages.

Again, JEDEC guidelines for PCB component placement, soldering,


and inspection are commonly used to maintain quality control in this
stage of PCB manufacturing. After the board is populated, the
populated board may be tested with an in-circuit test system. To
facilitate this test, PCBs may be designed with extra pads to make
temporary connections. Sometimes these pads must be isolated with
resistors. The in-circuit test may also exercise boundary scan test
features of some components. In-circuit test systems may also be
used to program nonvolatile memory components on the board. In
boundary scan testing, test circuits integrated into various ICs on the
board form temporary connections between the pcb traces to test that
the ICs are mounted correctly. Boundary scan testing requires that all
the ICs to be tested use a standard test configuration procedure, the
most common one being the Joint Test Action Group (JTAG)
standard.

3.3.4 Protection and packaging

PCBs intended for extreme environments often have a


conformal coat, which is applied by dipping or spraying after the
components have been soldered. The coat prevents corrosion and
leakage currents or shorting due to condensation. The earliest
17
conformal coats were wax. Modern conformal coats are usually dips
of dilute solutions of silicone rubber, polyurethane, acrylic, or epoxy.
Some are engineering plastics sputtered onto the PCB in a vacuum
chamber. Many assembled PCBs are static sensitive, and therefore
must be placed in antistatic bags during transport. When handling
these boards, the user must be earthed; failure to do this might
transmit an accumulated static charge through the board, damaging
or destroying it. Even bare boards are sometimes static sensitive.
Traces have gotten so fine that it's quite possible to blow an etch off
the board (or change its characteristics) with a static charge. This is
especially true on non-traditional PCBs such as MCMs and
microwave PCBs.

3.3.5 Steps involved in making PCB

 Prepare the layout of the circuit (positive).


 Cut the photofilm (slightly bigger) of the size of the layout.
 Place the layout in the photoprinter machine with the photofilm
above it. Make sure that the bromide (dark) side of the film is in
contact with the layout.
 Switch on the machine by pressing the push button for 5 sec.
 Dip the film in the solution prepared (developer) by mixing the
chemicals A & B in equal quantities in water.
 Now clean the film by placing it in the tray containing water for 1
min.
 After this, dip the film in the fixer solution for 1 min. now the
negative of the circuit is ready.

18
 Now wash it under the flowing water.
 Dry the negative in the photocure machine.
 Take the PCB board of the size of the layout and clean it with steel
wool to make the surface smooth.
 Now dip the PCB in the liquid photoresist, with the help of dip coat
machine.
 Now clip the PCB next to the negative in the photo cure machine,
drying for approximate 10-12 minute.
 Now place the negative on the top of the PCB in the UV machine,
set the timer for about 2.5 minute and switch on the UV light at the
top.
 Take the LPR developer in a container and rigorously move the
PCB in it.
 After this, wash it with water very gently.
 Then apply LPR dye on it with the help of a dropper so that it is
completely covered by it.
 Now clamp the PCB in the etching machine that contains ferric
chloride solution for about 10 minutes.
 After etching, wash the PCB with water, wipe it a dry cloth softly.
 Finally rub the PCB with a steel wool, and the PCB is ready.

19
3.4 Component list

20
CHAPTER 4

SOFTWARE PROGRAM

4.0 SOFTWARE SPECIFICATION

4.0.1 Prog -Studio 6 software v6.09

Aside from basic functions such as the reading, programming,


comparison copying and erasure of chips in the Batronix
programming devices, the Prog-Studio 6 software offers numerous
other functions. The Hex/ASCII editor gives you many options for
working with the component contents, and the MC editor integrates a
comprehensive compiler/assembler/debugger for developers of
microcontroller applications.

4.0.2 Areas of use

 Updating of memory chips (Eproms/Flash) for motherboards,


telephone installations, game consoles, motor control systems,
automatons, etc.

 Reading in and altering data on existing memory chips for, e.g.,


chip tuning

 Development and production of applications with memory chips

 Development of microcontroller applications

 Learning microcontroller programming

4.0.3 Overview of the Hex editor mode

 In this mode, data can be loaded, processed and stored. Also,


data can be burned onto a chip or read from a chip.

21
 Data can be loaded and saved in the binary, Intel-Hex,
Motorola-S and other formats.

 The simple editing of data in the Hex editor with a comparison


function as well as area processing

 Special settings such as burning from/to a certain memory


address (offset) as well as separation into even and odd
addresses (splitting odd/even) are supported.

 Serial burn function for the production of large numbers of items


with identical data

 Data comparison function (verify) with bit-to-bit comparison.

 Automatic comparison of the check sum during comparison


(verify)

 Calculation of the check sum for editor data

4.0.4 Overview of the MC Editor mode


(Compiler/assembler/debugger)

 Assembler/compiler for all MCS-51 microcontrollers


(8051,...,80C535,...,89C2051,...,89C52,...,89S8252,...)

 Important information is always at hand with the supplementary


"Commands" window. The hex code, as well as the required
bytes and machine cycles, are also shown for each command.

 Speedy navigation and improved overview with the


supplementary "jump marks" window. The selected routine or
jump mark is displayed at a click of the mouse.

 Notes can be stored in the supplementary "Notes" window and


are managed separately for each created program.

22
 Basic support for the simple programming of frequently required
partial functions such as conditions (If...Else) or loops (For...),
nesting possible up to 99 levels

 Integrated debugger with single step functions and stop points


directly in the source code! Display of all registers (SFR) and
memory addresses (RAM as well as external RAM).

 Support for all common number formats (decimal, hexadecimal,


binary + ASCII), data fields (DB, DW) and allocation (EQU, BIT,
DATA) as well as special directions for debugging (STOP, #IF
DEBUGGING, #IF NOT DEBUGGING.

4.1 PROGRAMMING

#include<reg52.h>

sbit TMOTL =P3^0;


sbit TMOTR =P3^1;
sbit MMOTL =P3^2;
sbit MMOTR =P3^3;
sbit LMOTL =P3^4;
sbit LMOTR =P3^5;

sbit MTL1=P2^0;
sbit MTR1=P2^1;
sbit MTL2=P2^2;
sbit MTR2=P2^3;

void msec_wait(int z)
{
int a,y;
for(a=0;a<z*10;a++)
for(y=0;y<z*10;y++);
23
}

void msec1_wait(int f)
{
int a,y;
for(a=0;a<f*1;a++)
for(y=0;y<f*1;y++);
}

void main()
{
while(1)
{
P3=0X00;
P2=0X00;

if(P0==0xf9) ///////////////FF
{
MTL1=1;
MTL2=1;
MTR1=0;
MTR2=0;
msec_wait(1);

}
else if(P0==0xfa) ///////////////RW
{
MTL1=0;
MTL2=0;
MTR1=1;
MTR2=1;
msec_wait(1);

}
else if(P0==0xfc)//////////////LEFT
{
MTL1=1;
MTR1=0;

24
MTL2=0;
MTR2=0;
msec_wait(1);

}
else if(P0==0xfb)/////////////RIGHT
{
MTL1=0;
MTR1=0;
MTL2=1;
MTR2=0;
msec_wait(1);

}
else if(P0==0xf1)

{
TMOTL=1; ///////////////top motor left
TMOTR=0;
msec_wait(1);

}
else if(P0==0xf2)

{
TMOTL=0; ///////////////top motor right
TMOTR=1;
msec_wait(1);

else if(P0==0xf4)

{
MMOTL=1; ///////////////mid motor left
MMOTR=0;
msec_wait(1);
}

25
else if(P0==0xf3)

{
MMOTL=0; ///////////////mid motor right
MMOTR=1;
msec_wait(1);

////////////////
else if(P0==0xf6)
{
LMOTL=1; ///////////////LOW motor left
LMOTR=0;
msec_wait(1);

}
else if(P0==0xf5)
{

MMOTL=0; ///////////////LOW motor right


MMOTR=1;
msec_wait(1);
}
}

26
CHAPTER 5

Sensing unit

5.1 LDR

A photo resistor or light-dependent resistor (LDR) or photocell is


a light-controlled variable resistor. The resistance of a photo
resistor decreases with increasing incident light intensity; in other
words, it exhibits photoconductivity. A photo resistor can be
applied in light-sensitive detector circuits, and light- and dark-
activated switching circuits.

Figure 5.1 LDR SENSOR

5.2 IR SENSOR TX & RX

Figure shows a transmitted circuit powered by a 9v battery. When


switch s1 is closed,LED1 glows to indicate the presence of power
in the circuit. Timer IC555(IC1) is wired as an unstable
multivibrator. The output frequency (38khz) of IC1 at its pin 3 can
be varied using vr1(2k). The output of IC1 is given to the base of
npn transistor T1(BC548) via resisterR3. the Transistor t1 and t2
(BC548) form a Darlington pair that boost the output current to
drive the two infrared diodes in series at the collector of the
Darlington pair(IR LED1 AND IR LED2). The output signal
frequency of 38khz is transmitted by the IR LEDs.

27
Figure 5.2 IR SENSOR TX & RX

Figure shows the receiver circuit powered by a 9v battery. When


the switch s2 is closed ,LED2 glows to indicate the presence of
power in circuit. The 9v battery is converted to 5v using regulator
IC 7805 (IC2) to drive the IR receiver module
(TSOP1738),microcontroller and voice processor section.
The IR rays reflected from any object in the path of the user are
received by IR receiver module. This signal is amplified by the
power amplifier stage comprising transistors T3, T4 AND T5(each
BC548). The amplified output at the emitter of transistor T5 is
given to the non-inverting input(pin2) of comparator IC
LM311(IC3) through the resister R13.
A reference voltage of 2.2v developed across zener diode ZD1 is
connected to the inverting input (pin3) of IC3. when the voltage
level at pin 2 increases beyond your reference voltage, output pin
7 of IC3 goes high , which is indicated by the glowing of LED3.
This output is given to the I/O PORT P1.O of microcontroller IC4

28
Circuit TX

Figure 5.3 Circuit Tx

Circuit Rx

Figure 5.4 Circuit Rx

29
5.3 RAIN OPERATED WIPER SENSOR

 OPERATED WIPER”, which is fully equipped by


sensors circuit and wiper motor.
 It is a genuine project which is fully equipped and
designed for Automobile vehicles.
 This forms an integral part of best quality. This
product underwent strenuous test in our
 Automobile vehicles and it is good.
 The battery supplies the power to the sensor as well
as rain operated motor. Wiper
 motor is automatically ON during the time of
rainfall. The senor is fixed in the vehicle
 glass. The conductive (Touch) sensor is used in this
project. It senses the rainfall and
 giving control signal to the control unit. The control
unit activates the wiper motor
 automatically. This operation is called “Automatic
rain operated wiper”.

Figure 5.5 Rain operated wiper sensor

30
There are two main applications for rain sensors. The first is a
water conservation device connected to an automatic irrigation
system that causes the system to shut down in the event of rainfall.
The second is a device used to protect the interior of an automobile
from rain and to support the automatic mode of windscreen wipers.

Figure 5.6 Automatic rain operated wiper

31
5.4 FIRE SENSOR

National Semiconductor’s LM335 IC has been used for sensing the


temperature. It is an integrated circuit sensor that can be used to
measure temperature with an electrical output proportional to the
temperature (in oC). The temperature can be measured more
accurately with it than using a thermistor. The sensor circuitry is
sealed and not subject to oxidation, etc.

Figure 5.7 LM335 Fire Sensors

5.4.1 Features

• Calibrated directly in ° Celsius (Centigrade)

• Linear + 10.0 mV/°C scale factor

• 0.5°C accuracy guaranteed (at +25°C)

• Rated for full −55° to +150°C range

• Suitable for remote applications


32
• Low cost due to wafer-level trimming

• Operates from 4 to 30 volts

• Less than 60 μA current drain

Figure 5.8 Temperature Sensor Circuit

5.4.2 Functional description

• The sensor has a sensitivity of 10mV / oC.

• The output of LM35 is amplified using a single power supply (+5V)


op-amp.

• The op-amp is designed to have a gain of 5.

• The circuitry measures temperatures with a resolution


of up to 0.5 degree Celsius.
33
• The output voltage is converted to temperature by a
simple conversion factor.
The general equation used to convert output voltage to
temperature is:

Temperature ( oC) = (Vout * 100 ) / 5 oC


…(4.4)
So if Vout is 5V, then, Temperature = 100 oC

• The output voltage varies linearly with temperature.

5.5 Temperature sensor readings

FORMULA:
Temperature ( Oc ) = (Vout/5) *100( Oc/V)

34
5.5 Temperature Sensor Readings

35
CHAPTER 6

6.0 MICROCONTROLLER UNIT

6.0.1 ITRODUCTION OF MICROCONTROLLER

The microcontroller incorporates all the features that are found in


microprocessor. The microcontroller has built in ROM, RAM, Input Output
ports, Serial Port, timers, interrupts and clock circuit. A microcontroller is an
entire computer manufactured on a single chip Microcontrollers are
usually dedicated devices embedded within an application. For
example, microcontrollers are used as engine controllers in
automobiles and as exposure and focus controllers in cameras. In
order to serve these applications, they have a high concentration of
on-chip facilities such as serial ports, parallel input output ports,
timers, counters, interrupt control, analog-to-digital converters,
random access memory, read only memory, etc. The I/O, memory,
and on-chip peripherals of a microcontroller are selected
depending on the specifics of the target application. Since
microcontrollers are powerful digital processors, the degree of
control and programmability they provide significantly enhances
the effectiveness of the application. The 8051 is the first
microcontroller of the MCS-51 family introduced by Intel
Corporation at the end of the 1970s. The 8051 family with its
many enhanced members enjoys the largest market share,
estimated to be about 40%, among the various microcontroller
architectures.

6.0.2 MICROCONTROLLER INTERFACE


89s52 (8051)

The AT89C52 is a low-power, high-performance CMOS 8-bit


microcomputer with 8 Kbytes of Flash programmable and erasable
read only memory (PEROM). The device is manufactured using
Atmel’s high density non-volatile memory technology and is
compatible with the industry standard 80C51 and 80C52 instruction
36
set and pin out. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional non-volatile memory
programmer. By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C52 is a powerful microcomputer
This provides a highly flexible and cost effective solution to many
embedded control applications...
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port,
each pin can sink eight TTL inputs. When 1s are written to port 0
pins, the pins can be used as high-impedance
inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data
memory. In this mode, P0 has internal pullups. Port 0 also receives
the code bytes during Flash programming and outputs the code bytes
during program verification. External pullups are required during
program verification. Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written
to Port 1 pins, they are pulled high by
the internal pullups and can be used as inputs. As inputs, Port 1 pins
that are externally being pulled low will source current (IIL) because of
the internal pullups. In addition, P1.0 and P1.1 can be configured to
be the timer/counter 2 external count input (P1.0/T2) and the
timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in
the following table.

6.1 Port Pin Alternate Functions


P1.0 T2 (external count input to Timer/Counter 2), clock-out P1.1
T2EX (Timer/Counter 2 capture/reload trigger and direction control)
The AT89C52 provides the following standard features: 8 Kbytes of
Flash, 256 bytes of RAM, 32 I/O lines, three 16- bit timer/counters, a
six-vector two-level interrupt architecture, a full duplex serial port, on-
chip oscillator, and clock circuitry. In addition, the AT89C52 is
designed with static logic for operation down to zero frequency and
supports two software selectable power saving modes. The Idle

37
Mode stops the CPU while allowing the RAM, timer/counters, serial
port, and interrupt system to continue functioning. The Power Down
Mode saves the RAM contents but freezes the oscillator, disabling all
other chip functions until the next hardware reset.

6.2 Description

(Continued) Port 1 also receives the low-order address bytes


during Flash programming and program verification. Port 2 is an 8-bit
bidirectional I/O port with internal pullups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pullups and can be used as
inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL)
because of the internal pullups. Port 2 emits the high-order address
byte during fetches from external program memory and during
accesses to external data memory that use 16-bit addresses (MOVX
AT DPTR). In this application, Port 2 uses strong internal pullups
when emitting 1s. During accesses to external
data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register. Port 2 also receives the
high-order address bits and some control signals during Flash
programming and verification. Port 3 Port 3 is an 8-bit bidirectional
I/O port with internal pullups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins, they
are pulled high by the internal pullups and can be used as inputs. As
inputs,
Port 3 pins that are externally being pulled low will source current (IIL)
because of the pullups. Port 3 also serves the functions of various
special features of the AT89C51, as shown in the following table.

6.3 Pin Descript

In normal operation, ALE is emitted at a constant rate of 1/6 the


oscillator frequency and may be used for external timing or clocking
purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory. If desired, ALE operation can be
disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is
active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect
38
if the microcontroller is in external execution mode. PSEN Program
Store Enable is the read strobe to external program memory. When
the AT89C52 is executing code from external program
memory, PSEN is activated twice each machine cycle, except that
two PSEN activations are skipped during each access to external
data memory.
EA/VPP External Access Enable. EA must be strapped to GND in
order to enable the device to fetch code from external program
memory locations starting at 0000H up to FFFFH. Note, however,
that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This
pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming when 12-volt programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the
Internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.

6.4 Special Microcontroller Features

Compatible with MCS-51TM Products


8 Kbytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
Three-Level Program Memory Lock
256 x 8-Bit Internal RAM
32 Programmable I/O Lines
Three 16-Bit Timer/Counters
Eight Interrupt Sources
Programmable Serial Channel
Low Power Idle and Power Down Modes

6.5 Data Memory

The AT89C52 implements 256 bytes of on-chip RAM. The upper


128 bytes occupy a parallel address space to the Special Function
Registers. That means the upper 128 bytes have the same
addresses as the SFR space but are physically separate from SFR
space. When an instruction accesses an internal location above

39
address 7FH, the address mode used in the instruction specifies
whether the CPU accesses the upper 128 bytes of RAM or the SFR
space. Instructions that use direct addressing access SFR space. For
example, the following direct addressing instruction accesses the
SFR at location 0A0H (which is P2). MOV 0A0H, #data Instructions
that use indirect addressing access the upper 128 bytes of RAM. For
example, the following indirect addressing instruction, where R0
contains 0A0H, accesses the data byte at address 0A0H, rather than
P2 (whose addresses 0A0H). MOV @R0, #data Note that stack
operations are examples of indirect addressing, so the upper 128
bytes of data RAM are available as stack space.

6.5.1Special Function Registers

A map of the on-chip memory area called the Special Function


Register (SFR) space is shown in Table 1. Note that not all of the
addresses are occupied, and unoccupied addresses may not be
implemented on the chip. Read accesses to these addresses will in
general return random data, and write accesses will have an
indeterminate effect. User software should not write 1s to these
unlisted locations, since they may be used in future products to
invoke new features. In that case, the reset or inactive values of the
new bits will always be 0.

6.5.2 Timer 2 Registers:

Control and status bits are contained in registers T2CON (shown


in Table 2) and T2MOD (shown in Table 4) for Timer 2. The register
pair (RCAP2H, RCAP2L) are the Capture/Reload registers for Timer
2 in 16-bit capture mode or 16-bit auto-reload mode.

6.5.3 Interrupt Registers

The individual interrupt enable bits are in the IE register. Two


priorities can be set for each of the six interrupt sources in the IP
register.

40
6.5.4 Table 2.

T2CON—Timer/Counter 2 Control Register T2CON Address =


0C8H Reset Value = 0000 0000B
Bit Addressable TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2
Bit 7 6 5 4 3 2 1 0

6.5.5 Symbol Function

TF2 Timer 2 overflow flag set by a Timer 2 overflow and must


be cleared by software. TF2 will not be set when either RCLK = 1 or
TCLK = 1.EXF2 Timer 2 external flag set when either a capture or
reload is caused by a negative transition on T2EX and EXEN2 = 1.
When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to
vector to the Timer 2 interrupt routine. EXF2 must be cleared by
software. EXF2 does not cause an interrupt in up/down counter mode
(DCEN = 1).
RCLK Receive clock enable. When set, causes the serial port to use
Timer 2 overflow pulses for its receive clock in serial port Modes 1
and 3. RCLK = 0 causes Timer 1 overflow to be used for the receive
clock.
TCLK Transmit clock enable. When set, causes the serial port to use
Timer 2 overflow pulses for its transmit clock in serial port Modes 1
and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit
clock.
EXEN2 Timer 2 external enable. When set, allows a capture or reload
to occur as a result of a negative transition on T2EX if Timer 2 is not
being used to clock the serial port. EXEN2 = 0 causes Timer 2 to
ignore events at T2EX. TR2 Start/Stop control for Timer 2. TR2 = 1
starts the timer.
C/T2 Timer or counter select for Timer 2. C/T2 = 0 for timer function.
C/T2 = 1 for external event counter (falling edge triggered). CP/RL2
Capture/Reload select. CP/RL2 = 1 causes captures to occur on
negative transitions at T2EX if EXEN2 = 1. CP/RL2 = 0 causes
automatic reloads to occur when Timer 2 overflows or negative
transitions occur at T2EX when EXEN2 = 1. When either RCLK or
TCLK = 1, this bit is ignored and the timer is forced to auto-reload on
Timer 2 overflow.

41
6.6 AT89C52

6.6.1 Timer 0 and 1:

Timer 0 and Timer 1 in the AT89C52 operate the same way as


Timer 0 and Timer 1 in the AT89C51.

6.6.2 Timer 2

Timer 2 is a 16-bit Timer/Counter that can operate as either a


timer or an event counter. The type of operation is selected by bit
C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three
operating modes: capture, auto-reload (up or down counting), and
baud rate generator. The
modes are selected by bits in T2CON, as shown in Table 3. Timer 2
consists of two 8-bit registers, TH2 and TL2. In the Timer function,
the TL2 register is incremented every machine cycle. Since a
machine cycle consists of 12 oscillator periods, the count rate is 1/12
of the oscillator frequency. In the Counter function, the register is
incremented in response to a l-to-0 transition at its corresponding
external\ input pin, T2. In this function, the external input is sampled
during S5P2 of every machine cycle. When the samples.

6.6.3 Capture Mode

In the capture mode, two options are selected by bit EXEN2 in


T2CON. If EXEN2 = 0, Timer 2 is a 16-bit timer or counter which
upon overflow sets bit TF2 in T2CON. This bit can then be used to
generate an interrupt. If EXEN2 = 1, Timer 2 performs the same
operation, but a l-to-0 transition at external input T2EX also causes
the current value in TH2 and TL2 to be captured into RCAP2H and
RCAP2L, respectively. In addition, the transition at T2EX causes bit
EXF2 in T2CON to be set. The EXF2 bit, like TF2, can generate an
interrupt. The capture mode is
illustrated in Figure 1.

6.6.4 Auto-Reload (Up or Down Counter)

Timer 2 can be programmed to count up or down when configured in


its 16-bit auto-reload mode. This feature is invoked by the DCEN
(Down Counter Enable) bit located in the SFR T2MOD (seeTable 4).
42
Upon reset, the DCEN bit is set to 0 so that timer 2 will default to
count up. When
DCEN is set, Timer 2 can count up or down, depending on the value
of the T2EX pin. Figure 2 shows Timer 2 automatically counting up
when DCEN = 0. In this mode, two options are selected by bit EXEN2
in T2CON. If EXEN2 = 0, Timer 2 counts up to 0FFFFH and then sets
the TF2 bit upon overflow.

6.6.5 Baud Rate Generator

Timer 2 is selected as the baud rate generator by setting TCLK


and/or RCLK in T2CON (Table 2). Note that the baud rates for
transmit and receive can be different if Timer 2 is used for the
receiver or transmitter and Timer 1 is used for the other function.
Setting RCLK and/or TCLK puts Timer 2 into its baud rate generator
mode, as shown in Figure 4. The baud rate generator mode is similar
to the auto-reload mode, in that a rollover in TH2 causes the Timer 2
registers to be reloaded with the 16-bit value in registers RCAP2H
and RCAP2L, which are present by software. The baud rates in
Modes l and 3 are determined by Timer 2’s overflow rate according to
the following equation. Modes 1 and 3 Baud Rates Timer 2
Overflow Rate 16 The Timer can be configured for either timer or
counter operation. In most applications, it is configured for timer
operation (CP/T2 = 0). The timer operation is different for Timer 2
when it is used as a baud rate generator. Normally, as a timer, it
increments every machine cycle (at 1/12 the oscillator frequency). As
a baud rate generator, however, it increments every state time (at 1/2
the oscillator frequency). The baud rate formula is given below.
Modes 1 and 3 Baud Rate Oscillator Frequency 32 x [65536
RCAP2H, RCAP2L] where (RCAP2H, RCAP2L) is the content of
RCAP2H and RCAP2L taken as a 16-bit unsigned integer. Timer 2 as
a baud rate generator is shown in Figure 4. This figure is valid only if
RCLK or TCLK = 1 in T2CON. Note that a rollover in TH2 does not
set TF2 and will not generate an interrupt. Note too, that if EXEN2 is
set, a l-to- 0 transition in T2EX will set EXF2 but will not cause a
reload from (RCAP2H, RCAP2L) to (TH2, TL2). Thus when Timer 2 is
in use as a baud rate generator, T2EX can be used as an extra
external interrupt. Note that when Timer 2 is running (TR2 = 1) as a
timer in the baud rate generator mode, TH2 or TL2 should not be
read from or written to. Under these conditions, the Timer is
43
incremented every state time, and the results of a read or write may
not be accurate. The RCAP2 registers may be read but should not be
written to, because a write might overlap a reload and cause write
and/or reload errors. The timer should be turned off (clear TR2)
before accessing the Timer 2 or RCAP2 registers.
OSC
EXF2
P1.0
(T2)
P1.1
(T2EX)
TR2
EXEN2
C/T2 BIT
TRANSITION
DETECTOR

44
6.6 Pin Diagram

.
Figure 6.0 Pin diagram of 8051

45
CHAPTER 7

Component description

7.0 DC Motors

In any electric motor, operation is based on simple


electromagnetism. A current-carrying conductor generates a
magnetic field; when this is then placed in an external magnetic field,
it will experience a force proportional to the current in the conductor,
and to the strength of the external magnetic field. As you are well
aware of from playing with magnets as a kid, opposite (North and
South) polarities attract, while like polarities (North and North, South
and South) repel. The internal configuration of a DC motor is
designed to harness the magnetic interaction between a current-
carrying conductor and an external magnetic field to generate
rotational motion.

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


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

Figure 7.0 DC motor

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and
all that BEAMers will see), the external magnetic field is produced by high-
strength permanent magnets1. The stator is the stationary part of the motor --
this includes the motor casing, as well as two or more permanent magnet

46
pole pieces. The rotor (together with the axle and attached commutator)
rotate with respect to the stator. The rotor consists of windings (generally on
a core), the windings being electrically connected to the commutator. The
above diagram shows a common motor layout -- with the rotor inside the
stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings are
such that when power is applied, the polarities of the energized winding and
the stator magnet(s) are misaligned, and the rotor will rotate until it is almost
aligned with the stator's field magnets. As the rotor reaches alignment, the
brushes move to the next commutator contacts, and energize the next
winding. Given our example two-pole motor, the rotation reverses the
direction of current through the rotor winding, leading to a "flip" of the
rotor's magnetic field, driving it to continue rotating.

In real life, though, DC motors will always have more than two poles (three
is a very common number). In particular, this avoids "dead spots" in the
commutator. You can imagine how with our example two-pole motor, if the
rotor is exactly at the middle of its rotation (perfectly aligned with the field
magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there
is a moment where the commutator shorts out the power supply (i.e., both
brushes touch both commutator contacts simultaneously). This would be bad
for the power supply, waste energy, and damage motor components as well.
Yet another disadvantage of such a simple motor is that it would exhibit a
high amount of torque "ripple" (the amount of torque it could produce is
cyclic with the position of the rotor

Figure 7.1 Moving DC motor


47
7.1 Transformers

A transformer is a device that transfers electrical energy from


one circuit to another by magnetic coupling without requiring relative
motion between its parts. It usually comprises two or more coupled
windings, and, in most cases, a core to concentrate magnetic flux. A
transformer operates from the application of an alternating voltage to
one winding, which creates a time-varying magnetic flux in the core.
This varying flux induces a voltage in the other windings. Varying the
relative number of turns between primary and secondary windings
determines the ratio of the input and output voltages, thus
transforming the voltage by stepping it up or down between circuits.

7.1.1 Basic principle

The principles of the transformer are illustrated by consideration


of a hypothetical ideal transformer consisting of two windings of zero
resistance around a core of negligible reluctance. A voltage applied to
the primary winding causes a current, which develops a
magnetomotive force (MMF) in the core. The current required to
create the MMF is termed the magnetising current; in the ideal
transformer it is considered to be negligible. The MMF drives flux
around the magnetic circuit of the core.

Figure 7.2 The ideal transformer as a circuit element


48
An electromotive force (EMF) is induced across each winding, an effect
known as mutual inductance. The windings in the ideal transformer have no
resistance and so the EMFs are equal in magnitude to the measured terminal
voltages. In accordance with Faraday's law of induction, they are
proportional to the rate of change of flux:

and

Equation 7: EMF induced in primary and secondary windings

where:

and are the induced EMFs across primary and secondary windings,

and are the numbers of turns in the primary and secondary windings,

and are the time derivatives of the flux linking the primary and
secondary windings.

In the ideal transformer, all flux produced by the primary winding also links
the secondary, and so , from which the well-known transformer
equation follows:

Equation 8: Transformer Equation

The ratio of primary to secondary voltage is therefore the same as the ratio
of the number of turns; alternatively, that the volts-per-turn is the same in
both windings. The conditions that determine Transformer working in STEP
UP or STEP DOWN mode are:

49
Ns > Np

Equation 9: Conditon for STEP UP

Ns < Np

Equation 10: Conditon for STEP DOWN

7.2 Rectifier

A bridge rectifier is an arrangement of four diodes connected in a


bridge circuit as shown below, that provides the same polarity of output
voltage for any polarity of the input voltage. When used in its most common
application, for conversion of alternating current (AC) input into direct
current (DC) output, it is known as a bridge rectifier. The bridge rectifier
provides full wave rectification from a two wire AC input (saving the cost of
a center tapped transformer) but has two diode drops rather than one
reducing efficiency over a center tap based design for the same output
voltage.

Figure 7.3 Schematic of a bridge rectifier

The essential feature of this arrangement is that for both polarities of


the voltage at the bridge input, the polarity of the output is constant.

50
7.2.1 Basic Operation

When the input connected at the left corner of the diamond is


positive with respect to the one connected at the right hand corner,
current flows to the right along the upper colored path to the output,
and returns to the input supply via the lower one.

When the right hand corner is positive relative to the left hand corner,
current flows along the upper colored path and returns to the supply
via the lower colored path.

51
Figure 7.4 AC, half-wave and full wave rectified signals

In each case, the upper right output remains positive with respect to
the lower right one. Since this is true whether the input is AC or DC,
this circuit not only produces DC power when supplied with AC
power: it also can provide what is sometimes called "reverse polarity
protection". That is, it permits normal functioning when batteries are
installed backwards or DC input-power supply wiring "has its wires
crossed" (and protects the circuitry it powers against damage that
might occur without this circuit in place). 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.

7.2.2 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 important because the bridge alone
supplies an output voltage of fixed polarity but pulsating magnitude.

52
Figure 7.5 Bridge Rectifier with smoothen output

The function of this capacitor, known as a 'smoothing capacitor' (see


also filter capacitor) is to lessen the variation in (or 'smooth') the raw
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 cancelled 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 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 well smoothed DC voltage across
the load resistance. 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.

53
7.2.3 LM7805 (3-Terminal Fixed Voltage Regulator)

The MC78XX/LM78XX/MC78XXA series of three terminal positive


regulators are available in the
TO-220/D-PAK package and with several fixed output voltages,
making them useful in a wide range of
applications. Each type employs internal current limiting, thermal shut
down and safe operating area protection, making it essentially
indestructible. If adequate heat sinking is provided, they can deliver
over 1A output current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to
obtain adjustable voltages and currents.

Figure 7.6 Internal block Diagram

54
Figure 7.7 Fixed Output Regulators

7.2.4 Features

• Output Current up to 1A
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection

55
7.3 RELAYS

a. Circuit symbol for a relay

b. Relays Photographs

c.

Figure 7.8 RELAYS (a,b,c)

A relay is an electrically operated switch. Current flowing through


the coil of the relay creates a magnetic field, which attracts a lever and
changes the switch contacts. The coil current can be on or off so relays have
two switch positions and they are double throw (changeover) switches.

56
Relays allow one circuit to switch a second circuit that can be completely
separate from the first. For example a low voltage battery circuit can use a
relay to switch a 230V AC mains circuit. There is no electrical connection
inside the relay between the two circuit , the link is magnetic and
mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a
12V relay, but it can be as much as 100mA for relays designed to operate
from lower voltages. Most ICs (chips) cannot provide this current and a
transistor is usually used to amplify the small IC current to the larger value
required for the relay coil. The maximum output current for the popular 555
timer IC is 200mA so these devices can supply relay coils directly without
amplification.
Relays are usually SPDT or DPDT but they can have many more sets of
switch contacts, for example relays with 4 sets of changeover contacts are
readily available. For further information about switch contacts and the
terms used to describe them please see the page on switch.

The relay's switch connections are usually labeled COM, NC and NO:
 COM = Common, always connect to this, it is the moving part of
the switch.
 NC = Normally Closed, COM is connected to this when the relay
coil is off.
 NO = Normally Open, COM is connected to this when the relay
coil is on.
 Connect to COM and NO if you want the switched circuit to be on
when the relay coil is on.
 Connect to COM and NC if you want the switched circuit to be on
when the relay coil is off.

7.3.1 Advantages of relays

 Relays can switch AC and DC, transistors can only switch


DC.

 Relays can switch high voltages, transistors cannot.

 Relays are a better choice for switching large currents (> 5A).

 Relays can switch many contacts at once.

57
7.3.2 Disadvantages of relays

 Relays are bulkier than transistors for switching small currents.

 Relays cannot switch rapidly (except reed relays), transistors


can switch many times per second.

 Relays use more power due to the current flowing through their
coil.
 Relays require more current than many chips can provide, so a
low power transistor may be needed to switch the current for
the relay's coil.

7.4 Crystal Oscillator

It is often required to produce a signal whose frequency or


pulse rate is very stable and exactly known. This is important in any
application where anything to do with time or exact measurement is
crucial. It is relatively simple to make an oscillator that produces
some sort of a signal, but another matter to produce one of relatively
precise frequency and stability. AM radio stations must have a carrier
frequency accurate within 10Hz of its assigned frequency, which may
be from 530 to 1710 kHz. SSB radio systems used in the HF range
(2-30 MHz) must be within 50 Hz of channel frequency for acceptable
voice quality, and within 10 Hz for best results. Some digital modes
used in weak signal communication may require frequency stability of
less than 1 Hz within a period of several minutes. The carrier
frequency must be known to fractions of a hertz in some cases. An
ordinary quartz watch must have an oscillator accurate to better than
a few parts per million. One part per million will result in an error of
slightly less than one half second a day, which would be about 3
minutes a year. This might not sound like much, but an error of 10
parts per million would result in an error of about a half an hour per
year. A clock such as this would need resetting about once a month,

58
and more often if you are the punctual type. A programmed VCR with
a clock this far off could miss the recording of part of a TV show.
Narrow band SSB communications at VHF and UHF frequencies still
need 50 Hz frequency accuracy. At 440 MHz, this is slightly more
than 0.1 part per million.

7.5 CAPACITOR

A capacitor or condenser is a passive electronic component


consisting of a pair of conductors separated by a dielectric (insulator).
When a potential difference (voltage) exists across the conductors,
an electric field is present in the dielectric. This field stores energy
and produces a mechanical force between the conductors. The effect
is greatest when there is a narrow separation between large areas of
conductor, hence capacitor conductors are often called plates.

An ideal capacitor is characterized by a single constant value,


capacitance, which is measured in farads. This is the ratio of the
electric charge on each conductor to the potential difference between
them. In practice, the dielectric between the plates passes a small
amount of leakage current. The conductors and leads introduce an
equivalent series resistance and the dielectric has an electric field
strength limit resulting in a breakdown voltage.

Capacitors are widely used in electronic circuits to block the flow of


direct current while allowing alternating current to pass, to filter out
interference, to smooth the output of power supplies, and for many
other purposes. They are used in resonant circuits in radio frequency
equipment to select particular frequencies from a signal with many
frequencies.

Figure 7.9 Theory of Operation


59
DC circuits

Figure 7.10 DC circuits

7.6 RESISTOR

Resistors are used to limit the value of current in a circuit. Resistors


offer opposition to the flow of current. They are expressed in ohms for
which the symbol is ‘’. Resistors are broadly classified as
(1) Fixed Resistors
(2) Variable Resistors

Fixed Resistors

The most common of low wattage, fixed type resistors is the molded-
carbon composition resistor. The resistive material is of carbon clay
composition. The leads are made of tinned copper. Resistors of this
type are readily available in value ranging from few ohms to about
20M, having a tolerance range of 5 to 20%. They are quite
inexpensive. The relative size of all fixed resistors changes with the
wattage rating.
Another variety of carbon composition resistors is the
metalized type. It is made by deposition a homogeneous film of pure
carbon over a glass, ceramic or other insulating core. This type of
film-resistor is sometimes called the precision type, since it can be
obtained with an accuracy of 1%.

Lead Tinned Copper Material

Colour Coding Molded Carbon Clay Composition

60
VARIABLE RESISTOR

In electronic circuits, sometimes it becomes necessary to adjust the


values of currents and voltages. For n example it is often desired to
change the volume of sound, the brightness of a television picture
etc. Such adjustments can be done by using variable resistors.
Although the variable resistors are usually called rheostats
in other applications, the smaller variable resistors commonly
used in electronic circuits are called potentiometers.

7.7 TRANSISTORS

A transistor is an active device. It consists of two PN junctions


formed by sandwiching either p-type or n-type semiconductor
between a pair of opposite types.

There are two types of transistor:


1. n-p-n transistor
2. p-n-p transistor

Figure 7.11 n-p-n transistor & p-n-p transistor

An n-p-n transistor is composed of two n-type semiconductors


separated by a thin section of p-type. However a p-n-p type
semiconductor is formed by two p-sections separated by a thin
section of n-type Transistor has two pn junctions one junction is
forward biased and other is reversed biased. The forward junction
has a low resistance path whereas a reverse biased junction has a
high resistance path. The weak signal is introduced in the low
resistance circuit and output is taken from the high resistance circuit.
Therefore a transistor transfers a signal from a low resistance to high
resistance.
61
Transistor has three sections of doped semiconductors. The section
on one side is emitter and section on the opposite side is collector.
The middle section is base.

Emitter : The section on one side that supplies charge carriers is


called emitter. The emitter is always forward biased w.r.t. base.

Collector : The section on the other side that collects the charge is
called collector. The collector is always reversed biased.

Base : The middle section which forms two pn-junctions between the
emitter and collector is called base.

7.8 Buzzer

It is an electronic signaling device which produces buzzing sound. It


is commonly used in automobiles, phone alarm systems and
household appliances. Buzzers work in the same manner as an alarm
works. They are generally equipped with sensors or switches
connected to a control unit and the control unit illuminates a light on
the appropriate button or control panel, and sound a warning in the
form of a continuous or intermittent buzzing or beeping sound.

Magnetic Buzzers

Magnetic buzzers are magnetic audible signal devices with built-in


oscillating circuits. The construction combines an oscillation circuit

62
unit with a detection coil, a drive coil and a magnetic transducer.
Transistors, resistors, diodes and other small devices act as circuit
devices for driving sound generators. With the application of voltage,
current flows to the drive coil on primary side and to the detection coil
on the secondary side.

Circuit of buzzer

7.9 DIODE

ACTIVE COMPONENT
Active component are those component for not any other component
are used its operation. I used in this project only function diode, these
component description are described as bellow.
SEMICONDUCTOR DIODE
A PN junctions is known as a semiconductor or crystal diode. A
crystal diode has two terminal when it is connected in a circuit one
thing is decide is weather a diode is forward or reversed biased.
There is a easy rule to ascertain it. If the external CKT is trying to
push the conventional current in the direction of error, the diode is
forward biased. One the other hand if the conventional current is
trying is trying to flow opposite the error head, the diode is reversed
biased putting in simple words.

63
1. If arrowhead of diode symbol is positive W.R.T Bar of the symbol,
the diode is forward biased.
2. The arrowhead of diode symbol is negative W.R.T bar , the diode
is the reverse bias.

64
CHAPTER 8

CONCLUSION

The project was completed successfully in the given time


duration. It was learning experience through which we gained
invaluable on-hand practical knowledge. Our project enlightened
us with the vastness and unique application of micro controller,
which forms the basic framework of our project.
This project gave us the deep understanding of the controller and
described us how to use the controller in different ways. This is
embedded based project as embedded is the combination of both
the software as well as the hardware so this system helped us to
clear all our doubts related to basic electronic components.

65
8.0 APPLICATION

 Automatic braking.
 Automatic deeper.
 Automatic wiper.
 Automatic path finder
 Engine Heat sensing

8.1 FEATURES

• Small sensitivity to alcohol, smoke


• Fast response (app. 1-2 secs.)
• Wide detection range
• Stable performance and long life
• Simple drive circuit
• Sensitivity to alcohol

66
8.2 FUTURE SCOPE

 Automatic run automobile.


 Accident free on-road vehicles.
 In day light sensing automobile.

67
8.3RESUT

WITH THE ASSEMBLING OF ALL HARDWARE COMPONENTS


TOGETHER ALONG WITH SOFTWARE INVOLVED ALONG WITH
SOFTEWARE INVOLVED. AUTOMATIC CAR PROJECT IS
COMPLITED.
HADWARE & SOFTWARE WORKING WITH GOOD EASE AND
EFFICIENCY.

68
8.4 PHYSICAL HARDWARE VIEW OF THE GIVEN PROJECT

TOP VIEW

FRONT VIEW

69
ANNEXURE 1

DATA SHEET COMPONENTS

70
ANNEXURE 2

PCB LAYOUT

71
References:

Webisite link:

Online Available @:

WIKIPEDIA.ORG

[1].(http://www.mikroe.com/chapters/view/65/ chapter-2-8051)

[2].microcontroller-architecture/

(http://en.wikipedia.org/wiki/Voltage_regulator)

[3].Connecting a photoresistor to a circuit


(http://www.acroname.com/howto/photoresistor/photoresistor.ht

ml)

[4].Connecting a photoresistor to a circuit


(http://www.acroname.com/howto/photoresistor/photoresistor.ht

ml)

BOOK:

[5].Diffenderfes, Robert (2005). Electronic Devices: System and

Applications. New Delhi: Delimar. p. 480. ISBN 978-1401835149.


72
[6]. D.H. Stedman and G.A. Bishoop, "An Analysis of On-Road

Remote Sensing as a Tool for Automobile Emissions

Control," University of Denver, March 1990. Quoted in Austin

and Herigs

[7]. "Safety Presentation". Toyota.Co.Jp. Retrieved 2009-12-08.

[8]. "Honda Develops World’s First Intelligent Night Vision


System Able to Detect Pedestrians and Provide Driver
Cautions" (Press release). World.honda.com. 2004-08-24.
Retrieved 2009-12-08.

[9]. Romans, Brent (1999-01-01). "Full Test: 2000 Cadillac DeVille


DTS". Edmunds.com. Retrieved 2009-12-08.

[10]."BMW Night Vision Available in the 5 and 6 Series as of


March". Worldcarfans.com. 2006-01-30. Retrieved 2009-12-08.

[11]."Suppliers to the new SEAT Leon". Automotive News.


AutoNews.com. 25 July 2005. Retrieved 1 December 2011

[12]. "DfT Research: A Study of Accidents Involving Bull Bar


Equipped Vehicles". Rmd.dft.gov.uk. 2001-04-01. Retrieved 2011-
11-13.

[13]."Turkey Ministry of Economics, Turkish Exporters


Assembly, Automotive Exporters Assembly" partners of the
project contest.17–18 May 2012, Halic Congress
Center,http://www.uib.org.tr/tr/aktuel-uibden-haberler-otomotiv-
proje-pazari-ve-tasarim-yarismasinda-gelecegin-otomobillerini-
yaratacak-fikirler-yaristi-oduller-turkiyenin-dort-yanina-
dagildi.html

73
[14]. howstuffworks.com: How Pre-Collision Systems Work.
Types of Pre-collision
Systems. http://auto.howstuffworks.com/car-driving-
safety/safety-regulatory-devices/pre-collision-systems2.htm

[15]. mydigitallife.com: Toyota Develops Automatic Brake


System Assisted by GPS Technology for Safety
Driving. http://www.mydigitallife.info/2008/02/13/toyota-
develops-automatic-brake-system-assisted-by-gps-technology-
for-safety-driving/

[16] Boithias, L., radio wave propagation, McGraw-Hill Inc., New


York, 1987.
[17] Field, J. C. G. “The Design of automatic gain control
Systems for auto tracking radar receivers.” IEE Proc., Pt. C,
105(march 1958), pp.108.
[18] Waters, W. M., and B. R. Jarrett. “Bandpass Signal Sampling
And Coherent Detection.” IEEE Trans. AES-18 (November
1982), pp. 731-736

74

You might also like