INTRODUCTION
1.1.
AIM
Safety of human life while travelling in car by adding enhancements
1.2.
INTRODUCTION:
Now a days increasing of transportation system in daily life has made
tremendous changes in security of travelling. Travelling in the night time is a difficult job
as the in-proper lighting system on highway lines, roads. If the vehicle travelling in
congested type of roads (Like small town road), accident may occur due to insufficient
lighting system. This project aims in safe guarding the life, prevention of accidents and to
safe guard the human life. So the project name has titled as AUTOMATION OF CAR
ADD ON FEATURES. The microcontroller scans the position of the car doors. If any
door is not locked properly, the microcontroller senses and displays the particular door is
not locked properly. This helps a lot for safe journey.
This project is facilitated with automatic dim and dip, depending on the light
intensity of the opposite vehicle, the car light will be go lower beam, once the vehicle
passes it automatically goes to higher beam.
The technical aspects will be discussed in detail in the later chapters.
1.3.
BLOCK DIAGRAM
DOOR
SENSORS
16X2 LCD
AT
R.P.S
89S52
CRYSTAL
HIGH
HIGH BEAM
BEAM
LIGHTS
LIGHTS
LDR
AMPLIFIE
R CIRCUIT
SPDT
RELAY
LOW
LOW BEAM
BEAM
LIGHTS
LIGHTS
Fig2: Block Diagram of Dim & Dip of Car Light Control System
1.4.
1.4.1. LDR
The LDR senses the light intensity of the opposite vehicle and
makes the vehicle head lights to operate in lower beam and as
the vehicle passes, it automatically the light goes to high beam.
1.4.3. RELAY
It is an electromagnetic switch, with the help of relay contacts,
a low beam and high beam lights are operated.
1.5.
1.5.2. MICROCONTROLLER
In
this
project
AT 89s52
version
of
ATMEL
1.5.3. LCD
A 16x2 LCD (Liquid Crystal Display) is used to display
the different characters. It support alphanumeric and
punctuations. It can take 8 bit/ 4 bit of data from
Microcontroller to display the text. The data which it
has taken converts into ASCII code.
1.5.4. RPS
Regulated power supply gives constant and continues voltage. It takes house hold supply
voltage (230v) as input and converts into +9v, +6v, +5v using various converters.
1.5.5. CRYSTAL:
A quartz crystal provides clock pulses oscillations, hence it
is called Crystal Oscillator. Here 11.0592 MHz External
crystal oscillator is used to speed up the execution of
program.
CHAPTER 2
CIRCUIT DIAGRAMS
2.1.
2.2.
2.3.
2.4.
current starts flowing through it and provides base bias to the transistor T1. And the transistor
T1 goes to the saturation, then the current starts flowing through T1 and the voltage drop across
the resistor R2 provides the biasing to the switching transistor T2, as transistor T2 conducts and
energizes the Relays. The output is taken with the help of relay contacts, and applied to the high
beam and low beam lights.
When there is no vehicle coming opposite, the intensity of light decreases and the
resistances of LDR increases and therefore no biasing voltage to the transistor T1 and the
transistor T1 & T2 does not conduct and goes to saturation cutt-off region and the two Relays
will be de-energized. With the help of Relay contacts a dc voltage of 9V is provided to the high
beam light.
2.5.
2.6.
CIRCUIT
DIAGRAM
OF CAR
DOOR
SENSORS
WHEN ALL ARE CLOSED
2.7.
2.8.
WORKING PROCEDURE
The project is designed to identify the unlocked door of a car. It is developed with
embedded system platform. ATMEL microcontroller such as AT89s52 is interfaced with car
door sensors such as limiting switches. These switches acts input device and input data is
given to microcontroller. The limiting switches are connected to Port 1 (P1.0, P1.1, P1.2,
P1.3). All the switches are commonly connected to Vcc, hence when door is closed an active
low signal is fed to microcontroller. If door is unlocked properly, an active high signal
produced and is fed to microcontroller. When microcontroller receives active high signal
from a particular port pin say P1.0, microcontroller gives active high out to buzzer. So the
buzzer gives alarm which will alert the car driver. Simultaneously 4 bit of data is given to
LCD. The LCD converts the 4-bit as per ASCII code system and displays the representative
character.
The buzzer is interfaced with P1.7. LCD is interfaced with Port 2 as 4 bit mode of data bus.
CHAPTER III
EMBEDDED SYSTEMS
3.1 INTRODUCTION TO EMBEDDED SYSTEMS
Each day, our lives become more dependent on 'embedded systems', digital information
technology that is embedded in our environment. More than 98% of processors applied today are
in embedded systems, and are no longer visible to the customer as 'computers' in the ordinary
(or)
An embedded system is a special-purpose computer system designed to perform one or a
few dedicated functions, often with real-time computing constraints. It is usually embedded as
part of a complete device including hardware and mechanical parts. In contrast, a generalpurpose computer, such as a personal computer, can do many different tasks depending on
programming.
(or)
An embedded system is a single-purpose computer built into a larger system for the
purposes of controlling and monitoring the system. A specialized computer system that is part of
a larger system or machine.
There are many definitions of embedded system but all of these can be combined into a
single concept. An embedded system is a special purpose computer system that is used for
particular task.
Features of Embedded Systems
The versatility of the embedded computer system lends itself to utility in all kinds of
enterprises, from the simplification of deliverable products to a reduction in costs in their
development and manufacture. Complex systems with rich functionality employ special
operating systems that take into account major characteristics of embedded systems. Embedded
operating systems have minimized footprint and may follow real-time operating system
specifics.
The special computers system is usually less powerful than general-purpose systems,
although some expectations do exist where embedded systems are very powerful and
complicated. Usually a low power consumption CPU with a limited amount of memory is used
in embedded systems. Many embedded systems use very small operating systems; most of these
provide very limited operating system capabilities.
Since the embedded system is dedicated to specific tasks, design engineers can optimize
it, reducing the size and cost of the product, or increasing the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Some embedded systems have to operate in extreme environment conditions such as very
high temperature & humidity.
For high volume systems such as portable music players or mobile phones, minimizing
cost is usually the primary design consideration. Engineers typically select hardware that is just
good enough to implement the necessary functions.
For low volume or prototype embedded systems, general purpose computers may be
adapted by limiting the programs or by replacing the operating system with a real-time operating
system.
CHARACTERISTICS OF EMBEDDED SYSTEMS
Embedded computing systems generally exhibit rich functionalitycomplex functionality is
usually the reason for introducing cpus into the design. However, they also exhibit many nonfunctional requirements that make the task especially challenging:
Real-time deadlines that will cause system failure if not met;
Multi-rate operation;
In many cases, low power consumption;
Low manufacturing cost, which often means limited code size.
Workstation programmers often concentrate on functionality. They may consider the
performance characteristics of a few computational kernels of their software, but rarely analyze
the total application. They almost never consider power consumption and manufacturing cost.
The need to juggle all these requirements makes embedded system programming very
challenging and is the reason why embedded system designers need to understand computer
architecture.
Overview of an Embedded System Architecture
Application Software
Operating
System
H/W
The operating system runs above the hardware and the application software runs above
the operating system. The same architecture is applicable to any computer including desktop
computer. However these are significant differences. It is not compulsory to have an operating
system in every embedded system. For small applications such as remote control units, air
conditioners, toys etc.
Network equipment:
Critical systems:
Signal processing:
Robotics:
Computer peripherals:
Wireless systems:
Embedded pcs:
Command and control:
Home appliances, intercom, telephones, security systems, garage door openers, answering
machines, fax machines, home computers, tvs, cable tv tuner, vcr, camcorder, remote controls,
video games, cellular phones, musical instruments, sewing machines, lighting control, paging,
camera, pinball machines, toys, exercise equipment
Office telephones, computers, security systems, fax machines, microwave, copier, laser printer,
color printer, paging
Auto trip computer, engine control, air bag, abs, instrumentation, security system, transmission
control, entertainment, climate control, cellular phone, keyless entry
addition of external ram, rom, and i/o ports makes these systems bulkier and much more
expensive, they have the advantage of versatility such that the designer can decide on the amount
of ram, rom and i/o ports needed to fit the task at hand.
A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of RAM,
ROM, I/O ports, and a timer all on a single chip. In other words, the processor, the RAM, ROM,
I/O ports and the timer are all embedded together on one chip; therefore, the designer cannot add
any external memory, I/O ports, or timer to it. The fixed amount of on-chip ROM, RAM, and
number of I/O ports in Microcontrollers makes them ideal for many applications in which cost
and space are critical.
CPU platform:
Embedded processors can be broken into two distinct categories: microprocessors (P)
and microcontrollers (C). Microcontrollers have built-in peripherals on the chip, reducing size
of the system.
There are many different CPU architectures used in embedded designs such as ARM,
MIPS, Coldfire/68k, PowerPC, x86, PIC, 8051, Atmel AVR, Renesas H8, SH, V850, FR-V,
M32R, Z80, Z8, etc. This in contrast to the desktop computer market, which is currently limited
to just a few competing architectures.
PC/104 and PC/104+ are a typical base for small, low-volume embedded and ruggedized
system design. These often use DOS, Linux, NetBSD, or an embedded real-time operating
system such as QNX or VxWorks.
A common configuration for very-high-volume embedded systems is the system on a
chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was
purchased and added as part of the chip design. A related scheme is to use a field-programmable
gate array (FPGA), and program it with all the logic, including the CPU.
Embedded systems are based on the concept of the microcontroller, a single integrated
circuit that contains all the technology required to run an application. Microcontrollers make
integrated systems possible by combining several features together into what is effectively a
complete
computer
on
chip,
including:
*CentralProcessingUnit
*Input/Outputinterfaces(suchasserialports)
*Peripherals(suchastimers)
*ROM,EEPROM(or)Flashmemoryforprogramstorage
*RAMfordatastorage
*Clockgenerator
By integrating all of these features into a single chip it is possible to greatly reduce the
number of chips and wiring necessary to control an electronic device, dramatically reducing its
complexity, size and cost.
* Size & Weight: Microcontrollers are designed to deliver maximum performance for minimum
size and weight. A centralized on-board computer system would greatly outweigh a collection of
microcontrollers.
* Efficiency: Microcontrollers are designed to perform repeated functions for long periods of
time without failing or requiring service.
MICRO CONTROLLER: It is a chip through which we can connect many other devices and
also those are controlled by the program the program which burn into that chip
mcs-51
ZILOG---------Z
MOTROLLA
FREESCALE
ATMEL ------- AT89C51/52, AT89S51/52
PHILLIPS ----- P89C51RD2FN
Before these industries came into picture 8051 chips are made with cmos technology. Atmel was
introduced with isp (in system programming)
IN SYSTEM PROGRAMMING (ISP):IN-SYSTEM PROGRAMMING (ISP) is the ability of some programmable logic devices,
microcontrollers, and other programmable electronic chips to be programmed while installed in a
complete system, rather than requiring the chip to be programmed prior to installing it into the
system. (or) in-system programming is a valuable feature that allows system firmware to be
upgraded without disassembling the embedded system to physically replace memory. Most
maxim 8051-based microcontrollers can be reprogrammed from a pc or laptop via an
inexpensive rs-232 serial interface and a few logic gates
The primary advantage of this feature is that it allows manufacturers of electronic devices to
integrate programming and testing into a single production phase, rather than requiring a separate
programming stage prior to assembling the system. This may allow manufacturers to program
the chips in their own system's production line instead of buying preprogrammed chips from a
manufacturer or distributor, making it feasible to apply code or design changes in the middle of a
production run.
density nonvolatile memory technology and is compatible with the industry-standard 80c51
instruction set and pin out. The on-chip flash allows the program memory to be reprogrammed
in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit
cpu with in-system programmable flash on a monolithic chip, the atmel at89s52 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many embedded
control applications.
inputs. As inputs, port 1 pins that are externally being pulled low will source current because of
the internal pull ups.
Alternate Functions of Port 1 used for In system Programmable
P.5
P.6
P.7
Pin ( 21 28 ) Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull ups. Port 2
emits the high-order address byte during accesses to external memory that use 16-bit addresses.
In this application, it uses the strong internal pull ups when emitting 1s.
Pin (10 17) Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull ups. It also serves
the functions of various special features of the 80C51 Family as follows:
Port Pin Alternate Function
P3.0- RxD (serial input port)
P3.1 -TxD (serial output port)
P3.2 -INT0 (external interrupt 0)
P3.3- INT1 (external interrupt 1)
P3.4 -T0 (timer 0 external input)
P3.5 -T1 (timer 1 external input)
P3.6 -WR (external data memory write strobe)
P3.7 -RD (external data memory read strobe)
3.7. REGISTERS
8051 is a collection of 8 and 16 bit registers and 8 bit memory locations. These registers
and memory locations can be made to operate using the software instructions. The program
instructions control the registers and digital data paths that are contained inside the 8051, as well
as memory locations that are located outside the 8051.
Register are used to store information temporarily, while the information could be a byte
of data to be processed, or an address pointing to the data to be fetched. The vast majority of
8051 register are 8-bit registers.
Generally there are two types of registers. They are general purpose registers (gprs) and special
function registers (sfrs)
GENERAL PURPOSE REGISTER
The 8 bits of a register are shown from msb d7 to the lsb d0. With an 8-bit data type, any
data larger than 8 bits must be broken into 8-bit chunks before it is processed.
3.8. TIMER/COUNTERS
The atmel 80c51 microcontrollers implement two general purpose, 16-bit timers/
counters. They can be used either as timers to generate a time delay or as a counter to count
events happening outside the microcontroller. The microcontroller has two 16-bit wide timers.
They are identified as timer 0 and timer 1, and can be independently configured to operate in a
variety of modes as a timer or as an event counter. When operating as a timer, the timer/counter
runs for a programmed length of time, then issues an interrupt request. When operating as a
counter, the timer/counter counts negative transitions on an external pin. After a preset number of
counts, the counter issues an interrupt request. Register pairs (th0, tl0), (th1, tl1), and (th2, tl2)
are the 16-bit counting registers for timer/counters 0, 1, and 2, respectively.
TIMER 0 REGISTER
The 16-bit register of timer 0 is accessed as low byte and high byte. the low byte register
is called tl0 (timer 0 low byte) and high byte register is referred to as th0 (timer 0 high byte).
these registers can be accessed like any other register, such as A,B,R0,R1,R2,etc.
TIMER 1 REGISTER
Timer 1 is also 16-bits, and its 16-bit register is split into two bytes, referred to as TL1
( Timer 1 low byte ) and TH1 ( Timer 1 high byte ). These registers are accessible in the same
way as the registers of timer 0.
TMOD Register (timer mode)
TMOD: TIMER/COUNTER MODE CONTROL REGISTER.
NOT BIT ADDRESSABLE.
TIMER 1
GATE
TIMER 0
When TRx (in TCON) is set and GATE=1, Timer/CounterX will run only
while INTx pin is high (hardware control). When GATE=0, Timer/Counter
will run only while TRx=1 (software control).
C/T
Timer or counter selector. Cleared for timer operation (input from internal
system clock). Set for counter operation
M1
M0
M1
M0
MODE
OPERATING MODE
16-Bit Timer/Counter
TF1
TR1
TF0
overflows.
IE1
External interrupt 1 edge flag. Set by hardware when external interrupt edge is
detected. Cleared by hardware when interrupt is processed.
IT1
IE0
External interrupt 0 edge flag. set by hardware when external interrupt edge is
detected. Cleared by hardware when interrupt is processed.
IT0
In the asynchronous method is character is placed between start and stop bits, this is called data
framing. In asynchronous communication, at least two extra bits are transmitted with the data word;
a start bit and a stop bit. Therefore, if the transmitter is using an 8-bit system, the actual number of
bits transmitted per word is ten. In most protocols the start bit is a logic 0 while the stop bit is logic
1. Therefore, when no data is being sent the data line is continuously high. The receiver waits for a
1 to 0 transition. In other words, it awaits a transition from the stop bit (no data) to the start bit (logic
0). Once this transition occurs the receiver knows a data byte will follow. Since it knows the data
rate (because it is defined in the protocol) it uses the same clock as frequency as that used by the
transmitter and reads the correct number of bits and stores them in a register. For example, if the
protocol determines the word size as eight bits, once the receiver sees a start bit it reads the next
eight bits and places them in a buffer. Once the data word has been read the receiver checks to see if
the next bit is a stop bit, signifying the end of the data. If the next bit is not a logic 1 then something
went wrong with the transmission and the receiver dumps the data. If the stop bit was received the
receiver waits for the next data word, ie; it waits for a 1 to 0 transition.
11.0592
MHz
XTAL
oscillat
or
Machine
cycle
12 frequency
921.6
kHz
28800
Hz
Timer 1
To
timer
1
By UART
To set the
Baud rate
32
SBUF
SBUF is an 8-bit register used solely for serial communication in the 8051. For a byte of
data to be transferred via the txd line, it must be placed in the SBUF register. Similarly, SBUF
holds the byte of data when it is received by the 8051s rxd line. SBUF can be accessed like any
other register in the 8051.
The moment a byte is written into sbuf, it is framed with the start and stop bits and transferred
serially via the txd pin. Similarly, when the bits are received serially via rxd, the 8051 deframes
it by eliminating the stop and start bits, making a byte out of the data received, and then placing
it in the SBUF.
DATA TRANSMISSION: Transmission of serial data bits begins anytime data is written to sbuf. " TI " (SCON) set
to 1 when data has been transmitted and signifies that " SBUF " is empty and that another data
byte can be sent.
DATA RECEPTION: Reception of serial data will begin if the receive enable bit (ren) in scon is set to ' 1 ' for
all modes. For mode ' 0 ' only ri must be cleared to 0. Receiver interrupt flag ' ri ' (in scon) is set
after data has been received in all modes. Setting of ' ren ' bit is a direct program control that
limits the reception of unexpected data.
SM1
SM2
REN
TB8
RB8
TI
RI
Mode 0: Serial data enters and exits through RxD. TxD outputs the shift clock. 8 bits are
transmitted/received (LSB first). The baud rate is fixed at 1/12 the oscillator frequency.
Mode 1: 10 bits are transmitted (through txd) or received (through rxd): a start bit (0), 8 data bits
(lsb first), and a stop bit (1). On receive, the stop bit goes into rb8 in special function register
scon. The baud rate is variable.
Mode 2: 11 bits are transmitted (through txd) or received (through rxd): start bit (0), 8 data bits
(lsb first), a programmable 9th data bit, and a stop bit (1). On transmit, the 9th data bit (tb8 in
scon) can be assigned the value of 0 or 1. Or, for example, the parity bit (p, in the psw) could be
moved into tb8. On receive, the 9th data bit goes into rb8 in special function register scon, while
the stop bit is ignored. The baud rate is programmable to either 1/32 or 1/64 the oscillator
frequency.
Mode 3: 11 bits are transmitted (through txd) or received (through rxd): a start bit (0), 8 data bits
(lsb first), a programmable 9th data bit, and a stop bit (1). In fact, mode 3 is the same as mode 2
in all respects except baud rate. The baud rate in mode 3 is variable. In all four modes,
transmission is initiated by any instruction that uses sbuf as a destination register. Reception is
initiated in mode 0 by the condition ri = 0 and ren = 1. Reception is initiated in the other modes
by the incoming start bit if ren = 1.
SM2 enables the multiprocessor communication feature in modes 2 and 3. In mode 2 or 3, if sm2
is set to 1, then rl will not be activated if the received 9th data bit (rb8) is 0. In mode 1, if sm2=1
then ri will not be activated if a valid stop bit was not received. In mode 0, sm2 should be 0.
REN enables serial reception. Set by software to enable reception. Clear by software to disable
reception.
TB8 the 9th data bit that will be transmitted in modes 2 and 3. Set or clear by software as
desired.
RB8 in modes 2 and 3, is the 9th data bit that was received. In mode 1, it sm2=0, rb8 is the stop
bit that was received. In mode 0, rb8 is not used.
TI (Transmit Interrupt)
This is an extremely important flag bit in the scon register. When the 8051 finishes the transfer of
the 8-bit character it raises the ti flag to indicate that it is ready to transfer another byte. The ti bit
is raised at the beginning of the stop bit.
RI (Receive Interrupt)
This is an extremely important flag bit in the scon register. When the 8051 receives data
serially via rxd, it gets rid of the start and stop bits and places the byte in the sbuf register. Then it
raises the ri flag bit to indicate that a byte has been received and chould be picked up before it is
lost.
INTERRUPTS
An interrupt is a special feature which allows the 8051 to provide the illusion of "multitasking," although in reality the 8051 is only doing one thing at a time. The word "interrupt" can
often be substituted with the word "event."
An interrupt is triggered whenever a corresponding event occurs. When the event occurs,
the 8051 temporarily puts "on hold" the normal execution of the program and executes a special
section of code referred to as an interrupt handler. The interrupt handler performs whatever
special functions are required to handle the event and then returns control to the 8051 at which
point program execution continues as if it had never been interrupted.
-IE.7
ET2
ES
ET1
EX1
ET0
EX0
--
IE.6
ET2
IE.5
ES
IE.4
ET1
IE.3
EX1
IE.2
ET0
IE.1
EX0
IE.0
--
--
PT2
PS
PT1
PX1
--
IP.7
Reserved
--
IP.6
Reserved
PT2
IP.5
PS
IP.4
PT1
IP.3
PX1
IP.2
PT0
IP.1
PT0
PX0
PX0
IP.0
TRANSFORMER
Transformers convert ac electricity from one voltage to another with little loss of power.
transformers work only with ac and this is one of the reasons why mains electricity is ac. step-up
transformers increase voltage, step-down transformers reduce voltage.
A step down power transformer is used to step down the ac voltage from the line voltage
of 110 VAC or 220 VAC i.e, it converts higher voltage at the input side to a lower voltage at the
output.
RECTIFIER
There are several ways of connecting diodes to make a rectifier to convert ac to dc. The
bridge rectifier is the most important and it produces full-wave varying dc
BRIDGE RECTIFIER
Alternate pairs of diodes conduct, changing over (using all the ac wave) the connections so the
alternating directions of ac are converted to the one direction of dc.
FILTER
Filtering is performed by a large value electrolytic capacitor connected across the DC supply to
act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier
is falling. The diagram shows the unfiltered varying DC (dotted line) and the filtered DC (solid
line).
The capacitor charges quickly near the peak of the varying DC, and then discharges as it
supplies current to the output. Typically 1000 f capacitor is used
REGULATOR
This is a simple dc regulated supply project using 7805 voltage regulator to obtain a variable dc
voltage range from 5v to 15v
If you need other voltages than +5v, you can modify the circuit by replacing the 7805 chips with
another regulator with different output voltage from regulator 78xx chip family. the last numbers
in the the chip code tells the output voltage. remember that the input voltage must be at least 3v
greater than regulator output voltage ot otherwise the regulator does not work well.
7805 voltage regulator. this comprises the power supply for the entire circuit. vcc is connected to
pin 40 the power supply of microcontroller.
time
3.12. RESET
Reset is an active high input when reset is set to high, 8051 goes back to the power on state.the
8051 is reset by holding the rst high for at least two machine cycles and then returning it low.
initially charging of capacitor makes rst high, when capacitor charges fully it blocks dc.
SIP Resistor
Sip Resistor is a single in pack Resistor (i.e.,) 8 resistors connected in series. Basically SIP
resistor is a 9 pin connector first pin is for power supply to the entire 8 resistors in SIP.
Generally SIP Resistor is used to close the open drain connections of Port 0.
CHAPTER 4
HARDWARE IMPLEMENTATION
For many years the standard LDR has been the ORP12, now the NORPS12, which is about
13mm diameter. Miniature LDRs are also available and their diameter is about 5mm.
An LDR may be connected either way round and no special precautions are required when
soldering.
CIRCUIT SYMBOL
The animation opposite shows that when the torch is turned on, the resistance of the LDR falls,
allowing current to pass through it.
When the light level is low the resistance of the LDR is high. This prevents current from flowing
to the base of the transistors. Consequently the LED does not light.
However, when light shines onto the LDR its resistance falls and current flows into the base of
the first transistor and then the second transistor. The LED lights.
The preset resistor can be turned up or down to increase or decrease resistance, in this way it can
make the circuit more or less sensitive.
4.2. 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
Types of transistor
There are two types of standard transistors, NPN and PNP, with
different circuit symbols. The letters refer to the layers of
semiconductor material used to make the transistor. Most
transistors used today are NPN because this is the easiest type to
make from silicon. If you are new to electronics it is best to start
by learning how to use NPN transistors.
The
leads
are
labeled
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!
A Darlington pair is two transistors connected together to give a very high current gain.
In addition to standard (bipolar junction)
transistors,
there
are
field-effect
Connecting
Transistor leads for some common case styles.
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.
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.
VCE max.
Maximum
voltage
across
the
collector-emitter
junction.
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.
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 I C
VCE. For transistors operating as switches the maximum collector current
(IC max.) is more important.
Category
This shows the typical use for the transistor, it is a good starting point
when looking for a substitute. Catalogues may have separate tables for
different categories.
Possible substitutes These are transistors with similar electrical properties which will be
suitable substitutes in most circuits. However, they may have a different
case style so you will need to take care when placing them on the circuit
board.
4.3. RELAY
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 most have double throw (changeover) switch
contacts as shown in the diagram.
Relays allow one circuit to switch a second circuit which 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 circuits, 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 switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be obvious and it
may be connected either way round. Relay coils produce brief high voltage 'spikes' when they
are switched off and this can destroy transistors and ICs in the circuit. To prevent damage you
must connect a protection diode across the relay coil.
The animated picture shows a working relay with its coil and switch contacts. You can see a
lever on the left being attracted by magnetism when the coil is switched on. This lever moves the
switch contacts. There is one set of contacts (SPDT) in the foreground and another behind them,
making the relay DPDT.
SPDT Relay
Circuit symbol
The relay's switch connections are usually labelled 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.
4.4. CAPACITOR
Function
Capacitors store electric charge. They are used with resistors in timing circuits because it takes
time for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting as
a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC
(changing) signals but they block DC (constant) signals.
Capacitance
This is a measure of a capacitor's ability to store charge. A large capacitance means that more
charge can be stored. Capacitance is measured in farads, symbol F. However 1F is very large, so
prefixes are used to show the smaller values.
Three prefixes (multipliers) are used, (micro), n (nano) and p (pico):
Capacitor values can be very difficult to find because there are many types of capacitor with
different labelling systems!
There are many types of capacitor but they can be split into two groups, polarised and
unpolarised. Each group has its own circuit symbol.
Examples:
Circuit symbol:
Electrolytic Capacitors
Electrolytic capacitors are polarized and they must be connected the correct way round, at
least one of their leads will be marked + or -. They are not damaged by heat when soldering.
There are two designs of electrolytic capacitors; axial where the leads are attached to each end
(220F in picture) and radial where both leads are at the same end (10F in picture). Radial
capacitors tend to be a little smaller and they stand upright on the circuit board.
It is easy to find the value of electrolytic capacitors because they are clearly printed with their
capacitance and voltage rating. The voltage rating can be quite low (6V for example) and it
should always be checked when selecting an electrolytic capacitor. If the project parts list does
not specify a voltage, choose a capacitor with a rating which is greater than the project's power
supply voltage. 25V is a sensible minimum for most battery circuits.
Examples:
Circuit symbol:
Small value capacitors are un-polarized and may be connected either way round. They are not
damaged by heat when soldering, except for one unusual type (polystyrene). They have high
voltage ratings of at least 50V, usually 250V or so. It can be difficult to find the values of these
small capacitors because there are many types of them and several different labeling systems!
Many small value capacitors have their value printed but without a multiplier, so
you need to use experience to work out what the multiplier should be!
For example 0.1 means 0.1F = 100nF.
Sometimes
the
multiplier
is
used
in
place
of
the
the 3rd number is the number of zeros to give the capacitance in pF.
Ignore any letters - they just indicate tolerance and voltage rating.
Example:
Circuit symbol:
decimal
point:
Function
LEDs emit light when an electric current passes through them.
Connecting and soldering
LEDs must be connected the correct way round, the diagram may be labelled
a or + for anode and k or - for cathode (yes, it really is k, not c, for cathode!).
The cathode is the short lead and there may be a slight flat on the body of
round LEDs. If you can see inside the LED the cathode is the larger electrode (but this is not an
official identification method).
LEDs can be damaged by heat when soldering, but the risk is small unless you are very slow. No
special precautions are needed for soldering most LEDs.
Testing an LED
Never connect an LED directly to a battery or power supply!
It will be destroyed almost instantly because too much current will pass
through and burn it out.
LEDs must have a resistor in series to limit the current to a safe value,
for quick testing purposes a 1k
For an accurate value please see Calculating an LED resistor value below.
Colours of LEDs
R = (V S - V L ) / I
VS = supply voltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)
Make sure the LED current you choose is less than the maximum permitted and convert the
current to amps (A) so the calculation will give the resistor value in ohms ( ).
To convert mA to A divide the current in mA by 1000 because 1mA = 0.001A.
If the calculated value is not available choose the nearest standard resistor value which is
greater, so that the current will be a little less than you chose. In fact you may wish to choose a
greater resistor value to reduce the current (to increase battery life for example) but this will
make the LED less bright.
For example
If
The supply voltage VS = 9V,
Red LED (VL = 2V),
Requiring a current I = 20mA = 0.020A,
4.6. RESISTORS
Example:
Circuit symbol:
Function
The
Resistor
Colour Code
Resistors restrict the flow of electric current, for example a resistor is placed
in series with a light-emitting diode (LED) to limit the current passing
Colour Number
Black
Brown 1
Resistors may be connected either way round. They are not damaged by heat
when soldering.
Red
Orange 3
Yellow 4
Green
Blue
Violet
Grey
White
Resistance
is
is
quite
1k
= 1000
Resistor
measured
small
1M
values
so
in
ohms,
resistor
= 1000000
are
the
symbol
values
are
for
often
ohm
is
an
omega
given
in
and
.
M .
normally
shown
using
coloured
bands.
The fourth band is used to shows the tolerance (precision) of the resistor, this may be
ignored for almost all circuits but further details are given below.
This
So
resistor
its
has
red
value
(2),
violet
is
(7),
yellow
270000
(4
zeros)
=
and
270
gold
bands.
k .
4.7.
LCD DESCRIPTION:
LCD operation
In recent years the LCD is finding widespread wide spread use replacing LED (seven
segments LED or other multi segment LED). This is due to the following reasons:
1.
2.
The ability to display numbers, characters, and graphics. This is in contrast to LED,
which are limited to numbers and a few characters.
3.
Incorporation of a refreshing controller into the LDC, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU (or in
some other way) to keep displaying the data.
4.
allowing the user to send a command such as clear display, cursor at home, etc. IF RS=1
the data register is selected, allowing the user to send data to be displayed on the LCD.
R/W, read/write
R/W input allows the user to write information to the LCD or read information from it.
R/W=1 when reading; R/W=0 when writing.
E, enable
The enable pin is used by the LCD to latch information presented to its data pins. When
data is supplied to data pins, a high-to-low pulse must be applied to this pin in order for
the LCD to latch in the data present at the data pins. This pulse must be a minimum of
450 ns wide.
PIN
SYMBOL
I/O
DESCRIPTION
VSS
Ground
VCC
VEE
RS
R/W
R/W=0 to Write
R/W=1 to Read
I/O
Enable
DB0
I/O
DB1
I/O
DB2
I/O
10
DB3
I/O
11
DB4
I/O
12
DB5
I/O
13
DB6
I/O
14
DB7
I/O
Register
Return home
10
14
18
1C
80
C0
38
CHAPTER 5
5.1.
APPLICATIONS
5.2.
ADVANTAGES
CHAPTER 6
CONCLUSION & FUTURE SCOPE
6.1. CONCLUSION
We designed this project to make comfortable journey in car with out any troubles. Using
LDR sensing circuit we controlled the car lighting system. And if any door is unlocked, the
display of particular door has shown with buzzer sound.
When a particular door is unlocked (releasing of limiting switch), the controller showing the
unlocked door. During night time travelling car head lights are controlled as per the opposite
vehicle.
In the future we can add wireless communication to this project in-order to known the
accident information of vehicle. And also car engine heat can be controlled to increase the life
span of car engine.