full report - automation of car add on features

Upload: pavan-kumar

Post on 14-Feb-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Full Report - Automation of Car Add on Features

    1/66

    CHAPTER 1

    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 madetremendous 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 !i"e 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 loc"ed properly, the microcontroller senses and displays the particular door is

    not loc"ed 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.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    2/66

    1.3. BLOCK DIAGRAM

    $ig%& 'loc" (iagram of )ar (oor Sensing System

    $ig*& 'loc" (iagram of (im + (ip of )ar !ight )ontrol System

    AT

    89S52

    DOOR

    SENSORS

    R.P.S

    CRYSTAL

    16X2 LCD

    LDR

    AMPLIFIE

    R CIRCUIT

    SPDT

    RELAY

    HIGH BEAM

    LIGHTS

    LOW BEAM

    LIGHTS

  • 7/23/2019 Full Report - Automation of Car Add on Features

    3/66

    1.4. BLOCK DIAGRAM EXPLANATION OF DIM AND DIP CAR LIGHT

    CONTROL SYSTEM

    1.4.1. LDR

    The !( senses the light intensity of the opposite vehicle and

    ma"es the vehicle head lights to operate in lower beam and as

    the vehicle passes, it automatically the light goes to high beam.

    1.4.2. AMPLIFYING CIRCUIT

    The amplifier consists of two NN transistors. These are

    interfaced as darlington pair amplifier. The output of the

    amplifier is fed to relay.

    1.4.3. RELAY

    It is an electromagnetic switch, with the help of relay contacts,a low beam and high beam lights are operated.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    4/66

    1.. BLOCK DIAGRAM EXPLANATION OF CAR DOOR SENSING SYSTEM.

    1..1. DOOR SENSORS

    ere S(T manual relays are used which are also called

    as limiting switches. /hen car door is properly closed,

    the microcontroller gets a digital signal of active high %#

    and if door is not open, the microcontroller gets a digital

    signal of active low 0#.

    1..2. MICROCONTROLLER

    In this project 1T 23s4* version of 1T56!

    microcontroller is used which has a significant features

    of 27' of $lash 85, *49 bytes of static 15, :0-in

    (I ac"age, 2 bit microcontroller, * %9 bit timers;

    counters, 2 < interrupts and serial port. It has a uni=ue

    feature that it supports IS rotocol.

    1..3. LCD

    1 %9>* !)( !i=uid )rystal (isplay# is used to display

    the different characters. It support alphanumeric and

    punctuations. It can ta"e 2 < bit; : < bit of data from

    5icrocontroller to display the te>t. The data which it

    has ta"en converts into 1S)II code.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    5/66

    1..4. RPS

    egulated power supply gives constant and continues voltage. It ta"es house hold supply

    voltage *?0v# as input and converts into @3v, @9v, @4v using various converters.

    1... CRYSTAL:

    1 =uartA crystal provides cloc" pulses oscillations, hence it

    is called )rystal 8scillator. ere %%.043* 5A 6>ternal

    crystal oscillator is used to speed up the e>ecution of

    program.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    6/66

    CHAPTER 2

    CIRCUIT DIAGRAMS

    2.1. CIRCUIT DIAGRAM DIP AND DIM SENSING CIRCUIT

    2.2. CIRCUIT DIAGRAM DURING NO OPPSITE !EHICLE

  • 7/23/2019 Full Report - Automation of Car Add on Features

    7/66

    2.3. CIRCUIT DIAGRAM DURING NO OPPSITE !EHICLE

    2.4. "ORKING OF DIP AND DIM SENSING CIRCUIT

    /hen the light falls on the !(, the resistance of the !( decreases, therefore the

    current starts flowing through it and provides base bias to the transistor T%. 1nd the transistor

    T% goes to the saturation, then the current starts flowing through T% and the voltage drop across

    the resistor * provides the biasing to the switching transistor T*, as transistor T* conducts and

    energiAes the elays. The output is ta"en with the help of relay contacts, and applied to the high

    beam and low beam lights.

    /hen there is no vehicle coming opposite, the intensity of light decreases and the

    resistances of !( increases and therefore no biasing voltage to the transistor T% and the

    transistor T% + T* does not conduct and goes to saturation cutt-off region and the two elays

    will be de-energiAed. /ith the help of elay contacts a dc voltage of 3B is provided to the high

    beam light.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    8/66

    2.. CIRCUIT DIAGRAM OF CAR DOOR SENSOR INTERFACING "ITH MCU

    2.#.

    CIRCUIT

    DIAGRAM

    OF CAR

    DOOR

    SENSORS

    "HEN ALL ARE CLOSED

    2.$. CIRCUIT DIAGRAM OF CAR DOOR SENSORS "HEN DOOR IS UNLOCKED

  • 7/23/2019 Full Report - Automation of Car Add on Features

    9/66

    2.%. "ORKING PROCEDURE

    The project is designed to identify the unloc"ed door of a car. It is developed with

    embedded system platform. 1T56! microcontroller such as 1T23s4* 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 ort % %.0, %.%, %.*,

    %.?#. 1ll the switches are commonly connected to Bcc, hence when door is closed an active

  • 7/23/2019 Full Report - Automation of Car Add on Features

    10/66

    low signal is fed to microcontroller. If door is unloc"ed properly, an active high signal

    produced and is fed to microcontroller. /hen microcontroller receives active high signal

    from a particular port pin say %.0, microcontroller gives active high out to buAAer. So the

    buAAer gives alarm which will alert the car driver. Simultaneously : bit of data is given to

    !)(. The !)( converts the :-bit as per 1S)II code system and displays the representative

    character.

    The buAAer is interfaced with %.C. !)( is interfaced with ort * as : bit mode of data bus.

    CHAPTER III

    EMBEDDED SYSTEMS

    3.1 INTRODUCTION TO EMBEDDED SYSTEMS

    6ach day, our lives become more dependent on Dembedded systemsD, digital information

    technology that is embedded in our environment. 5ore than 32E of processors applied today are

    in embedded systems, and are no longer visible to the customer as DcomputersD in the ordinary

  • 7/23/2019 Full Report - Automation of Car Add on Features

    11/66

    sense. 1n 6mbedded System is a special-purpose system in which the computer is completely

    encapsulated by or dedicated to the device or system it controls. Fnli"e a general-purpose

    computer, such as a personal computer, an embedded system performs one or a few pre-defined

    tas"s, usually with very specific re=uirements. Since the system is dedicated to specific tas"s,

    design engineers can optimiAe it, reducing the siAe and cost of the product. 6mbedded systems

    are often mass-produced, benefiting from economies of scale. The increasing use of ) hardware

    is one of the most important developments in high-end embedded systems in recent years.

    ardware costs of high-end systems have dropped dramatically as a result of this trend, ma"ing

    feasible some projects which previously would not have been done because of the high cost of

    non-)-based embedded hardware. 'ut software choices for the embedded ) platform are not

    nearly as attractive as the hardware.

    Typically, an embedded system is housed on a single microprocessorboard with the

    programs stored in 85. Birtually all appliances that have a digital interface -- watches,

    microwaves, B)s, cars -- utiliAe embedded systems. Some embedded systems include an

    operating system, but many are so specialiAed that the entire logic can be implemented as a

    single program.

    hysically, 6mbedded Systems range from portable devices such as digital watches and

    5? players, to large stationary installations li"e traffic lights, factory controllers, or the systems

    controlling nuclear power plants.

    In terms of comple>ity embedded systems can range from very simple with a single

    microcontroller chip, to very comple> with multiple units, peripherals and networ"s mounted

    inside a large chassis or enclosure.

    D&'()(*(+) +' ,) E-&//&/ S0*&-

    6mbedded system is defined as, for a particular;specific application implementing the

    software code to interact directly with that particular hardware what we built. Software is used

    for providing features and fle>ibility, hardware G Hprocessors, asics, memory,... Is used for

    performance + sometimes security#

    http://www.webopedia.com/TERM/E/microprocessor.htmlhttp://www.webopedia.com/TERM/E/board.htmlhttp://www.webopedia.com/TERM/E/program.htmlhttp://www.webopedia.com/TERM/E/ROM.htmlhttp://www.webopedia.com/TERM/E/ROM.htmlhttp://www.webopedia.com/TERM/E/digital.htmlhttp://www.webopedia.com/TERM/E/operating_system.htmlhttp://www.webopedia.com/TERM/E/board.htmlhttp://www.webopedia.com/TERM/E/program.htmlhttp://www.webopedia.com/TERM/E/ROM.htmlhttp://www.webopedia.com/TERM/E/digital.htmlhttp://www.webopedia.com/TERM/E/operating_system.htmlhttp://www.webopedia.com/TERM/E/microprocessor.html
  • 7/23/2019 Full Report - Automation of Car Add on Features

    12/66

    or#

    1n embedded system is a special-purpose computersystem designed to perform one or a

    few dedicated functions, often with real-time computingconstraints. It is usually embedded as

    part of a complete device including hardware and mechanical parts. In contrast, a general-

    purpose computer, such as a personal computer, can do many different tas"s depending on

    programming.

    or#

    1n embedded system is a single-purpose computer built into a larger system for the

    purposes of controlling and monitoring the system. 1 specialiAed computer system that is part of

    a larger systemor machine.

    There are many definitions of embedded system but all of these can be combined into a

    single concept. 1n embedded system is a special purpose computer system that is used for

    particular tas".

    F&,*& +' E-&//&/ S0*&-

    The versatility of the embedded computer system lends itself to utility in all "inds ofenterprises, from the simplification of deliverable products to a reduction in costs in their

    development and manufacture. )omple> systems with rich functionality employ special

    operating systems that ta"e into account major characteristics of embedded systems. 6mbedded

    operating systems have minimiAed footprint and may follow real-time operating system

    specifics.

    The special computers system is usually less powerful than general-purpose systems,

    although some e>pectations do e>ist where embedded systems are very powerful and

    complicated. Fsually a low power consumption )F with a limited amount of memory is used

    in embedded systems. 5any embedded systems use very small operating systemsJ most of these

    provide very limited operating system capabilities.

    http://www.answers.com/topic/computer-1http://www.answers.com/topic/realtime-systemhttp://www.answers.com/topic/personal-computerhttp://www.webopedia.com/TERM/E/system.htmlhttp://www.answers.com/topic/computer-1http://www.answers.com/topic/realtime-systemhttp://www.answers.com/topic/personal-computerhttp://www.webopedia.com/TERM/E/system.html
  • 7/23/2019 Full Report - Automation of Car Add on Features

    13/66

    Since the embedded system is dedicated to specific tas"s, design engineers can optimiAe

    it, reducing the siAe and cost of the product, or increasing the reliability and performance. Some

    embedded systems are mass-produced, benefiting fromeconomies of scale.

    Some embedded systems have to operate in e>treme environment conditions such as very

    high temperature + humidity.

    $or high volume systems such as portable music players or mobile phones, minimiAing

    cost is usually the primary design consideration. 6ngineers typically select hardware that is just

    Kgood enoughL to implement the necessary functions.

    $or 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

    6mbedded computing systems generally e>hibit rich functionalityMcomple> functionality is

    usually the reason for introducing cpus into the design. owever, they also e>hibit many non-

    functional re=uirements that ma"e the tas" especially challenging&

    eal-time deadlines that will cause system failure if not metJ

    5ulti-rate operationJ

    In many cases, low power consumptionJ

    !ow manufacturing cost, which often means limited code siAe.

    /or"station programmers often concentrate on functionality. They may consider the

    performance characteristics of a few computational "ernels of their software, but rarely analyAe

    the total application. They almost never consider power consumption and manufacturing cost.

    The need to juggle all these re=uirements ma"es embedded system programming very

    challenging and is the reason why embedded system designers need to understand computer

    architecture.

    O&(&5 +' ,) E-&//&/ S0*&- A67(*&6*&

    http://www.answers.com/topic/economies-of-scale-2http://www.answers.com/topic/economies-of-scale-2http://www.answers.com/topic/economies-of-scale-2
  • 7/23/2019 Full Report - Automation of Car Add on Features

    14/66

    6very 6mbedded system consists of a custom-built hardware built around a central

    processing unit. This hardware also contains memory chips onto which the software is loaded.

    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 des"top

    computer. owever these are significant differences. It is not compulsory to have an operating

    system in every embedded system. $or small applications such as remote control units, air

    conditioners, toys etc.

    1pplications of 6mbedded Systems

    Some of the most common embedded systems used in everyday life are

    S-,88 &-&//&/ 6+)*+88&: 2-bit cpus dominate, simple or no operating system

    e.g., thermostats#C+)*+8 0*&-: often use dsp chip for control computations

    e.g., automotive engine control#

    D(*(*&/ &-&//&/ 6+)*+8:mi>ture of large and small nodes on a real-time

    embedded networ"s

    e.g., cars, elevators, factory automation#

    S0*&- +) 67(9: asic design tailored to application area

    e.g., consumer electronics, set-top bo>es#

    Application Software

    Operating

    System

    H/W

  • 7/23/2019 Full Report - Automation of Car Add on Features

    15/66

    N&*5+ &;(9-&)*: emphasis on data movement;pac"et flow

    e.g., networ" switchesJ telephone switches#

    C(*(6,8 0*&-: safety and mission critical computing e.g., pacema"ers, automatic trains#

    S(

  • 7/23/2019 Full Report - Automation of Car Add on Features

    16/66

    another system an led or lcd display

    6> digital camera, microwave oven, cd player, air conditioner etc

    2.R&,8 *(-& &-&//&/ 0*&-:=

    In this type of an embedded system a specific wor" has to be complete in a particularperiod of time.

    H,/ &,8 *(-& 0*&-&- embedded real time used in missiles

    S+'* &,8 *(-& 0*&-&- dvd players

    3.N&*5+&/ ()'+-,*(+) ,998(,)6&:=

    6mbedded systems that are provided with n;w interfaces and accessed by n;wDs such as

    local area n;w or internet are called networ" information appliances

    6> a web camera is connected to the internet. )amera can send pictures in real time to any

    computers connected to the internet

    4. M+(8& /&(6&:=

    1ctually it is a combination of both B!SI and 6mbedded system 5obile devices such as

    mobile phone, personal digital assistants, smart phones etc are special category of embedded

    systems

    3.2 INTRODUCTION TO MICROCONTROLLER

    'ased on the processor side embedded systems is mainly divided into ? types

    1. M(6+ 9+6&+ : =are for general purpose eg& our personal computer

    2. M(6+ 6+)*+88&:=are for specific applications, because of cheaper cost we will go for these

    3. D9 > /(

  • 7/23/2019 Full Report - Automation of Car Add on Features

    17/66

    addition of e>ternal ram, rom, and i;o ports ma"es these systems bul"ier and much more

    e>pensive, 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 tas" at hand.

    1 5icrocontroller has a )F a microprocessor# in addition to a fi>ed amount of 15,

    85, I;8 ports, and a timer all on a single chip. In other words, the processor, the 15, 85,

    I;8 ports and the timer are all embedded together on one chipJ therefore, the designer cannot add

    any e>ternal memory, I;8 ports, or timer to it. The fi>ed amount of on-chip 85, 15, and

    number of I;8 ports in 5icrocontrollers ma"es them ideal for many applications in which cost

    and space are critical.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    18/66

    CPU 98,*'+-:

    6mbedded processors can be bro"en into two distinct categories& microprocessors #

    and microcontrollers )#. 5icrocontrollers have built-in peripherals on the chip, reducing siAe

    of the system.

    There are many different )F architectures used in embedded designs such as 15,

    5IS, )oldfire;92", ower), >29, I), 204%, 1tmel 1B, enesas 2, S, B240, $-B,

    5?*, O20, O2, etc. This in contrast to the des"top computer mar"et, which is currently limited

    to just a few competing architectures.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    19/66

    );%0: and );%0:@ are a typical base for small, low-volume embedded and ruggediAed

    system design. These often use (8S, !inu>, Net'S(, or an embedded real-time operating

    system such as PNQ or B>/or"s.

    1 common configuration for very-high-volume embedded systems is the system on a

    chip So)#, an application-specific integrated circuit 1SI)#, for which the )F core was

    purchased and added as part of the chip design. 1 related scheme is to use a field-programmable

    gate array $R1#, and program it with all the logic, including the )F.

    6mbedded systems are based on the concept of the microcontroller, a single integrated

    circuit that contains all the technology re=uired to run an application. 5icrocontrollers ma"e

    integrated systems possible by combining several features together into what is effectively a

    complete computer on a chip, including&

    )entralrocessingFnit

    Input;8utputinterfacessuchasserialports#

    eripheralssuchastimers#

    85,6685or#$lashmemoryforprogramstorage

    15fordatastorage

    )loc"generator

    'y 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

    comple>ity, siAe and cost.

    S(@& "&(imum performance for minimum

    siAe and weight. 1 centraliAed on-board computer system would greatly outweigh a collection of

    microcontrollers.

    E''(6(&)60:5icrocontrollers are designed to perform repeated functions for long periods of

    time without failing or re=uiring 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

  • 7/23/2019 Full Report - Automation of Car Add on Features

    20/66

    3.3 INTRODUCTION TO %1

    Intel corporation introduced an 2 bit micro controller called the 204% in %32%. /hile the

    time of introduction, intel was given some specific features and particular name as mcs-4%

    $61TF6S&-

    85 ---- : 7 'T6S 8$ 5658

    15 ----- %*2 'T6S

    TI56S------*

    : 8TS --- ?* I;8 8TS 61) 2 'IT /I(6 #

    INT6FTS-----9

    S6I1! 8T-----%

    1!! 8N 1 SINR!6 )I

    5any semiconductor manufacturers started either manufacturing the 204% devices as

    such Intel was liberal in giving away license to whoever as"ed# or developing a new "ind of

    microcontrollers based on 204% core architecture. 5anufacturers modified the basic 204%

    architecture and added many new peripheral functions to ma"e them attractive to the designers.

    1fter that so many industries are come into picture to introduce 204% again wit some

    e>tra features. This has led to many versions of the 204% with different speeds and amounts of

    on-chip rom mar"eted by more manufactures those are

    (1!!1S ------ (S:C00

  • 7/23/2019 Full Report - Automation of Car Add on Features

    21/66

    OI!8R---------O

    58T8!!1

    $66S)1!6

    1T56! ------- 1T23)4%;4*, 1T23S4%;4*

    I!!IS ----- 23)4%(*$N

    'efore these industries came into picture 204% chips are made with cmos technology. 1tmel was

    introduced with isp in system programming#

    IN SYSTEM PROGRAMMING >ISP?:=

    IN-SST65 8R155INR IS# 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 re=uiring 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. 5ost

    ma>im 204%-based microcontrollers can be reprogrammed from a pc or laptop via an

    ine>pensive rs-*?* 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 re=uiring a separate

    programming stage prior to assembling the system. This may allow manufacturers to program

    the chips in their own systemDs production line instead of buying preprogrammed chips from a

    manufacturer or distributor, ma"ing it feasible to apply code or design changes in the middle of a

    production run.

    3.4 AT%S2 MICROCONTROLLER

    The 1T23S4* is a low-power, high-performance cmos 2-bit microcontroller with 2" bytes

    of in-system programmable flash memory. The device is manufactured using atmels high-

    http://en.wikipedia.org/wiki/Programmable_logic_devicehttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Programmable_logic_devicehttp://en.wikipedia.org/wiki/Microcontroller
  • 7/23/2019 Full Report - Automation of Car Add on Features

    22/66

    density nonvolatile memory technology and is compatible with the industry-standard 20c4%

    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. 'y combining a versatile 2-bit

    cpu with in-system programmable flash on a monolithic chip, the atmel at23s4* is a powerful

    microcontroller which provides a highly-fle>ible and cost-effective solution to many embedded

    control applications.

    3.. AT%S2 PIN DIAGRAM

    1T23S4* 1)IT6)TF6 )8NSISTS 8$ T6S6 S6)I$I) $61TF6S&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    23/66

    2 'IT )F /IT 6RIST6S 1 1))F5F!1T8# 1N( '

    %9 'IT 8R15 )8FNT6)# 1N( (1T1 8INT6 (T#

    2 'IT 8R15 ST1TFS /8( S/#

    2 'IT ST1)7 8INT6 S#

    INT6N1! 85 8$ 27

    INT6N1! 15 8$ %*2 'T6S

    $8F 6RIST6 '1N7S 61) )8NT1ININR 6IRT 6RIST6S

    SIQT66N 'T6S, /I) 51 '6 1((6SS6( 1T T6 'IT !6B6!

    6IRT 'T6S 8$ R6N61! F8S6 (1T1 5658

    ?* I;8 INS 11NR6( 1S $8F 2-'IT 8TS& 0,%,*,?

    T/8 %9-'IT TI56S;)8FNT6S& T0 1N( T%

    $F!! (F!6Q S6I1! (1T1 6)6IB6;T1NS5ITT6 & S'F$

    )8NT8! 6RIST6S& T)8N, T58(, S)8N, S58(, )8N, I 1N( I6.

    T/8 6QT6N1! 1N( T66 INT6N1! INT6FT S8F)6S.

    8S)I!!1T8 1N( )!8)7 )I)FITS.

    3.#. PIN DESCRIPTION

    P() > 32 3 ? P+* : ort 0 is an 2-bit open drain bidirectional port. 1s an open drain output

    port, it can sin" eight !S TT! loads. ort 0 pins that have %s written to them float, and in that

    state will function as high impedance inputs. ort 0 is also the multiple>ed low-order address and

    data bus during accesses to e>ternal memory. In this application it uses strong internal pull ups

    when emitting %s. ort 0 emits code bytes during program verification. In this application,

    e>ternal pull ups are re=uired.

    P() > 1= % ? P+* 1: ort % is an 2-bit bidirectional I;8 port with internal pull ups. ort % pins that

    have %s written to them are pulled high by the internal pull ups, and in that state can be used as

  • 7/23/2019 Full Report - Automation of Car Add on Features

    24/66

    inputs. 1s inputs, port % pins that are e>ternally being pulled low will source current because of

    the internal pull ups.

    1lternate $unctions of ort % used for In system rogrammable

    .4 58SI --------- Instruction Input

    .9 5IS8 ---------- (ata 8utput

    .C S)7 ----------- )l" in

    P() > 21 2% ? P+* 2: ort * is an 2-bit bidirectional I;8 port with internal pull ups. ort *

    emits the high-order address byte during accesses to e>ternal memory that use %9-bit addresses.

    In this application, it uses the strong internal pull ups when emitting %s.

    P() >1 1$? P+* 3:ort ? is an 2-bit bidirectional I;8 port with internal pull ups. It also serves

    the functions of various special features of the 20)4% $amily as follows&

    ort in 1lternate $unction

    ?.0- >( serial input port#

    ?.% -T>( serial output port#

    ?.* -INT0 e>ternal interrupt 0#

    ?.?- INT% e>ternal interrupt %#

    ?.: -T0 timer 0 e>ternal input#

    ?.4 -T% timer % e>ternal input#

    ?.9 -/ e>ternal data memory write strobe#

    ?.C -( e>ternal data memory read strobe#

  • 7/23/2019 Full Report - Automation of Car Add on Features

    25/66

    P() 4 !CC:-Supply voltage

    P() 2 !SS:-)ircuit ground potential

    P() 2 PSEN: rogram Store 6nable is the read strobe to e>ternal rogram 5emory. /hen thedevice is e>ecuting out of e>ternal rogram 5emory, S6N is activated twice each machine

    cycle e>cept that two S6N activations are s"ipped during accesses to e>ternal (ata 5emory#.

    S6N is not activated when the device is e>ecuting out of internal rogram 5emory.

    P() 3 ALEPROG: 1ddress !atch 6nable output pulse for latching the low byte of the address

    during accesses to e>ternal memory. 1!6 is emitted at a constant rate of %;9 of the oscillator

    fre=uency, for e>ternal timing or cloc"ing purposes, even when there are no accesses to e>ternal

    memory. owever, one 1!6 pulse is s"ipped during each access to e>ternal (ata 5emory.#

    This pin is also the program pulse input 8R# during 685 programming.

    P() 31 EA!PP: /hen 61 is held high the )F e>ecutes out of internal rogram 5emory.

    olding 61 low forces the )F to e>ecute out of e>ternal memory regardless of the rogram

    )ounter value. In the 20)?%, 61 must be e>ternally wired low. In the 685 devices, this pin

    also receives the programming supply voltage B# during 685 programming.

    P() 1% XTAL1: Input to the inverting oscillator amplifier.

    P() 1 XTAL2: 8utput from the inverting oscillator amplifier.

    3.$. REGISTERS

    204% is a collection of 2 and %9 bit registers and 2 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 204%, as well

    as memory locations that are located outside the 204%.

    egister 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

    204% register are 2-bit registers.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    26/66

    Renerally there are two types of registers. They are general purpose registers gprs# and special

    function registers sfrs#

    GENERAL PURPOSE REGISTER

    The 2 bits of a register are shown from msb dC to the lsb d0. /ith an 2-bit data type, any

    data larger than 2 bits must be bro"en into 2-bit chun"s before it is processed.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    27/66

    The most widely used registers 1 accumulator#

    for all arithmetic and logic instructions', 0, %, *, ?, :, 4, 9, C

    dptr data pointer#, and pc program counter#

    %9 < bit Reneral urpose egister are (ata ointer (T# and rogram )ounter )#

    The program counter points to the address of the ne>t instruction to be e>ecuted. (ptr. 1s the

    name suggests, is used to point the data. It is used by a number of commands which allows the

    microcontroller to access e>ternal memory. /hen the microcontroller access e>ternal memory it

    will access at the address indicated by (T.

    T7&& ,& 12% 0*& +' RAM () *7& %1

    The %*2 bytes are divided into three different groups as follows&

    %# 1 total of ?* bytes from locations 00 to %f he> are set aside for register ban"s and the stac"

    *# 1 total of %9 bytes from locations *0h to *fh are set aside for bit-addressable read;write

    memory

    ?# 1 total of 20 bytes from locations ?0h to Cfh are used for read and write storage, called scratch

    pad

  • 7/23/2019 Full Report - Automation of Car Add on Features

    28/66

    S9&6(,8 F)6*(+) R&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    29/66

    ternal pin. 1fter a preset number of

  • 7/23/2019 Full Report - Automation of Car Add on Features

    30/66

    counts, the counter issues an interrupt re=uest. egister pairs th0, tl0#, th%, tl%#, and th*, tl*#

    are the %9-bit counting registers for timer;counters 0, %, and *, respectively.

    TIMER REGISTER

    The %9-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 li"e any other register, such as 1,',0,%,*,etc.

    TIMER 1 REGISTER

    Timer % is also %9-bits, and its %9-bit register is split into two bytes, referred to as T!%

    Timer % low byte # and T% Timer % high byte #. These registers are accessible in the same

    way as the registers of timer 0.

    TMOD R&*(-& -+/&?

    TMOD: TIMERCOUNTER MODE CONTROL REGISTER.

    N8T 'IT 1((6SS1'!6.

    TI56 % TI56 0

    R1T6 /hen T> in T)8N# is set and R1T6G%, Timer;)ounterQ will run only

    while INT> pin is high hardware control#. /hen R1T6G0, Timer;)ounter

    will run only while T>G% software control#.

    );T Timer or counter selector. )leared for timer operation input from internal

    system cloc"#. Set for counter operation input from t> input pin#.

    5% 5ode Selector 'it.

    50 5ode Selector 'it.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    31/66

    5% 50 58(6 861TINR 58(6

    0 0 0 %?-'it Timer 20:2 )ompatible# Th%#

    0 % % %9-'it Timer;)ounter

    % 0 * 2-bit auto-reload timer;counter tl%#.

    eloaded from th% at overflow.

    % % ? Timer % halted. etains count.

    % % ? Timer %# Timer;)ounter % stopped.

    TCON: TIMERCOUNTER CONTROL REGISTER

    'IT 1((6SS1'!6.

    T$% T(-&1 +&'8+5 '8,

  • 7/23/2019 Full Report - Automation of Car Add on Features

    32/66

    IT0 I)*&9* =*09& 6+)*+8 (*.Set;cleared by software to specify falling edge;low

    level triggered e>ternal interrupt.

    3.. SERIAL COMMUNICATION

    The 204% serial port is full duple>. In other words, it can transmit and receive data at the same

    time. Fnli"e any other register in the 204%, sbuf is in fact two distinct registers - the write-only

    register and the read-only register. Transmitted data is sent out from the write-only register while

    received data is stored in the read-only register. There are two separate data lines, one for

    transmission t>d# and one for reception r>d#. Therefore, the serial port can be transmitting data

    down the t>d line while it is at the same time receiving data on the r>d line. The t>d line is pin %% of

    the microcontroller p?.%# while the r>d line is on pin %0 p?.0#

    Serial data communication uses two methods, asynchronous and synchronous. The synchronousmethod transfers a bloc" of data characters# at a time, while the asynchronous method transfers a

    single byte at a time. It is possible to write software to use either of these methods, but the programs

    can be tedious and long. $or this reason, there are special ic chips made by many manufacturers for

    serial data communications. These chips can be commonly referred to as uart universal

    asynchronous receiver-transmitter# and FS1T universal synchronous asynchronous receiver-

    transmitter#. The 204% chip has a built-in F1T.

    ASYNCHRONOUS SERIAL COMMUNICATION AND DATA FRAMING

    START BITS AND STOP BITS

  • 7/23/2019 Full Report - Automation of Car Add on Features

    33/66

    In the asynchronous method is character is placed between start and stop bits, this is called data

    framing. In asynchronous communication, at least two e>tra bits are transmitted with the data wordJ

    a start bit and a stop bit. Therefore, if the transmitter is using an 2-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

    %. Therefore, when no data is being sent the data line is continuously high. The receiver waits for a

    % to 0 transition. In other words, it awaits a transition from the stop bit no data# to the start bit logic

    0#. 8nce this transition occurs the receiver "nows a data byte will follow. Since it "nows the data

    rate because it is defined in the protocol# it uses the same cloc" as fre=uency as that used by the

    transmitter and reads the correct number of bits and stores them in a register. $or e>ample, if the

    protocol determines the word siAe as eight bits, once the receiver sees a start bit it reads the ne>t

    eight bits and places them in a buffer. 8nce the data word has been read the receiver chec"s to see if

    the ne>t bit is a stop bit, signifying the end of the data. If the ne>t bit is not a logic % then something

    went wrong with the transmission and the receiver dumps the data. If the stop bit was received the

    receiver waits for the ne>t data word, ieJ it waits for a % to 0 transition.

    'aud ates in the 204%

    Goe o!" #$"

    "TA#

    oscillat

    or

    %!$%%$

    &y 'ART

    (achine

    cyclefre)uency

    $**

    H+

    To timer !

    To set the

    &aud rate

    ,$!-.

    H+

    !!-0,$

    (H+

    Timer !

  • 7/23/2019 Full Report - Automation of Car Add on Features

    34/66

    QT1! G %%.043* 5A&

    The fre=uency of system cloc" G %%.043* 5A ; %* G 3*%.9 "A

    The fre=uency sent to timer % G 3*%.9 "A; ?* G *2,200 A

    a# *2,200 ; ? G 3900 where -? G $( he># is loaded into T%

    b# *2,200 ; %* G *:00 where -%* G $: he># is loaded into T%

    c# *2,200 ; *: G %*00 where -*: G 62 he># is loaded into T%

    SBUF

    S'F$ is an 2-bit register used solely for serial communication in the 204%. $or a byte of

    data to be transferred via the t>d line, it must be placed in the S'F$ register. Similarly, S'F$

    holds the byte of data when it is received by the 204%s r>d line. S'F$ can be accessed li"e any

    other register in the 204%.

    The moment a byte is written into sbuf, it is framed with the start and stop bits and transferred

    serially via the t>d pin. Similarly, when the bits are received serially via r>d, the 204% deframes

    it by eliminating the stop and start bits, ma"ing a byte out of the data received, and then placing

    it in the S'F$.

    DATA TRANSMISSION: =

    Transmission of serial data bits begins anytime data is written to sbuf. U TI U S)8N# set

    to % when data has been transmitted and signifies that U S'F$ U is empty and that another data

    byte can be sent.

    DATA RECEPTION: =

    eception of serial data will begin if the receive enable bit ren# in scon is set to D % D for

    all modes. $or mode D 0 D only ri must be cleared to 0. eceiver interrupt flag D ri D in scon# is set

    after data has been received in all modes. Setting of D ren D bit is a direct program control that

    limits the reception of une>pected data.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    35/66

    SCON > SERIAL CONTROL ? REGISTER

    S50 S5% S5* 6N T'2 '2 TI I

    M+/& & Serial data enters and e>its through >(. T>( outputs the shift cloc". 2 bits are

    transmitted;received !S' first#. The baud rate is fi>ed at %;%* the oscillator fre=uency.

    M+/& 1& %0 bits are transmitted through t>d# or received through r>d#& a start bit 0#, 2 data bits

    lsb first#, and a stop bit %#. 8n receive, the stop bit goes into rb2 in special function register

    scon. The baud rate is variable.

    M+/& 2& %% bits are transmitted through t>d# or received through r>d#& start bit 0#, 2 data bits

    lsb first#, a programmable 3th data bit, and a stop bit %#. 8n transmit, the 3th data bit tb2 in

    scon# can be assigned the value of 0 or %. 8r, for e>ample, the parity bit p, in the psw# could be

    moved into tb2. 8n receive, the 3th data bit goes into rb2 in special function register scon, while

    the stop bit is ignored. The baud rate is programmable to either %;?* or %;9: the oscillator

    fre=uency.

    M+/& 3:%% bits are transmitted through t>d# or received through r>d#& a start bit 0#, 2 data bits

    lsb first#, a programmable 3th data bit, and a stop bit %#. In fact, mode ? is the same as mode *

    in all respects e>cept baud rate. The baud rate in mode ? is variable. In all four modes,

    transmission is initiated by any instruction that uses sbuf as a destination register. eception is

    initiated in mode 0 by the condition ri G 0 and ren G %. eception is initiated in the other modes

    by the incoming start bit if ren G %.

    SM2 enables the multiprocessor communication feature in modes * and ?. In mode * or ?, if sm*

    is set to %, then rl will not be activated if the received 3th data bit rb2# is 0. In mode %, if sm*G%

    then ri will not be activated if a valid stop bit was not received. In mode 0, sm* should be 0.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    36/66

    RENenables serial reception. Set by software to enable reception. )lear by software to disable

    reception.

    TB%the 3th data bit that will be transmitted in modes * and ?. Set or clear by software as

    desired.

    RB%in modes * and ?, is the 3th data bit that was received. In mode %, it sm*G0, rb2 is the stop

    bit that was received. In mode 0, rb2 is not used.

    TI >T,)-(* I)*&9*?

    This is an e>tremely important flag bit in the scon register. /hen the 204% finishes the transfer of

    the 2-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 >R&6&(& I)*&9*?

    This is an e>tremely important flag bit in the scon register. /hen the 204% receives data

    serially via r>d, 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 pic"ed up before it is

    lost.

    INTERRUPTS

    1n interrupt is a special feature which allows the 204% to provide the illusion of Umulti-

    tas"ing,U although in reality the 204% is only doing one thing at a time. The word UinterruptU can

    often be substituted with the word Uevent.U

    1n interrupt is triggered whenever a corresponding event occurs. /hen the event occurs,

    the 204% temporarily puts Uon holdU the normal e>ecution of the program and e>ecutes a special

    section of code referred to as an interrupt handler. The interrupt handler performs whatever

    special functions are re=uired to handle the event and then returns control to the 204% at which

    point program e>ecution continues as if it had never been interrupted.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    37/66

    I)*&9* S&(6& R+*()&

    $or every interrupt, there must be an interrupt service routine IS#. 8r interrupt handler.

    /hen an interrupt is invo"ed, the microcontroller runs the interrupt service routine. $or every

    interrupt, there is a fi>ed location in memory that holds the address of its IS. The group of

    memory locations set aside to hold the addresses of the ISs is called interrupt vector table.

    Si> Interrupts in 204%

    %. eset & /hen the reset pin is activated, the 204% jumps to address location 0000*. Two interrupts are set aside for the timers& one for the Timer 0 and one for Timer%.

    ?. Two interrupts are set aside for hardware e>ternal interrupts & one for INT0 and one forINT%

    :. Serial communication has a single interrupt that belongs to both receive and transmit.

    E),8()< I)*&9* >IE? R&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    38/66

    6S I6.: 6nables or disables the serial port interrupt.

    6T% I6.? 6nables or disables Timer % overflow interrupt.

    6Q% I6.* 6nables or disables e>ternal interrupt %.

    6T0 I6.% 6nables or disables Timer 0 overflow interrupt.

    6Q0 I6.0 6nables or disables e>ternal interrupt 0.

    I)*&9* P(+(*0 >IP? R&ternal interrupt % priority bit.

    T0 I.% Timer 0 interrupt priority bit.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    39/66

    Q0 I.0 e>ternal interrupt 0 priority bit.

    3.1. BASIC REUIRMENT

    The following are the basic five re=uirements of microcontroller

    %. ower Supply

    *. )rystal 8scillator

    ?. eset

    :. SI esistor

    4. esistor for 61 in

    3.1.1. REGULATED PO"ER SUPPLY

    In mains-supplied electronic systems the ac input voltage must be converted into a dc voltage

    with the right value and degree of stabiliAation. The common dc voltages that are re=uired to

    power up the devices are generally in the range of ? vdc to ?0 vdc. Typically the fi>ed types of

    dc voltages are 4v, 3v, %*v, %4v and %2v dc.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    40/66

    PO"ER SUPPLY MODULES&

    ST6 (8/N T1NS$856

    'I(R6 6)TI$I6 /IT $I!T6

    B8!T1R6 6RF!1T8S

    TRANSFORMER

    Transformers convert ac electricity from one voltage to another with little loss of power.

    transformers wor" 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.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    41/66

    1 step down power transformer is used to step down the ac voltage from the line voltage

    of %%0 B1) or **0 B1) 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 ma"e a rectifier to convert ac to dc. The

    bridge rectifieris the most important and it produces '88=5,&varying dc

    BRIDGE RECTIFIER OUTPUT: FULL="A!E !ARYING DC

    http://www.electronics-project-design.com/PowerSupplies.htmlhttp://www.kpsec.freeuk.com/powersup.htm#bridgerectifierhttp://www.electronics-project-design.com/PowerSupplies.htmlhttp://www.kpsec.freeuk.com/powersup.htm#bridgerectifier
  • 7/23/2019 Full Report - Automation of Car Add on Features

    42/66

    1lternate 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

    $iltering is performed by a large value electrolytic capacitorconnected across the () supply to

    act as a reservoir, supplying current to the output when the varying () voltage from the rectifier

    is falling. The diagram shows the unfiltered varying () dotted line# and the filtered () solid

    line#.

    The capacitor charges =uic"ly near the pea" of the varying (), and then discharges as it

    supplies current to the output. Typically %000 ' capacitor is used

    REGULATOR

    This is a simple dc regulated supply project using C204 voltage regulator to obtain a variable dc

    voltage range from 4v to %4v

    http://www.kpsec.freeuk.com/components/capac.htm#polarisedhttp://www.kpsec.freeuk.com/components/capac.htm#polarisedhttp://www.kpsec.freeuk.com/components/capac.htm#polarised
  • 7/23/2019 Full Report - Automation of Car Add on Features

    43/66

    in out of the C204 regulator ic.

    %. Fnregulated voltage in

    *. Rround

    ?. egulated voltage out

    If you need other voltages than @4v, you can modify the circuit by replacing the C204 chips with

    another regulator with different output voltage from regulator C2>> chip family. the last numbers

    in the the chip code tells the output voltage. remember that the input voltage must be at least ?v

    greater than regulator output voltage ot otherwise the regulator does not wor" well.

    )I)FIT (I1R15 8$ 8/6 SF!

    The power supply consists of a 3-0-3 step down transformer. a bridge rectifier is used to rectify

    and convert ac to dc. a %000uf capacitor is used to filter the ripples and the output is connected to

  • 7/23/2019 Full Report - Automation of Car Add on Features

    44/66

    C204 voltage regulator. this comprises the power supply for the entire circuit. vcc is connected to

    pin :0 the power supply of microcontroller.

    3.11. CRYSTAL OSCILLATOR

    The 204% uses the crystal for precisely that& to

    synchroniAe its operation. effectively, the 204%

    operates using what are called Umachine cycles.U a

    single machine cycle is the minimum amount of time

    in which a single 204% instruction can be

    e>ecuted. 1lthough many instructions ta"e multiple cycles. 204% has an on-chip oscillator. it

    needs an e>ternal crystal that decides the operating fre=uency of the 204%. the crystal is

    connected to pins %2 and %3 with stabiliAing capacitors. %*5A %%.043mhA# crystal is often

    used and the capacitance ranges from *0pf to :0pf.

    1 cycle is, in reality, %* pulses of the crystal. that is to

    say, if an instruction ta"es one machine cycle to

    e>ecute, it will ta"e %* pulses of the crystal to e>ecute.

    since we "now the we can calculate how many

    instruction cycles the 204% can e>ecute per second&

    %%,043,000 ; %* G 3*%,42?

    %%.043* mhA crystals are often used because it can be

    divided to give you e>act cloc" rates for most of the

    common baud rates for the uart, especially for the

    higher speeds 3900, %3*00#.

    3.12. RESET

  • 7/23/2019 Full Report - Automation of Car Add on Features

    45/66

    eset is an active high input when reset is set to high, 204% goes bac" to the power on state.the

    204% is reset by holding the rst high for at least two machine cycles and then returning it low.

    initially charging of capacitor ma"es rst high, when capacitor charges fully it bloc"s dc.

    SIP R&(*+

    S(9 esistor is a single in pac" esistor i.e.,# 2 resistors connected in series. 'asically SI

    resistor is a 3 pin connector first pin is for power supply to the entire 2 resistors in SI.

    Renerally SI esistor is used to close the open drain connections of ort 0.

    CHAPTER 4

    HARD"ARE IMPLEMENTATION

    4.1. LDR SENSOR >LIGHT DEPENDENT RESISTOR ?

    1n !( is an ()9* *,)/6&sensor# which converts brightness light# to resistance. It is

    made from cadmium sulphide )dS# and the resistance decreases as the brightness of light falling

    on the !( increases. !(s or !ight (ependent esistors are very useful especially in

    light;dar" sensor circuits. Normally the resistance of an !( is very high, sometimes as high as

    %000 000 ohms, but when they are illuminated with light resistance drops dramatically.

    1multimetercan be used to find the resistance in dar"ness and bright light, these are the typical

    results for a standard !(&

    D,)&& ma>imum resistance, about %5 .

    http://www.kpsec.freeuk.com/multimtr.htmhttp://www.kpsec.freeuk.com/multimtr.htmhttp://www.kpsec.freeuk.com/multimtr.htm
  • 7/23/2019 Full Report - Automation of Car Add on Features

    46/66

    !&0 (

  • 7/23/2019 Full Report - Automation of Car Add on Features

    47/66

    /hen the light level is low the resistance of the !( is high. This prevents current from flowing

    to the base of the transistors. )onse=uently the !6( does not light.

    owever, when light shines onto the !( its resistance falls and current flows into the base of

    the first transistor and then the second transistor. The !6( lights.

    The preset resistor can be turned up or down to increase or decrease resistance, in this way it can

    ma"e the circuit more or less sensitive.

    4.2. TRANSISTORS

    Transistors ,-98('0 6&)*, for e>ample they can be used to amplify the small output

    current from a logic I) 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 ,-98('0 +8*,

  • 7/23/2019 Full Report - Automation of Car Add on Features

    48/66

    1 transistor may be used as a 5(*67either fully on with ma>imum current, or fully off

    with no current# and as an ,-98('(&always partly on#.

    The amount of current amplification is called the 6&)*

  • 7/23/2019 Full Report - Automation of Car Add on Features

    49/66

    The leads are labeled ,& '#, 6+88&6*+ )# and &-(**& 6#.

    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 labelsV

    1(arlington pairis two transistors connected together to give a very high current gain.

    In addition to standard bipolar junction#

    transistors, there are '(&8/=&''&6*

    *,)(*+which are usually referred to

    as FETs.

    C+))&6*()imum collector current.

    !CE-,. 5a>imum voltage across the collector-emitter junction.

    ou can ignore this rating in low voltage circuits.

    7FE This is the 6&)* ample D%00W*0m1D means the

    gain is at least %00 at *0m1. Sometimes minimum and ma>imum valuesare 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

    e>perts.

    "70 7FEIt is one of a whole series of parameters for transistors, each

    with their own symbol. There are too many to e>plain here.

    P*+*-,. 5a>imum total power which can be developed in the transistor, note that a

    heat sin" will be re=uired to achieve the ma>imum rating. This rating is

    important for transistors operating as amplifiers, the power is roughly I)X

    B)6. $or transistors operating as switches the ma>imum collector current

    I)ma>.# is more important.

    C,*&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    51/66

    case style so you will need to ta"e care when placing them on the circuit

    board.

    4.3. RELAY

    1 relay is an &8&6*(6,880 +9&,*&/ 5(*67. )urrent 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 /+8& *7+5 67,)ample a low voltage battery circuit can use a relay to switch a *?0B 1) mains

    circuit. There is no electrical connection inside the relay between the two circuits, the lin" is

    magnetic and mechanical.

    The coil of a relay passes a relatively large current, typically ?0m1 for a %*B relay, but it can be

    as much as %00m1 for relays designed to operate from lower voltages. 5ost I)s chips# cannot

    provide this current and a transistoris usually used to amplify the small I) current to the larger

    value re=uired for the relay coil. The ma>imum output current for the popular 444 timer I) is

    *00m1 so these devices can supply relay coils directly without amplification.

    elays are usually S(T or ((T but they can have many more sets of switch contacts, for

    e>ample relays with : sets of changeover contacts are readily available. $or further information

    about switch contacts and the terms used to describe them please see the page on switches.

    5ost relays are designed for )' mounting but you can solder wires directly to the pins

    providing you ta"e care to avoid melting the plastic case of the relay.

    The supplierDs catalogue should show you the relayDs connections. The coil will be obvious and it

    may be connected either way round. elay coils produce brief high voltage Dspi"esD when they

    are switched off and this can destroy transistors and I)s in the circuit. To prevent damage you

    must connect aprotection diode across the relay coil.

    http://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/components/switch.htmhttp://www.kpsec.freeuk.com/components/relay.htm#protecthttp://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/components/switch.htmhttp://www.kpsec.freeuk.com/components/relay.htm#protect
  • 7/23/2019 Full Report - Automation of Car Add on Features

    52/66

    The animated picture shows a wor"ing relay with its coil and switch contacts. ou 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 S(T# in the foreground and another behind them,

    ma"ing the relay ((T.

    S(T elay )ircuit symbol

    The relayDs switch connections are usually labelled )85, N) and N8&

    COMG )ommon, always connect to this, it is the moving part of the switch.

    NCG Normally )losed, )85 is connected to this when the relay coil is +''.

    NOG Normally 8pen, )85 is connected to this when the relay coil is +).

    )onnect to )85 and N8 if you want the switched circuit to be +) 57&) *7& &8,0 6+(8 (

    +).

    )onnect to )85 and N) if you want the switched circuit to be +) 57&) *7& &8,0 6+(8 (

    +''.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    53/66

    4.4. CAPACITOR

    F)6*(+)

    )apacitors store electric charge. They are used with resistors in timing circuitsbecause it ta"estime for a capacitor to fill with charge. They are used tosmoothvarying () supplies by acting as

    a reservoir of charge. They are also used in filter circuits because capacitors easily pass 1)

    changing# signals but they bloc" () constant# signals.

    C,9,6(*,)6&

    This is a measure of a capacitorDs ability to store charge. 1 large capacitance means that more

    charge can be stored. )apacitance is measured in farads, symbol $. owever %$ is very large, soprefi>es are used to show the smaller values.

    Three prefi>es multipliers# are used, Y micro#, n nano# and p pico#&

    Y means %0-9millionth#, so %000000Y$ G %$

    n means %0-3thousand-millionth#, so %000n$ G %Y$

    p means %0-%*million-millionth#, so %000p$ G %n$

    )apacitor values can be very difficult to find because there are many types of capacitor with

    different labelling systemsV

    There are many types of capacitor but they can be split into two groups, 9+8,(&/ and

    )9+8,(&/. 6ach group has its own circuit symbol.

    P+8,(@&/ 6,9,6(*+ >8,

  • 7/23/2019 Full Report - Automation of Car Add on Features

    54/66

    6>amples& )ircuit symbol&

    E8&6*+80*(6 C,9,6(*+

    6lectrolytic capacitors are polariAed and *7&0 -* & 6+))&6*&/ *7& 6+&6* 5,0 +)/, at

    least one of their leads will be mar"ed @ or -. They are not damaged by heat when soldering.

    There are two designs of electrolytic capacitorsJ ,(,8where the leads are attached to each end

    **0Y$ in picture# and ,/(,8where both leads are at the same end %0Y$ in picture#. adial

    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 =uite low 9B for e>ample# and it

    should always be chec"ed 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 projectDs power

    supply voltage. *4B is a sensible minimum for most battery circuits.

    U)9+8,(&/ 6,9,6(*+ >-,88 ,8& 9 *+ 1JF?

    6>amples& )ircuit symbol&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    55/66

    Small value capacitors are un-polariAed and may be connected either way round. They are not

    damaged by heat when soldering, e>cept for one unusual type polystyrene#. They have high

    voltage ratings of at least 40B, usually *40B 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 systemsV

    5any small value capacitors have their value printed but without a multiplier, so

    you need to use e>perience to wor" out what the multiplier should beV

    $or e>ample .1means 0.%Y$ G %00n$.

    Sometimes the multiplier is used in place of the decimal point&

    $or e>ample& 4)$means :.Cn$.

    C,9,6(*+ N-& C+/&

    1 number code is often used on small capacitors where printing is difficult&

    the %st number is the %st digit,

    the *nd number is the *nd digit,

    the ?rd number is the number of Aeros to give the capacitance in p$.

    Ignore any letters - they just indicate tolerance and voltage rating.

    $or e>ample& 12 means %000p$ G %n$ (not 102pF!)

    $or e>ample& 4$2means :C00p$ G :.Cn$ Z means 4E tolerance#.

    4.. LIGHT EMITTING DIODES >LEDS?

    6>ample& )ircuit symbol&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    56/66

    F)6*(+)

    !6(s emit light when an electric current passes through them.

    C+))&6*()< ,)/ +8/&()pensive than the other colours.

    The colour of an !6( is determined by the

    semiconductor material, not by the colouring of

    the Dpac"ageD the plastic body#. !6(s of all colours are available in uncoloured pac"ages which

    may be diffused mil"y# or clear often described as Dwater clearD#. The coloured pac"ages are

    also available as diffused the standard type# or transparent.

    C,868,*()< ,) LED &(*+ ,8&

    1n !6( must have a resistor connected in series to limit the

    current through the !6(, otherwise it will burn out almost

    instantly.

    The resistor value, is given by&

    R >!S= !L? I

    !SG supply voltage

    !LG !6( voltage usually *B, but :B for blue and white !6(s#

    IG !6( current e.g. %0m1 G 0.0%1, or *0m1 G 0.0*1#

    5a"e sure the !6( current you choose is less than the ma>imum permitted and 6+)&* *7&

    6&)* *+ ,-9 >A? so the calculation will give the resistor value in ohms #.

    To convert m1 to 1 divide the current in m1 by %000 because %m1 G 0.00%1.

    If the calculated value is not available choose the nearest standard resistor value which is

    ample# but this will

    ma"e the !6( less bright.

  • 7/23/2019 Full Report - Automation of Car Add on Features

    58/66

    F+ &,-98&

    If

    The supply voltage BSG 3B,

    ed !6( B!G *B#,

    e=uiring a current I G *0m1 G 0.0*01,

    G 3B - *B# ; 0.0*1 G ?40 , so choose ?30 the nearest standard value which is greater#.

    4.#. RESISTORS

    6>ample& )ircuit symbol&

    F)6*(+)

    esistors restrict the flow of electric current, for e>ample a resistor is placed

    in series with a light-emitting diode !6(# to limit the current passing

    through the !6(.

    C+))&6*()< ,)/ +8/&()D = D$?

    The 2-bit data pins, (0 - (C, are used to send information to the !)( or read the

    contents of the !)(s internal registers.

    To display letters and numbers, we send 1S)II codes for the letters 1 - O, a - A, and

    numbers 0 - 3 to these pins while ma"ing SG%.

    There are also instruction command codes that can be sent to the !)( to clear the display

    or force the cursor to the home position or blin" the cursor. Table %*-* lists the

    instruction command codes.

    /e also use S G 0 to chec" the busy flag bit to see if the !)( is ready to receive

    information. The busy flag is (C and can be read when ;/G% and S G 0, as follows& if

    ;/ G %, S G 0. /hen (C G % busy flag G %#, the !)( is busy ta"ing care of internal

    operations and will not accept any new information. /hen (C G 0, the !)( is ready to

    receive new information. Note& It is recommended to chec" the busy flag before writing

    any data to the !)(.

    4.$.2. T,8& +' P() D&6(9*(+) '+ LCD

  • 7/23/2019 Full Report - Automation of Car Add on Features

    63/66

    IN S5'8! I;8 (6S)ITI8N

    % BSS [[ Rround

    * B)) [[ @4B ower Supply

    ? B66 [[ ower Supply to )ontrol )ontrast

    : S I S G0 to select command egister

    SG% to select (ata egister

    4 ;/ I ;/G0 to /rite

    ;/G% to ead

    9 6 I;8 6nable

    C ('0 I;8 The 2 in (ata 'us

    2 ('% I;8 The 2 in (ata 'us

    3 ('* I;8 The 2 in (ata 'us

    %0 ('? I;8 The 2 in (ata 'us

    %% (': I;8 The 2 in (ata 'us

    %* ('4 I;8 The 2 in (ata 'us

    %? ('9 I;8 The 2 in (ata 'us

    %: ('C I;8 The 2 in (ata 'us

    4.$.3. T,8& LCD C+--,)/ C+/&

  • 7/23/2019 Full Report - Automation of Car Add on Features

    64/66

    C+/& C+--,)/ *+ LCD I)*6*(+)

    >H&? R&C matri>

    CHAPTER

  • 7/23/2019 Full Report - Automation of Car Add on Features

    65/66

    APPLICATIONS AD!ANTAGES

    .1. APPLICATIONS

    %. It automatically detects improper loc"ing and displays particular

    door loc"er is not properly loc"ed.

    *. (omestic applications

    ?. It can be employed even in industries, with slight modification in the circuits.

    .2. AD!ANTAGES

    %. Improper loc"ing is avoided

    *. Increases safety

    ?. 5ore comfortable in driving

    :. is" of human life is minimiAed

    CHAPTER #

    CONCLUSION FUTURE SCOPE

  • 7/23/2019 Full Report - Automation of Car Add on Features

    66/66

    #.1. CONCLUSION

    /e designed this project to ma"e comfortable journey in car with out any troubles. Fsing

    !( sensing circuit we controlled the car lighting system. 1nd if any door is unloc"ed, the

    display of particular door has shown with buAAer sound.

    /hen a particular door is unloc"ed releasing of limiting switch#, the controller showing the

    unloc"ed door. (uring night time travelling car head lights are controlled as per the opposite

    vehicle.

    #.2. FUTURE COPE

    In the future we can add wireless communication to this project in-order to "nown the

    accident information of vehicle. 1nd also car engine heat can be controlled to increase the life

    span of car engine.