Professional Documents
Culture Documents
ABSTRACT
This project deals with the control of traffic for an ambulance, it analyses the
number of vehicles passing in every track in order to the intelligent for existing
traffic light controller and through GSM it sends message to the user. In the present,
it is seen that lot of time is getting wasted due to fixed time limit which is flexible in
lanes with more traffic density and also it is problem for emergency cases like
ambulance. Due to wastage of time there may be loss. Now by this project we can
save time of the people by continuously monitoring the vehicles passing on the
road. This monitoring is done thought 24 hours in a timeslot of 15 to 30 s after
every time slot.
Microcontroller : AT89c52
Crystal : 11.0592MHz
1
2
CONTENTS
Chapters
1. Introduction
2. Overview Embedded Systems
2.1 What Is System?
2.2 Embedded System
2.3 Life Cycle
2.4 Software Design and Working of Embedded Systems
3. Block diagram and its brief description
3.1 Block Diagrams
3.2 Circuit description
3.3IC’s
3.31 AT 89c52
3.32 ULN 2008
3.33 555 Timer
3.4 Infrared led’s
3.5 Power supply description
3.6 Transistors
3.7 Resistors & Capacitor
4. Software Description and Project Code
4.1 Software Description
4.2 Project Code
5.Advantages & Limitations
6. Applications
2
3
Introduction
This project deals with the control of traffic for an ambulance, it analyses the
number of vehicles passing in every track in order to the intelligent for existing
traffic light controller and sending message to the user. In the present, it is seen that
lot of time is getting wasted due to fixed time limit which is flexible in lanes with
more traffic density and also it is problem for emergency cases like ambulance. Due
to wastage of time there may be loss. Now by this project we can save time of the
people by continuously monitoring the vehicles passing on the road. This
monitoring is done thought 24 hours in a timeslot of 15 to 30 s after every time slot.
traffic controller.
Microcontroller : AT89c52
Crystal : 11.0592MHz
3
4
System Constituents
To A Device That Is Not A Computer, And Meant For Doing Specific Computing
Tasks”.
4
5
Micro-Processor:
The Cpu Is A Unit That Centrally Fetches And Processes A Set Of General
Purpose Instructions. The Cpu Instruction Set Includes Instructions For Data
Transfer Operations, Alu Operations, Stack Operations, I/P &O/P Operations And
Program Control Sequencing And Supervising Operations. Any Cpu Must Process
The Following Basic Functionality Units:
2. An Alu For The Arithmetic And Logic Operations On The Bytes Or Words. It
May Be Capable Of Processing 8,16,32or 64-Bit Words At An Instant.
5
6
3. A Microprocessor Is A Single Vlsi Chip That Has A Chip And May Also Have
Some Other Units That Are Additionally Present And That Result In Faster
Processing Of Instructions.
Microcontroller:
A Microcontroller Is A Single Chip Vlsi Unit (Also Called Microcomputer)
Which Though Having Limited Computational Capabilities Posses An Enhanced
I/P, O/P Capabilities And A Number Of On-Chip Functional Units Micro-
Controllers Are Particularly Suited For Use In Embedded Systems For Real Time
Applications With On-Chip Program Memory And Devices.
Analysis:
Analyze the Requirements and Finalise the System Requirements
Design:
6
7
Hardware :
Proteus
Software
Implementation:
Based On The Hardware Design Make The Layout Of The Pcb And Design The
Routing
Get The Pcb Fabricated
Mount The Components On To The Pcb
Programming:
Use The Designated Tools For Programming The Microcontroller Or Processor
Whichever Is Selected
Atmel
Kiel ‘C’- Compiler
Uc Flash Programmer
Microchip :
Mplab Ide
Icd2
Atmel
GSM
Jtag / Flash Programmer
Testing/Debugging:
Hardware Debugging
Software Debugging
Functionality Test
7
8
Packaging/Implementation
Mount The Module Into The Designed Enclosure
Install The Designed System In The Required Application Area
The Essence
An Embedded
System Is A
8
9
9
10
Each Io Device Once Per Loop, And Storing The Result So The Logic Acts On
Consistent Values.
3.1BLOCK DIAGRAM
BLOCK DIAGRAM FOR TRAFFIC CONTROLLER By
AMBULANCE
10
11
3.2Circuitdiagrams
3.2.1 Power Supply Circuit:
11
12
3.2.3 IR Tx CKT
3.2.4 IR Rx CKT
12
13
3.2.5 WORKING:
The working of the circuit mainly comprises of four sections. They are:
1. Power Supply Circuit
2. Control Circuit
3. IR Transmitter
4. IR Receiver
1. Regulated Power Supply:
The power supply circuit comprises of a Transformer, Rectifier,
Filter (Smoothing) & Regulator.
• The Transformer used is a 12v, 1A step-down transformer which is used for
reducing the single phase AC supply of 230v to 12v. This is done so because the
rectifier which we are using cannot withstand for such high currents and voltages.
• The Rectifier comprises of four diodes which is called as full wave bridge
rectifier. A rectifier is a device, which consists of diodes, is used for converting
alternating current into direct current.
• The filter section comprises of a Capacitor which is used for reducing the
harmonics/ripple content present if any in the circuit after rectification process. This
is done so because the output of rectifier is pulsating DC.
• A voltage regulator is an electrical regulator designed to automatically
maintain a constant voltage level.
2. Control Circuit:
• The control circuit comprises of a microcontroller, relay driver and LED’s, max232
and GSM. The microcontroller is the heart of the circuit. This takes the inputs and
gives the respective output according to the command given to it.
• The input from the controller comes from IR receiver circuit. According to the
input the controller activates the relays through relay driver. And hence for the
information to be given to the person/ambulance is done by making automatically
ON of Lights and sending a message to the respective person about the intensity of
traffic through GSM.
13
14
• The message is sent through GSM via serial communication i.e.;max232. This
follows a protocol called as RS232 through which serial communication between
devices is done. Accordingly as per the intensity of the traffic on respective side ,
the GSM modem sends a message to the user.
• When the ambulance is arriving at a signal, the green light is given automatically
through the communication between IR transmitter and IR receiver. When the
communication between IR transmitter and receiver is going on then there will be
green signal given automatically as the transmitter circuit is connected to the
microcontroller.
3. IR Transmitter:
• The supply to the transmitter is given through a 9v battery.
• The transmitter circuit consists of 555 timer and IR transmitter.
• The IR transmitter continuously transmits the rays.
• The 555 timer will be astable mode of operation.
4. IR Receiver:
• The supply to the transmitter is given through a 9v battery.
• The receiver circuit consists of 555 timer and IR receiver.
• The IR receiver continuously checks out for the IR transmitter rays.
• The 555 timer will be monostable mode of operation.
• When these rays are detected by the IR receiver, then the signal is passed
to microcontroller and then the controller makes the necessary action to
be taken i.e., it will make green lights ON and leaves the traffic of that
particular side where ambulance is present.
3.31MICRO CONTROLLERS(AT89c52)
14
15
• Addressing modes provide access to large arrays of data using pointers and
offsets.
• They have instructions to set and clear individual bits and perform bit operations.
• They have instructions for input/output operations, event timing, enabling and
setting priority levels for interrupts caused by external stimuli.
15
16
The 8052 microcontroller is the 8051's "big brother." It is a slightly more powerful
microcontroller, sporting a number of additional features which the developer may
make use of:
AT89S52:
Features:
16
17
17
18
18
19
19
20
Port : 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. 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 pull-ups and
can be used as inputs. Port 2 emits the high-order address byte during
fetches from external program memory and during accesses to external
data memory that use 16-bit addresses (MOVX @DPTR). In this
application, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that use 8-bit addresses
(MOVX @ RI), Port 2emits 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 bi-directional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are writt 1s are written to
Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 3 pins that are externally being pulled low will source current (IIL)
because of the pull-ups. Port 3 also serves the functions of various special features
of the AT89S52, as shown in the following table.
Port 3 also receives some control signals for Flash programming
And verification.
RST Reset input. A high on this pin for two machine cycles while
the oscillator is running resets the device.
ALE/PROG
20
21
Address Latch Enable (ALE) is an output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program pulse
input (PROG) during Flash programming. In normal operation, ALE is emitted
at a constant rate of1/6 the oscillator frequency and may be used for external
timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external data Memory. If desired, ALE operation can be
disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-
disable bit has no effect if the micro controller is in external execution
mode.
PSEN :
Program Store Enable (PSEN) is the read strobe to external progra
m memory. When the AT89S52 is executing code from external
program memory, PSEN is activated twice each machine cycle, except
that two PSEN activations are skipped during each access to external
data memory.
EA/VPP :
External Access Enable. EA must be strapped to GND in order to
enable the device to fetch code from external program memory
locations starting at 0000H up to FFFFH.Note, however, that if lock bit
1 is programmed, EA will be internally latched on reset. A should be
strapped to VCC for internal program executions. This pin also receives
the 12-voltProgramming enables voltage (VPP) during Flash
programming.
XTAL1 :
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
21
22
22
23
The “R” registers: The “R” registers are a set of eight registers that
are named R0, R1. Etc up to R7. These registers are used as auxiliary
registers in many operations.
The “B” registers: The “B” register is very similar to the
accumulator in the sense that it may hold an 8-bit (1-byte) value. Two
only uses the “B” register 8051 instructions: MUL AB and DIV AB.
The Data Pointer: The Data pointer (DPTR) is the 8051’s only user
accessible 16-bit (2Bytes) register. The accumulator, “R” registers are
all 1-Byte values. DPTR, as the name suggests, is used to point to data.
It is used by a number of commands, which allow the 8051 to access
external memory.
THE PROGRAM COUNTER AND STACK POINTER:
The program counter (PC) is a 2-byte address, which tells
the 8051 where the next instruction to execute is found in memory. The
stack pointer like all registers except DPTR and PC may hold an 8-bit (1-
Byte) value
ADDRESSING MODES:
An “addressing mode” refers that you are addressing a given
memory location. In summary, the addressing modes are as follows,
with an example of each:
Each of these addressing modes provides important
flexibility.
Immediate Addressing MOV A, #20 H
Direct Addressing MOV A, 30 H
Indirect Addressing MOV A, @R0
Indexed Addressing
a. External Direct MOVX A, @DPTR
b. Code In direct MOVC A, @A+DPTR
23
24
Immediate Addressing:
Immediate addressing is so named because the value to
be stored in memory immediately follows the operation code in
memory. That is to say, the instruction itself dictates what value will be
stored in memory. For example, the instruction:
MOV A, #20H:
This instruction uses immediate Addressing because the
accumulator will be loaded with the value that immediately follows in
this case 20(hexadecimal). Immediate addressing is very fast since the
value to be loaded is included in the instruction. However, since the
value to be loaded is fixed at compile-time it is not very flexible.
Direct Addressing:
Direct addressing is so named because the value to be
stored in memory is obtained by directly retrieving it from another
memory location.
For example:
MOV A, 30h
This instruction will read the data out of internal RAM address
30(hexadecimal) and store it in the Accumulator. Direct addressing is
generally fast since, although the value to be loaded isn’t included in the
instruction, it is quickly accessible since it is stored in the 8051’s
internal RAM. It is also much more flexible than Immediate Addressing
since the value to be loaded is whatever is found at the given address
which may variable.
Indirect Addressing:
Indirect addressing is a very powerful addressing mode, which
in many cases provides an exceptional level of flexibility. Indirect
24
25
addressing is also the only way to access the extra 128 bytes of internal
RAM found on the 8052. Indirect addressing appears as follows:
MOV A, @R0:
25
26
26
27
Article VII. 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 1-to-0 transition at its corresponding external input pin , T2 .When the
samples show a high in one cycle and a low in the next cycle, the count is
incremented . Since two machine cycles (24 Oscillator periods ) are required to
recognize 1-to-0 transition , the maximum count rate is 1 / 24 of the
oscillator frequency . To ensure that a given level is sampled at least once
before it changes , the level should be held for atleast one full machine
cycle .
Article VIII. Capture Mode
Article IX. 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 1-to-0
transition at external input T2EX also causes the current value in TH2
and TL2 to be captured into RCAP2H and RCAP2L , respectively
Article X. Auto-reload (Up or Down Counter)
Article XI. 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 . 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 . 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 . If EXEN2 = 1 , a 16-bit
27
28
28
29
29
30
30
31
3.32ULN 2803A
31
32
32
33
D1 -
Circuit Connections to be made
D3- Output
33
34
Now, let us see how we can set the 555 to work at the desired frequency by
selecting the right combination of resistances & capacitances. Using the convention
as in D1,
From circuit analysis & mathematics, it can be obtained that:
Frequency = 1.44/{(RA + 2RB) * C1}
Also, 555 can produce waves with duty cycle else than the 50 % cycle. The desired
duty cycle can be worked out by using the result:
Duty Cycle = (RA + RB) * 100/ (RA + 2RB)
where duty cycle= Ratio of time period when the output is 1 to the time
period when the output is 0
34
35
Introduction:
Technically known as "infrared radiation", infrared light is part of the
electromagnetic spectrum located just below the red portion of normal visible light
– the opposite end to ultraviolet. Although invisible, infrared follows the same
principles as regular light and can be reflected or pass through transparent objects,
such as glass. Infrared remote controls use this invisible light as a form of
communications between themselves and home theater equipment, all of which
have infrared receivers positioned on the front. Essentially, each time you press a
button on a remote, a small infrared diode at the front of the remote beams out
pulses of light at high speed to all of your equipment. When the equipment
recognizes the signal as its own, it responds to the command.
But much like a flashlight, infrared light can be focused or diffused, weak or
strong. The type and number of emitters can affect the possible angles and range
your remote control can be used from. Better remotes can be used up to thirty feet
away and from almost any angle, while poorer remotes must be aimed carefully at
the device being controlled.
The light our eyes see is but a small part of a broad spectrum of
electromagnetic radiation. On the immediate high energy side of the visible
spectrum lies the ultraviolet, and on the low energy side is the infrared. The portion
of the infrared region most useful for analysis of organic compounds is not
immediately adjacent to the visible spectrum, but is that having a wavelength range
from 2,500 to 16,000 nm, with a corresponding frequency range from 1.9*1013 to
1.2*1014 Hz.( From http://hyperphysics.phy-astr.gsu.edu/hbase/ems3.html : the
frequency of infrared ranges from 0.003 - 4 x 10 14 Hz or about 300 gigahertz to 400
terahertz.).
35
36
Infrared imaging is used extensively for both military and civilian purposes.
Military applications include target acquisition, surveillance, night vision, homing
and tracking. Non-military uses include thermal efficiency analysis, remote
temperature sensing, short-ranged wireless communication, spectroscopy, and
weather forecasting. Infrared astronomy uses sensor-equipped telescopes to
penetrate dusty regions of space, such as molecular clouds; detect cool objects such
as planets, and to view highly red-shifted objects from the early days of the universe
IR LED QED234:
FEATURES:
• Wave length is 940 nm
• Chip material =GaAs with AlGaAs window
• Package type: T-1 3/4 (5mm lens diameter)
• Matched Photo sensor: QSD122/123/124
• Medium Emission Angle, 40°
• High Output Power
• Package material and color: Clear, untainted, plastic
• Ideal for remote control applications
36
37
Emitter/Detector Alignment:
Good alignment of the emitter and detector is important for good operation,
especially if the gap is large. This can be done with a piece of string stretched
between and in line with LED and phototransistor. A length of dowel or stiff wire
could be used to set the alignment. Another method that can be used for longer
distances is a laser pointer shone through one of the mounting holes.
For best results the height of the "beam" should be at coupler height and at an
angle across the tracks. The emitter could also be mounted above the track with the
phototransistor placed between the rails in locations such as hidden yards. Placing
the emitter and detector at an angle would again be helpful.
37
38
Connecting Block
This is simply a place for all the parts to plug in or connect to. Connecting
blocks are usually classified based on the number of outputs (how many IR emitters
can connect to the block) Amplified connecting blocks can generally support more
outputs. All connecting blocks can support many IR receivers wired in parallel.
Connecting blocks are usually located near the equipment that is to be controlled,
along with the power supply and emitters. See our connecting blocks here.
38
39
Infrared Emitters
IR Emitters generally "stick" onto the front of the device you want to
control. Therefore you need one emitter for each device. "Dual" emitters
have two emitters and one plug, so they only take up one jack of the connecting
block. "Blink" emitters blink visibly as well as infrared, so they are easier to
troubleshoot. All emitters come with long cords and extra double-stick tape. "Blast"
style emitters, where one emitter blinks into several devices, are usually less reliable
but can be used when the environment is tightly controlled and
Applications:
• Infrared Filters
• Night vision
• Thermograph
• Other imaging
• Tracking
• Heating
• Communications
• Spectroscopy
• Meteorology
• Climatology
• Astronomy
• Art history
• Biological systems
• Photobiomodulation
39
40
• Health hazard
All early devices emitted low-intensity red light, but modern LEDs are available
across the visible, ultraviolet and infra red wavelengths, with very high brightness.
LEDs are based on the semiconductor diode. When the diode is forward biased
(switched on), electrons are able to recombine with holes and energy is released in
the form of light. This effect is called electroluminescence and the color of the light
is determined by the energy gap of the semiconductor. The LED is usually small in
area (less than 1 mm2) with integrated optical components to shape its radiation
pattern and assist in reflection.
LEDs present many advantages over traditional light sources including lower
energy consumption, longer lifetime, improved robustness, smaller size and faster
switching. However, they are relatively expensive and require more precise current
and heat management than traditional light sources.
Applications of LEDs are diverse. They are used as low-energy indicators but also
for replacements for traditional light sources in general lighting and automotive
lighting. The compact size of LEDs has allowed new text and video displays and
sensors to be developed, while their high switching rates are useful in
communications technology.
40
41
Flashing LEDs are used as attention seeking indicators without requiring external
electronics. Flashing LEDs resemble standard LEDs but they contain an integrated
multivibrator circuit inside which causes the LED to flash with a typical period of
one second. In diffused lens LEDs this is visible as a small black dot. Most flashing
LEDs emit light of a single color, but more sophisticated devices can flash between
multiple colors and even fade through a color sequence using RGB color mix
• Bi-color LEDs are actually two different LEDs in one case. It consists of
two dies connected to the same two leads but in opposite directions. Current
flow in one direction produces one color, and current in the opposite
direction produces the other color. Alternating the two colors with sufficient
frequency causes the appearance of a blended third color. For example, a
red/green LED operated in this fashion will color blend to produce a yellow
appearance.
• Tri-color LEDs are two LEDs in one case, but the two LEDs are connected
to separate leads so that the two LEDs can be controlled independently and
lit simultaneously. A three-lead arrangement is typical with one common
lead (anode or cathode).
41
42
• RGB LEDs contain red, green and blue emitters, generally using a four-wire
connection with one common lead (anode or cathode).
(b) Advantages
• Efficiency LEDs produce more light per watt than incandescent bulbs.
• Color: LEDs can emit light of an intended color without the use of color
filters that traditional lighting methods require. This is more efficient and
can lower initial costs.
• Size: LEDs can be very small (smaller than 2 mm2and are easily populated
onto printed circuit boards.
• On/Off time: LEDs light up very quickly. A typical red indicator LED will
achieve full brightness in microseconds. LEDs used in communications
devices can have even faster response times.
• Cycling: LEDs are ideal for use in applications that are subject to frequent
on-off cycling, unlike fluorescent lamps that burn out more quickly when
cycled frequently, or HID lamps that require a long time before restarting.
• Dimming: LEDs can very easily be dimmed either by Pulse-width
modulation or lowering the forward current.
• Cool light: In contrast to most light sources, LEDs radiate very little heat in
the form of IR that can cause damage to sensitive objects or fabrics. Wasted
energy is dispersed as heat through the base of the LED.
• Slow failure: LEDs mostly fail by dimming over time, rather than the
abrupt burn-out of incandescent bulbs.
• Lifetime: LEDs can have a relatively long useful life. One report estimates
35,000 to 50,000 hours of useful life, though time to complete failure may
be longer. Fluorescent tubes typically are rated at about 10,000 to 15,000
42
43
(c) Disadvantages
• High initial price: LEDs are currently more expensive, price per lumen, on
an initial capital cost basis, than most conventional lighting technologies.
The additional expense partially stems from the relatively low lumen output
and the drive circuitry and power supplies needed. However, when
considering the total cost of ownership (including energy and maintenance
costs), LEDs far surpass incandescent or halogen sources and begin to
threaten compact fluorescent lamps.
• Temperature dependence: LED performance largely depends on the
ambient temperature of the operating environment. Over-driving the LED in
high ambient temperatures may result in overheating of the LED package,
eventually leading to device failure. Adequate heat-sinking is required to
maintain long life. This is especially important when considering
automotive, medical, and military applications where the device must
operate over a large range of temperatures, and is required to have a low
failure rate.
• Voltage sensitivity: LEDs must be supplied with the voltage above the
threshold and a current below the rating. This can involve series resistors or
current-regulated power supplies.
• Light quality: Most cool-white LEDs have spectra that differ significantly
from a black body radiator like the sun or an incandescent light. The spike at
460 nm and dip at 500 nm can cause the color of objects to be perceived
differently under cool-white LED illumination than sunlight or incandescent
sources, due to metamerism, red surfaces being rendered particularly badly
43
44
44
45
Description :
45
46
Circuit Features:
46
47
• Block Diagram:
Circuit Diagram:
47
48
48
49
49
50
Vin IN OUT
78XX
Vout
GND
C1 C2
50
51
7805 +5
7806 +6 35V
7808 +8
7810 +10
7812 +12
7815 +15
7818 +18
7824 +24 40V
51
52
3.6 Transistors
Transistors amplify current, for
example they can be used to amplify the small output current
from a logic IC so that it can operate a lamp, relay or other
high current device. In many circuits a resistor is used to
convert the changing current to a changing voltage, so the
transistor is being used to
amplify voltage.
A transistor may be used as a switch (either fully on with maximum current, or fully
off with no current) and as an amplifier (always partly on). The amount of current
amplification is called the current gain, symbol hFE.
For further information please see the Transistor Circuits page.
Types of transistor
The leads are labelled base (B), collector (C) and emitter (E).
These terms refer to the internal operation of a transistor but they are not much help in understanding
how a transistor is used, so just treat them as labels!
Connecting
52
Transistors have three leads which must be connected the correct way round. Please
take care with this because a wrongly connected transistor may be damaged
instantly when you switch on.
If you are lucky the orientation of the transistor will be clear from the PCB or
stripboard layout diagram, otherwise you will need to refer to a supplier's catalogue
to identify the leads.
The drawings on the right show the leads for some of the most common case styles.
Please note that transistor lead diagrams show the view from below with the leads
towards you. This is the opposite of IC (chip) pin diagrams which show the view
from above.
Heat sinks :
Waste heat is produced in transistors due
to the current flowing through them. Heat sinks Heat sink
are needed for power transistors because they
pass large currents. If you find that a transistor is Photograph © Rapid Electronics
becoming too hot to touch it certainly needs a heat sink! The heat sink helps
to dissipate (remove) the heat by transferring it to the surrounding air.
Testing a transistor:
Transistors
can be damaged by
heat when soldering
or
by misuse in a circuit. If you
suspect that a transistor may
be damaged there are two
easy ways to test it:
• The base-emitter (BE) junction should behave like a diode and conduct one
way only.
• The base-collector (BC) junction should behave like a diode and conduct
one way only.
53
54
If the transistor is OK the LED should light when the switch is pressed and not light
when the switch is released.
To test a PNP transistor use the same circuit but reverse the LED and the supply
voltage.
Some multimeters have a 'transistor test' function which provides a known base
current and measures the collector current so as to display the transistor's DC
current gain hFE.
Transistor codes :
There are three main series of transistor codes used in the UK:
54
55
Choosing a transistor
Most projects will specify a particular transistor, but if necessary you can usually
substitute an equivalent transistor from the wide range available. The most
important properties to look for are the maximum collector current IC and the
current gain hFE. To make selection easier most suppliers group their transistors in
categories determined either by their typical use or maximum power rating.
To make a final choice you will need to consult the tables of technical data which
are normally provided in catalogues. They contain a great deal of useful information
but they can be difficult to understand if you are not familiar with the abbreviations
used. The table below shows the most important technical data for some popular
transistors, tables in catalogues and reference books will usually show additional
information but this is unlikely to be useful unless you are experienced. The
quantities shown in the table are explained below.
NPN transistors
Category
Case IC VCE hFE Ptot Possible
Code Structure (typical
style max. max. min. max. substitutes
use)
Audio, low
BC107 NPN TO18 100mA 45V 110 300mW power BC182 BC547
General
BC108C
BC108 NPN TO18 100mA 20V 110 300mW purpose, low BC183 BC548
power
General
BC108C NPN TO18 100mA 20V 420 600mW purpose, low
power
Audio (low
BC109 NPN TO18 200mA 20V 200 300mW noise), low BC184 BC549
power
General
BC107
BC182 NPN TO92C 100mA 50V 100 350mW purpose, low
BC182L
power
General
BC182L NPN TO92A 100mA 50V 100 350mW purpose, low BC107 BC182
power
Audio, low
BC547B NPN TO92C 100mA 45V 200 500mW power BC107B
General
BC548B NPN TO92C 100mA 30V 220 500mW purpose, low BC108B
power
Audio (low
BC549B NPN TO92C 100mA 30V 240 625mW noise), low BC109
power
2N3053 NPN TO39 700mA 40V 50 500mW General BFY51
purpose, low
55
56
power
General
purpose,
BFY51 NPN TO39 1A 30V 40 800mW medium
BC639
power
General
purpose,
BC639 NPN TO92A 1A 80V 40 800mW medium
BFY51
power
General
TIP29A NPN TO220 1A 60V 40 30W purpose, high
power
General
TIP31C
TIP31A NPN TO220 3A 60V 10 40W purpose, high
TIP41A
power
General
TIP31A
TIP31C NPN TO220 3A 100V 10 40W purpose, high
TIP41A
power
General
TIP41A NPN TO220 6A 60V 15 65W purpose, high
power
General
2N3055 NPN TO3 15A 60V 20 117W purpose, high
power
Please note: the data in this table was compiled from several sources which are not entirely consistent!
Most of the discrepancies are minor, but please consult information from your supplier if you require
precise data.
PNP transistors
Category
Case IC VCE hFE Ptot Possible
Code Structure (typical
style max. max. min. max. substitutes
use)
Audio, low
BC177 PNP TO18 100mA 45V 125 300mW power BC477
General
BC178 PNP TO18 200mA 25V 120 600mW purpose, low BC478
power
Audio (low
BC179 PNP TO18 200mA 20V 180 600mW noise), low
power
Audio, low
BC477 PNP TO18 150mA 80V 125 360mW power BC177
General
BC478 PNP TO18 150mA 40V 125 360mW purpose, low BC178
power
General
TIP32A PNP TO220 3A 60V 25 40W purpose, high TIP32C
power
General
TIP32C PNP TO220 3A 100V 10 40W purpose, high TIP32A
power
Please note: the data in this table was compiled from several sources which are not entirely consistent!
Most of the discrepancies are minor, but please consult information from your supplier if you require
56
57
precise data.
Structure This shows the type of transistor, NPN or PNP. The polarities of the two
types are different, so if you are looking for a substitute it must be the
same type.
Case style There is a diagram showing the leads for some of the most common
case styles in the Connecting section above. This information is also
available in suppliers' catalogues.
IC max. Maximum collector current.
VCE max. Maximum voltage across the collector-emitter junction.
You can ignore this rating in low voltage circuits.
hFE This is the current gain (strictly the DC current gain). The guaranteed
minimum value is given because the actual value varies from transistor
to transistor - even for those of the same type! Note that current gain is
just a number so it has no units.
The gain is often quoted at a particular collector current IC which is usually in the
middle of the transistor's range, for example '100@20mA' means the gain is at least
100 at 20mA. Sometimes minimum and maximum values are given. Since the gain is
roughly constant for various currents but it varies from transistor to transistor this
detail is only really of interest to experts.
Why hFE? It is one of a whole series of parameters for transistors, each with their own
symbol. There are too many to explain here.
Ptot max. Maximum total power which can be developed in the transistor, note
that a heat sink will be required to achieve the maximum rating. This
rating is important for transistors operating as amplifiers, the power is
roughly IC × VCE. For transistors operating as switches the maximum
collector current (IC max.) is more important.
3.7Resistors& Capacitors
Resistors:
57
58
There are two classes of resistors; fixed resistors and the variable resistors. They
are also classified according to the material from which they are made. The typical
resistor is made of either carbon film or metal film. There are other types as well,
but these are the most common.
The resistance value of the resistor is not the only thing to consider when selecting a
resistor for use in a circuit. The "tolerance" and the electric power ratings of the
resistor are also important.
The tolerance of a resistor denotes how close it is to the actual rated resistence
value. For example, a ±5% tolerance would indicate a resistor that is within ±5% of
the specified resistance value.
The power rating indicates how much power the resistor can safely tolerate. Just
like you wouldn't use a 6 volt flashlight lamp to replace a burned out light in your
house, you wouldn't use a 1/8 watt resistor when you should be using a 1/2 watt
resistor.
58
59
59
60
Now that tolerances were in the sub-percent region, another factor had to be
accounted for, namely temperature coefficient. Well, why not just throw in yet
another color band? Good idea. Here it is.
There are also other uses of the sixth color band, for instance quality codes. These
are, however, not well standardized and are therefore not part of the color code
calculator.
Capacitor
Electronic capacitors are one of the most widely
used electronic components. These electronic capacitors only
allow alternating or changing signals to pass through them,
and as a result they find applications in many different areas of electronic circuit
design. There are a wide variety of types of capacitor including electrolytic,
ceramic, tantalum, plastic, sliver mica, and many more. Each capacitor type has its
own advantages and disadvantages can be used in different applications.
The choice of the correct capacitor type can have a major impact on any circuit. The
differences between the different types of capacitor can mean that the circuit may
not work correctly if the correct type of capacitor is not used. Accordingly a
summary of the different types of capacitor is given below, and further descriptions
of a variety of capacitor types can be reached through the related articles menu on
the left hand side of the page below the main menu.
60
61
61
62
62
63
63
64
15. Click on the file option from menu bar and select “new”
16. The next screen will be as shown in next page, and just maximize it by
double clicking on its blue boarder.
64
65
19. Now right click on Source group 1 and click on “Add files to Group
Source”
65
66
20. Now you will get another window, on which by default “C” files will
appear.
21. Now select as per your file extension given while saving the file
22. Click only one time on option “ADD”
23. Now Press function key F7 to compile. Any error will appear if so
happen.
66
67
67
68
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key “F11” slowly and observe.
You are running your program successfully
68
69
org 0000h
ljmp main ;main program
ORG 000BH
ljmp timer_0
org 0030h
main:
clr ie.7
mov a,#00h
mov p0,a ;data to ports=0
mov p1,a
mov p2,a
setb p3.7
setb p3.6
setb p3.5
setb p3.4
acall delay
clr p1.0 ;R1 LED OFF
setb p1.2 ;G1 LED ON
setb 00
clr 01
clr 02
clr 03
clr 04
69
70
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIN PROGRAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
loop_inf:
jb p3.7,next1
setb 00
setb 04
clr 01
clr 02
clr 03
sjmp next_out
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
next1:
jb p3.6,next2
setb 01
setb 04
clr 00
clr 02
clr 03
sjmp next_out
;;;;;;;;;;;;;;;;;;;;;;;;;;;
next2:
jb p3.5,next3
setb 02
setb 04
clr 00
clr 01
clr 03
sjmp next_out
;;;;;;;;;;;;;;;;;;;;;;;;;;;
next3:
jb p3.4,next_out
setb 03
setb 04
clr 00
clr 01
clr 02
sjmp next_out
;;;;;;;;;;;;;;;;;;;;;;;;;;
next_out:
clr 04
sjmp loop_inf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;timer 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
timer_0:
clr tr0
CLR IE.7
jb 04,out_siren
INC 50h
mov a,50h
70
71
CJNE a,#02H,OUT_ID
MOV 50h,#00h
out_siren:
jb 00,first
jb 01,second
jb 02,third
jb 03,fourth
ljmp OUT_ID
;;;;;;;;;;;;;;
first:
clr p1.2 ;G1 LED off
setb p1.1 ;Y1 LED ON
acall delay
clr p1.1
setb p1.0 ;R1 LED ON
71
72
OUT_ID:
mov th0,#00h
mov tl0,#01h
mov ie,#10000011b
SETB TR0
RETI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Advantages
72
73
LIMITATIONS
COST
BANDWIDTH
EFFICIENCY COST
COMPLEXITY
73
74
Applications
Ambulance
VIPs vehicles
74
75
CONCLUSION
Navigation” has been successfully designed and tested. Integrating features of all
the hardware components used have developed it. Presence of every module has
been reasoned out and placed carefully thus contributing to the best working of the
unit.
Secondly, using highly advanced IC’s and with the help of growing technology the
project has been successfully implemented.
75
76
FUTURE SCOPE
This system is a rapidly growing field and there are new and improved
strategies popping up all the time. For the most part these systems are all built
around the same basic structure, a central box that monitors several detectors and
perimeter guards and sounds an alarm when any of them are triggered.
center the points where an intruder would enter the building. In this system IR
sensor is used to detect the intrusion. Similarly the vibration and temperature
Incorporating the features discussed below can further enhance the system
1. This system can detect intrusion only at discrete points. This system
intrusion into the building can be detected with much more efficiently.
2. The redialing feature can also be incorporated such that if the call is
not put forward the first time, the auto dialer will dial the same number
76
77
BIBLIOGRAPHY
3..www.howsstuffworks.com
4. www.alldatasheets.com
5. www.electronicsforu.com
6. www.knowledgebase.com
7.www.8051 projectsinfo.com
77