automatic railway gate conrol system

Upload: pradeep

Post on 06-Jul-2018

251 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 Automatic Railway Gate Conrol System

    1/57

    AUTOMATIC RAILWAY GATE CONTROL

    PROJECT REPORT

    SUBMITTED IN PARTIAL FULFILLMENT OF REQUIREMENTS FOR THE

    AWARD OF THE DEGREE OF

    BACHLOR OF TECHNOLOGY

    IN

    ELECTRONICS AND COMMUNICATION ENGINEERING

    SUBMITTED TO

    SONEPAT

    BY

    UNDER THE SUPERVISION OF

    Mr.(ASSISTANT PROFESSOR, ECE dep r!"e#!

    DEPARTMENT OF ELECTRONICS AND COMMUNICATIONENGINEERING

  • 8/17/2019 Automatic Railway Gate Conrol System

    2/57

    AC$NOWLEDGEMENT

    I am highly grateful to my project guide Mr. Assistant Professor, ECE Department for

    his guidance during the course of the project. I take this opportunity to express my

    sincere and deep gratitude to him for helping me in carrying out the project work. I am

    thankful to him for gi ing me the necessary support for the completion of the project.

    !e are "lissful to pay our regards to him for his continual support and constructi e

    suggestion gi en during the course of this project.

    I would also like to thank our ######### for the facilities that he made a aila"le to thestudents of ECE Department.

    $A%E

    &.'ech (ECE)

  • 8/17/2019 Automatic Railway Gate Conrol System

    3/57

    CERTIFICATE

    'his is to certify that the project entitled %% AUTOMATIC RAILWAY GATECONTROL%% su"mitted "y NAME R&'' #&. in the partial fulfilment of the re*uirementfor the award of Degree of B )'&r &* Te )#&'&+ in Electronics and Communication

    Engineering Department at is an authentic work carried out "y the student under mysuper ision and guidance. 'he matter em"odied in this Project +eport su"mitted "y him isauthentic and has not "een su"mitted to any other uni ersity institute for the award of anydegree as per my knowledge.

    P+- EC' /0IDE

    Mr.A-- -! #! Pr&*e--&rECE Dep r!"e#!

    'his is to certify that the &.'ech 1i a#1ice examination of $A%E has "een held on

    dated................. and accepted the project for the award of the degree.

    Project Coordinator External Examiner Chairman

  • 8/17/2019 Automatic Railway Gate Conrol System

    4/57

    ABSTRACT

    Aim of this project is control the unmanned rail gate automatically

    using em"edded platform. 'oday often we see news papers ery often a"out the railwayaccidents happening at un# attended railway gates. Present project is designed to a oid

    such accidents if implemented in spirit.

    'his project utili2es two powerful I+ transmitter and two recei ers,

    one pair of transmitter and recei er is fixed at upside (from the train comes) at a le el

    higher than human "eing in exact alignment and similarly other pair is fixed at down side

    of the train direction sensor acti ation time is so adjusted "y calculating the time taken

    at a certain speed to cross at least one compartment of standard minimum si2e of the

    Indian railway, normally 3 seconds.

    'he sensors are fixed at 4555 meters on "oth sides of the gate, we

    call fore side sensor pair for common towards gate train, and aft side sensors for the train

    just Crosses the gate. !hen train cross the fore side sensor it gi es signal to the gate

    recei er to close the gate. 'he "u22er is acti ated to clear the gate area for dri ers a"out 3

    seconds. /ate motor is turned on in one direction and gate is closed, and stay closed till

    train crosses the gate and reaches aft side sensors when aft side recei er get acti ated

    motor turns in opposite direction and gate opens and motor stops .

    If there is any pro"lem in the gate means it will operate red signal on

    "oth side fro the dri er indication.

    'rain arri al and departure sensing can "e achie ed "y means of +elay

    techni*ues. !hen the wheels of the train mo es o er, "oth tracks are shorted to ground

    and this acts as a signal to microcontroller (67C34) indicating train arri al. +ED signal

    appears for the road user, once the train cuts the relay sensor placed "efore the 38ms

    "efore the gate .A "u22er is made on as a pre cautionary measure for the road users.

  • 8/17/2019 Automatic Railway Gate Conrol System

    5/57

    Chapter 1INTRODUCTION

  • 8/17/2019 Automatic Railway Gate Conrol System

    6/57

    INTRODUCTION

    Present project is designed using A'67C34 microcontroller to a oid

    railway accidents happening at unattended railway gates, if implemented in spirit. 'his

    project utili2es two powerful I+ transmitters and two recei ers9 one pair of transmitter

    and recei er is fixed at up side (from where the train comes) at a le el higher than a

    human "eing in exact alignment and similarly the other pair is fixed at down side of the

    train direction. :ensor acti ation time is so adjusted "y calculating the time taken at a

    certain speed to cross at least one compartment of standard minimum si2e of the Indian

    railway. !e ha e considered 3 seconds for this project. :ensors are fixed at 4km on "oth

    sides of the gate. !e call the sensor along the train direction as ;foreside sensor< and the

    other as ;aft side sensor

  • 8/17/2019 Automatic Railway Gate Conrol System

    7/57

    G !e C!r&' >

    +ailways "eing the cheapest mode of transportation are preferred o er all

    the other means .!hen we go through the daily newspapers we come across many

    railway accidents occurring at unmanned railway crossings. 'his is mainly due to the

    carelessness in manual operations or lack of workers. !e, in this project has come up

    with a solution for the same. 0sing simple electronic components we ha e tried to

    automate the control of railway gates. As a train approaches the railway crossing from

    either side, the sensors placed at a certain distance from the gate detects the approaching

    train and accordingly controls the operation of the gate. Also an indicator light has "een

    pro ided to alert the motorists a"out the approaching train.

    Tr / S0 ! ) #+1

    0sing the same principle as that for gate control, we ha e de eloped a concept of

    automatic track switching. Considering a situation wherein an express train and a local

    train are tra eling in opposite directions on the same track9 the express train is allowed to

    tra el on the same track and the local train has to switch on to the other track. Indicator

    lights ha e "een pro ided to a oid collisions .=ere the switching operation is performed

    using a stepper motor. In practical purposes this can "e achie ed using electromagnets.

    2.3 S &pe &* pr&4e !>

    'his project is de eloped in order to help the I$DIA$ +AI?!A@: in making its

    present working system a "etter one, "y eliminating some of the loopholes

    existing in it.

    &ased on the responses and reports o"tained as a result of the significant

    de elopment in the working system of I$DIA$ +AI?!A@:, this project can "efurther extended to meet the demands according to situation.

    'his can "e further implemented to ha e control room to regulate the working of

    the system. 'hus "ecomes the user friendliness.

  • 8/17/2019 Automatic Railway Gate Conrol System

    8/57

    'his circuit can "e expanded and used in a station with any num"er of platforms

    as per the usage.

    Additional modules can "e added with out affecting the remaining modules. 'his

    allows the flexi"ility and easy maintenance of the de eloped system.

    'his system consists of following features o er manual system>

    'here is no time lag to operate the de ice.

    Accuracy.

  • 8/17/2019 Automatic Railway Gate Conrol System

    9/57

    Chapter 2

    BLOC$ DIAGRAM AND

    GENERALDESCRIPTION

  • 8/17/2019 Automatic Railway Gate Conrol System

    10/57

    B'& / d +r " #d Ge#er ' de- r p!

    3.2 B'& / d +r " #!r&d5 !

    'his project uses A'67C34 microcontroller for programming and operation. And

    0?$ 55B dri er.

    'he &lock diagram consists of the power supply, which is of single#phase

    B51 ac. 'his should "e gi en to step down transformer to reduce the B51 ac oltage to

    lower alue. i.e., to 71 or 461 ac this alue depends on the transformer inner winding.'he output of the transformer is gi en to the rectifier circuit. 'his rectifier con erts ac

    oltage to dc oltage. &ut the oltage may consist of ripples or harmonics.

    'o a oid these ripples, the output of the rectifier is connected to filter. 'he filter

    thus remo es the harmonics. 'his is the exact dc oltage of the gi en specification. &ut

    the controller operates at 31 dc and the relays and dri er operates at 4 1 dc oltage. :o

  • 8/17/2019 Automatic Railway Gate Conrol System

    11/57

    the regulator is re*uired to reduce the oltage. +egulator 653 produces 31 dc and

    regulator 64 produces 4 1 dc. &oth are positi e oltages.

    'he supply from 653 regulator is used for the purpose of track changing which

    consists of a stepper motor dri en with 0?$ 55B the current dri er chip. 'he supply of

    4 is gi en to dri e the stepper motor for the purpose of gate control. 'hrough uln 55B

    2.2 Operation:

    ' his project utili2es two powerful I+ transmitters and two recei ers9 one pair

    of transmitter and recei er is fixed at up side (from where the train comes) at a le el

    higher than a human "eing in exact alignment and similarly the other pair is fixed at

    down side of the train direction. :ensor acti ation time is so adjusted "y calculating the

    time taken at a certain speed to cross at least one compartment of standard minimum si2e

    of the Indian railway. !e ha e considered 3 seconds for this project. :ensors are fixed at

    4km on "oth sides of the gate. !e call the sensor along the train direction as ;foreside

    sensor< and the other as ;aft side sensor

  • 8/17/2019 Automatic Railway Gate Conrol System

    12/57

    that within a certain delay, the train has passed the track is switched "ack to its original

    position, allowing the first train to pass without any interruption. 'his concept of track

    switching can "e applied at 4km distance from the stations.

    In this project Atmel 67c34 %icro controller Integrated Chip plays the main role.'he program for this project is em"edded in this %icro controller Integrated Chip and

    interfaced to all the peripherals. 'he timer program is inside the %icro controller IC to

    maintain all the functions as per the scheduled time. 'he ?i*uid crystal Display (?CD) is

    interfaced to Atmel 67c34 %icro controller to display the message, stepper motors are

    used for the purpose of gate control and track changing interfaced with current dri ers

    chip 0?$ 55B it

  • 8/17/2019 Automatic Railway Gate Conrol System

    13/57

    +ailways "eing the cheapest mode of transportation are preferred o er all the

    other means .!hen we go through the daily newspapers we come across many railway

    accidents occurring at unmanned railway crossings. 'his is mainly due to the carelessness

    in manual operations or lack of workers. !e, in this project ha e come up with a solution

    for the same. 0sing simple electronic components we ha e tried to automate the control

    of railway gates. As a train approaches the railway crossing from either side, the sensors

    placed at a certain distance from the gate detects the approaching train and accordingly

    controls the operation of the gate. Also an indicator light has "een pro ided to alert the

    motorists a"out the approaching train.

    'he a"o e figure shows the gate controlling unit "lock diagram. Its

    operation can "e explained through that.

    As the figure shows it consists of two pairs of infrared sensors placed at twosides of gate. 'hey should keep at a distance of 7 cm ( km in usual case) from the gate.

    and a stepper motor is used for the purpose of the gate closing and opening. Interfaced to

    the 0?$ 55B.

    !hen train reaches the sensor, it is detected "y I+ sensors placed 7 cm "efore the

    station and led in the sensor will glow "ecause the 333 timer works into *uasi state of

    operation. such that the I+ ?ED should glow till the timer works in *uasi state i.e., when

    train passes away the sensors it again into normal state then it recei es 3 at terminals

    that pin at the 67c34 terminal goes high which ena"les the power to the stepper motor to

    rotate in steps which dri es gate to close similarly when it reaches the second pair of

    sensors it senses and send the signal to the microcontroller to ena"le the current dri er to

    open the gate "y rotating the stepper motor in steps to get "ack in to original position.

    3.3.3 Tr / ) #+ #+ 5# !1

    0sing the same principle as that for gate control, we ha e de eloped a concept of

    automatic track switching. Considering a situation wherein an express train and a local

    train are tra eling in opposite directions on the same track9 the express train is allowed to

    tra el on the same track and the local train has to switch on to the other track. Indicator

  • 8/17/2019 Automatic Railway Gate Conrol System

    14/57

    lights ha e "een pro ided to a oid collisions .=ere the switching operation is performed

    using a stepper motor. In practical purposes this can "e achie ed using electromagnets.

    Hor the ease of description we are considering only two plat forms thus

    this can "e implemented to any num"er of platforms. !hen train reaches the platform

    "efore a 45cm distance apart a set of sensors are placed to detect the train and two pair of

    sensors are placed on each of track at platforms. !hen the train is at the first pair of

    sensors it sends a signal to microcontroller to know the a aila"ility of plat form. =ere

    after checking a aila"ility microcontroller operates stepper motor to change the track.

    'he mechanism is arranged as shown in fig. "ut in this case the track changing is done

    due to second sensor that used to open the gate. It consists of 3 dri en stepper motor,

    0?$ 55B current dri er chip and pulley for track changing mechanism.

    3.3.6 A##&5# e"e#! 5# !1

    0sually, announcement made at the station for the information of train arri al and

    departure. In this model we are using a "u22er for the announcement and ?CD for the purpose of display message. ?CD is interfaced to 67C34 microcontroller.

    'he announcement and display message is according to the second sensor which should

    "e used for the purpose of gate opening.

    3.3.6.2 Tr # rr 7 ' de!e ! >>

    Detection of train approaching the gate can "e sensed "y means of sensors

    +4, + , +B +G placed on either side of the gate. In particular direction of approach, +4

    is used to sense the arri al9 +B is used to sense the departure of the train. In the same way

    +G + senses arri al and departure in the other direction. 'rain arri al and departure

    sensing can "e achie ed "y means of relay techni*ue. A confined part of parallel track is

    supplied with positi e oltage and ground. As wheels of the train, is made up of

  • 8/17/2019 Automatic Railway Gate Conrol System

    15/57

    aluminum which is a conducting material, it shorts two parallel tracks. !hen the wheels

    of the train mo es o er it, "oth tracks are shorted to ground and this acts as a signal to

    microcontroller (67C34) indicating train arri al. 'he train detection in the other direction

    is done in the same way "y the sensors +4 +G. 'hese sensors are placed fi e

    kilometers "efore the gate.

    3.3.6.3 0 r# #+ *&r r& d 5-er-1 At that moment the train arri al is sensed on either of

    the gate, road users are warned a"out the train approach "y +ED signal placed to caution

    the road users passing through the gate .+ED signal appears for the road user, once the

    train cuts the relay sensor placed "efore the 38ms "efore the gate .A "u22er is for train,

    when there is any o"stacle9 signal is made +ED for train in order to slow done its speed

    "efore 3km from gate.

    3.3.6.6 Tr # dep r!5re de!e ! Detection of train is also done using relay techni*ues

    as explained the head of train arri al detection. :ensor +B + respecti ely considering

    direction of train approach do train departure.

    A message is displayed on ?CD when train reaches the platform. :ensed

    "y I+ sensors.

    F5!5re e#) # e"e#! > In our techni*ue though it has many merits, "ut still the power

    supply of B1 AC P-!E+ is re*uired for functioning of the motor. It can "e a oided

    with the help of a "attery charged "y a :olar Cell. :ince solar energy is an inexhausti"le

    natural source of energy.

    3.3.8 T0& !r #- &pp&- !e - "e !r /1

    !e know that the rate of accidents increasing day "y day, in this "ecause failure of

    mechanism at track changing two trains coming on same track. 'his can also happens

    some times due to human negligence. 'his can a oid "y using the following unmanned

    detection for two trains coming on same track case.

    In our model of project, we are using the gate controlling pair of sensors to

    execute this method. i.e., when two trains are coming same track at that location the two

  • 8/17/2019 Automatic Railway Gate Conrol System

    16/57

    sensors will operate at a time i.e., two 333 timers of circuit are dri en in to *uasi sta"le

    state and thus corresponding two "u22er will operate at a time and two I+ ?ED will

    operate and hence signal sends to micro processor to operate the stepper motor at tack

    changing.

    'he components that we use in order to execute are stepper motor 3 , 0?$ 55B,

    A'67C34 A$D I+ sensors.

    3.3.9 I# ! ' - +# ' d -p' 1

    :ignals are placed near gate each at a specified distance. 'rain may "e

    approaching gate at either direction so all four signals are made +ED initially to indicate

    gate is -PE$ED and ehicles are going through gate. 'he road user signals are made

    /+EE$ so that they freely mo e through gate. &u22er is -HH since there is no approachof train and users need not "e warned.

  • 8/17/2019 Automatic Railway Gate Conrol System

    17/57

    Chapter 3

    POWER SUPPLY

  • 8/17/2019 Automatic Railway Gate Conrol System

    18/57

    .1 Circuit Dia!ra" an# intro#uction:

    FIG1 6.2

    Power supply unit consists of following units

    i) :tep down transformer

    ii) +ectifier unit

    iii) Input filter

    i ) +egulator unit

    ) -utput filter

    6.31 STEPDOWN TRANSFORMER

    'he :tep down 'ransformer is used to step down the main supply oltage from

    B51 AC to lower alue. 'his B5 AC oltage cannot "e used directly, thus it is stepped

    down. 'he 'ransformer consists of primary and secondary coils. 'o reduce or step down

    the oltage, the transformer is designed to contain less num"er of turns in its secondary

  • 8/17/2019 Automatic Railway Gate Conrol System

    19/57

    core. 'he output from the secondary coil is also AC wa eform. 'hus the con ersion from

    AC to DC is essential. 'his con ersion is achie ed "y using the +ectifier Circuit 0nit.

    6.6. RECTIFIER UNIT1

    'he +ectifier circuit is used to con ert the AC oltage into its corresponding DC

    oltage. 'here are =alf#!a e, Hull#!a e and "ridge +ectifiers a aila"le for this specific

    function. 'he most important and simple de ice used in +ectifier circuit is the diode. 'he

    simple function of the diode is to conduct when forward "iased and not to conduct in

    re erse "ias.

    'he Horward &ias is achie ed "y connecting the diode

    FIG 6.2.3 :;

  • 8/17/2019 Automatic Railway Gate Conrol System

    20/57

    gets affected. 'hus this can "e successfully reduced here. 'he regulators are mainly

    classified for low oltage and for high oltage. Hurther they can also "e classified as>

    i) Positi e regulator

    4###J input pin

    ###J ground pin

    B###J output pin

    It regulates the positi e oltage.

    ii) $egati e regulator

    4###J ground pin

    ###J input pin

    B###J output pin

    It regulates the negati e oltage.

    6.= OUTPUT FILTER1

    'he Hilter circuit is often fixed after the +egulator circuit. Capacitor is most often

    used as filter. 'he principle of the capacitor is to charge and discharge. It charges during

    the positi e half cycle of the AC oltage and discharges during the negati e half cycle. :o

    it allows only AC oltage and does not allow the DC oltage. 'his filter is fixed after the

    +egulator circuit to filter any of the possi"ly found ripples in the output recei ed finally.

    =ere we used 5.4KH capacitor. 'he output at this stage is 31 and is gi en to the

    %icrocontroller.

  • 8/17/2019 Automatic Railway Gate Conrol System

    21/57

    Chapter 4IN$R%RED SENSORS

  • 8/17/2019 Automatic Railway Gate Conrol System

    22/57

    &.1.' intro#uction:

    'his infrared sensor also called as I+ sensors, consists of two parts>

    4. I+ transmitter circuit

    . I+ recei er unit

    'he transmitter unit consists of an infrared ?ED and its associated circuitry.

    =.2.2 IR Tr #-" !!er 5# !1

    'he I+ transmitter circuit is shown in the * +5re =.2.2 .

    'he transmitter circuit consists of the following components>

    4. IC 333

    . +esistors

    B. Capacitors

    G. I+ ?ED

  • 8/17/2019 Automatic Railway Gate Conrol System

    23/57

    'he I+ ?ED emitting infrared light is put on in the transmitting unit. 'o

    generate I+ signal, 333 IC "ased asta"le multi i"rator is used. Infrared ?ED is dri en

    through transistor &C 3G6.

    IC 333 is used to construct an asta"le multi i"rator which has two

    *uasi#sta"le states. It generates a s*uare wa e of fre*uency B6k=2 and amplitude 31olts.

    It is re*uired to switch ;-$< the I+ ?ED.

    =.2.3 IR Re e 7er r 5 !1

    'he I+ recei er circuit is shown in the * +5re =.2.3 .

    'he recei er circuit consists of the following components>

    4. ':-P4 B6 (sensor)

    . IC 333

    B. +esistors

    G. Capacitors

    'he recei er unit consists of a sensor and its associated circuitry. In recei er section, the

    first part is a sensor, which detects I+ pulses transmitted "y I+#?ED. !hene er a train

  • 8/17/2019 Automatic Railway Gate Conrol System

    24/57

    crosses the sensor, the output of I+ sensor momentarily transits through a low state. As a

    result the monosta"le is triggered and a short pulse is applied to the port pin of the 6534

    microcontroller. -n recei ing a pulse from the sensor circuit, the controller acti ates the

    circuitry re*uired for closing and opening of the gates and for track switching .

  • 8/17/2019 Automatic Railway Gate Conrol System

    25/57

    Chapter 5(%RDW%RE DESCRIPTION

  • 8/17/2019 Automatic Railway Gate Conrol System

    26/57

    E)*EDDED SYSTE)S

    +.1 intro#uction:

    A system is something that maintains its existence and functions as a whole

    through the interaction of its parts. E.g. &ody, Access Control, etc. An em"edded system

    is micro controller#"ased, software dri en, relia"le, real#time control system. %icro

    controllers and %icroprocessors are widely used in em"edded system products. An

    em"edded product uses a %icro controller to do one task only. A Printer is an example of

    em"edded system that it is getting the data and printing it.

    L Em"edded :ystem is a com"ination of hardware and software used to achie e a

    single specific task.

    L Em"edded systems are computer systems that monitor, respond to, or control an

    external en ironment.

    L En ironment connected to systems through sensors, actuators and other I -

    interfaces.

    L Em"edded system must meet timing other constraints imposed on it "y

    en ironment.

    =igh#end em"edded lower end em"edded systems. =igh#end em"edded system #

    /enerally B , G &it Controllers used with -:. Examples Personal Digital Assistant and

    %o"ile phones etc. ?ower end em"edded systems # /enerally 6,4 &it Controllers used

    with a minimal operating systems and hardware layout designed for the specific purpose.

    Examples :mall controllers and de ices in our e ery day life like !ashing %achine,

    %icrowa e - ens, where they are em"edded in.

  • 8/17/2019 Automatic Railway Gate Conrol System

    27/57

    M r& !r&''er

    :.3 #!r&d5 ! >

    A computer#on#a#chip is a ariation of a microprocessor, which com"ines the

    processor core (CP0), some memory, and I - (input output) lines, all on one chip. 'he

    computer#on#a#chip is called the microcomputer whose proper meaning is a computer

    using a (num"er of) microprocessor(s) as its CP0s, while the concept of the

    microcomputer is known to "e a microcontroller. A microcontroller can "e iewed as a

    set of digital logic circuits integrated on a single silicon chip. 'his chip is used for only

    specific applications.

    :.3.2 ADVANTAGES OF USING A MICROCONTROLLER OVER

    MICROPROCESSOR >

    A designer will use a %icrocontroller to

    4. /ather input from arious sensors

    . Process this input into a set of actions

    B. 0se the output mechanisms on the %icrocontroller to do something useful

    G. +A% and +-% are in"uilt in the %C.

    3. Cheap compared to %P.

    . %ulti machine control is possi"le simultaneously.

    Examples>

    6534, 67C34 (A'%A?), PIC (%icrochip), %otorola (%otorola), A+% Processor,

    Applications>

    Cell phones, Computers, +o"ots, Interfacing to two pc

  • 8/17/2019 Automatic Railway Gate Conrol System

    28/57

    ;> 92 M r& !r&''er IC

    'he A'67C34 is a low#power, high#performance C%-: 6#"it microcomputer with

    G8"ytes of Hlash programma"le and erasa"le read only memory (PE+-%). 'he de ice is

    manufactured using Atmel

  • 8/17/2019 Automatic Railway Gate Conrol System

    29/57

    :.3.3 P # de- r p! &* ATMEL A!;> 92 >

    $i!: +.2. 2

    'he A' 67c34 micro controller is a G5#pin IC. 'he G5th pin of the controller is 1cc pin

    and the 31 dc supply is gi en to this pin. 'his 5 th pin is ground pin. A 4 %=M crystal

    oscillator is connected to 46 th and 47 th pins of the A' 67c34 micro controller and two pf

    capacitors are connected to ground from 46 th and 47 th pins. 'he 7 th pin is +eset pin.

  • 8/17/2019 Automatic Railway Gate Conrol System

    30/57

    P&r! <

    Port 5 is an 6#"it open#drain "i#directional I - port. As an output port, each pin can sink

    eight ''? inputs. !hen 4s are written to port 5 pins, the pins can "e used as high

    impedance inputs. Port 5 may also "e configured to "e the multiplexed low order

    address data "us during accesses to external program and data memory. In this mode P5

    has internal pull#ups. Port 5 also recei es the code "ytes during Hlash programming, and

    outputs the code "ytes during program erification. External pull#ups are re*uired during

    program erification.

    P&r! 2

    Port 4 is an 6#"it "i#directional I - port with internal pull#ups. 'he Port 4 output "uffers

    can sink source four ''? inputs. !hen 4s are written to Port 4 pins they are pulled high

    "y the internal pull#ups and can "e used as inputs. As inputs, Port 4 pins that are

    externally "eing pulled low will source current (II?) "ecause of the internal pull#ups. Port

    4 also recei es the low#order address "ytes during Hlash programming and erification.

    P&r! 3

    Port is an 6#"it "i#directional I - port with internal pull#ups. 'he Port output "uffers

    can sink source four ''? inputs. !hen 4s are written to Port pins they are pulled high

    "y the internal pull#ups and can "e used as inputs. As inputs Port pins that are externally

    "eing pulled low will source current (II?) "ecause of the internal pull#ups. Port emits

    the high#order address "yte during fetches from external program memory and during

    accesses to external data memory that uses 4 #"it addresses (%-1N O DP'+). In thisapplication, it uses strong internal pull#ups when emitting 4s. During accesses to external

    data memory that uses 6#"it addresses (%-1N O +I), Port emits the contents of the P

    :pecial Hunction +egister. Port also recei es the high#order address "its and some

    control signals during Hlash programming and erification.

  • 8/17/2019 Automatic Railway Gate Conrol System

    31/57

    P&r! 6

    Port B is an 6#"it "i#directional I - port with internal pull#ups. 'he Port B output "uffers

    can sink source four ''? inputs. !hen 4s are written to Port B pins they are pulled high

    "y the internal pull#ups and can "e used as inputs. As inputs, Port B pins that are

    externally "eing pulled low will source current (II?) "ecause of the pull#ups. Port B also

    ser es the functions of arious special features of the A'67C34 as listed "elow>

    P&r! P # A'!er# !e F5# ! -

    PB.5 +ND (serial input port)

    PB.4 'ND (serial output port)

    PB. I$'5 (external interrupt 5)

    PB.B I$'4 (external interrupt 4)

    PB.G '5 (timer 5 external input)

    PB.3 '4 (timer 4 external input)

    PB. !+ (external data memory write stro"e)

    PB. +D (external data memory read stro"e)

    Port B also recei es some control signals for Hlash programming and erification.

    RSTReset input. A high on this pin for two machine cycles while the oscillator is

    running resets the device.

  • 8/17/2019 Automatic Railway Gate Conrol System

    32/57

    ALE?PROG

    Address ?atch Ena"le output pulse for latching the low "yte of the address during

    accesses to external memory. 'his pin is also the program pulse input (P+-/) during

    Hlash programming. In normal operation A?E is emitted at a constant rate of 4 the

    oscillator fre*uency, and may "e used for external timing or clocking purposes. $ote,

    howe er, that one A?E pulse is skipped during each access to external Data %emory. If

    desired, A?E operation can "e disa"led "y setting "it 5 of :H+ location 6E=. !ith the "it

    set, A?E is acti e only during a %-1N or %-1C instruction. -therwise, the pin is

    weakly pulled high. :etting the A?E#disa"le "it has no effect if the micro controller is in

    external execution mode.

    PSEN

    Program :tore Ena"le is the read stro"e to external program memory. !hen the A'67C34

    is executing code from external program memory, P:E$ is acti ated twice each machine

    cycle, except that two P:E$ acti ations are skipped during each access to external data

    memory.

    EA?VPP

    External Access Ena"le. EA must "e strapped to /$D in order to ena"le the de ice to

    fetch code from external program memory locations starting at 5555= up to HHHH=. $ote, howe er, that if lock "it 4 is programmed, EA will "e internally latched on reset.

    EA should "e strapped to 1CC for internal program executions. 'his pin also recei es the

    4 # olt programming ena"le oltage (1PP) during Hlash programming, for parts that

    re*uire 4 # olt 1PP.

  • 8/17/2019 Automatic Railway Gate Conrol System

    33/57

    @TAL2

    Input to the in erting oscillator amplifier and input to the internal clock operating

    circuit.

    @TAL3

    It is the output from the in erting oscillator amplifier.

  • 8/17/2019 Automatic Railway Gate Conrol System

    34/57

    Rela, #ri-er

    +. intro#uction:

    * +1 :.6.< IC, ULN3$P$

    • 'ransistors, $o. of>

    • Case :tyle>DIP#4

    • 'emp, -p. %in># 5 C

    • 'emp, -p. %ax>63 C

    • &ase $um"er> 55B

    • Channels, $o. of>

    • Current, -utput %ax>355mA

    • De ice %arking>0?$ 55BA

    • IC /eneric $um"er> 55B

    • Input 'ype>''?, C%-: 31

    • ?ogic Hunction $um"er> 55B

    • -utput 'ype> -pen Collector

    • 'ransistor 'ype> Power Darlington• 1oltage, Input %ax>31

    • 1oltage, -utput %ax>351

  • 8/17/2019 Automatic Railway Gate Conrol System

    35/57

    7.3.1 PIN CONNECTIONS OF ULN2003:

    Fig: 7.3.1

    'he 0?$ 554A, 0?$ 55 A, 0?$ 55B and 0?$ 55GAare high 1oltage, high

    current Darlington arrays each containing se en open collector Darlington pairs with

    common emitters. Each channel rated at 355mAand can withstand peak currents of

    55mA.:uppressiondiodesare included for inducti e load dri ing and the inputs are

    pinned opposite the outputs to simplify "oard layout.

    'hese ersatile de ices are useful for dri ing a wide range of loads

    including solenoids, relays DC motors9 ?ED displays filament lamps, thermal print heads

    and high power "uffers. 'he 0?$ 554A 55 A 55BA and 55GA are supplied in 4 pin

    plastic DIP packages with a copper lead frame to reduce thermal resistance. 'hey are

    a aila"le also in small outline package (:-#4 ) as 0?$ 554D 55 D 55BD 55GD.

  • 8/17/2019 Automatic Railway Gate Conrol System

    36/57

    +. .2 Sc/e"atic o0 Darlin!ton pair:

    $i!: +. .2

    Darlington pairs are "ack to "ack connection of two transistors with some

    source resistors .

    $i!:+. . shows the Darlington pair connection of transistor.

    'he circuit a"o e is a ;Darlington Pair< dri er. 'he first transistor

  • 8/17/2019 Automatic Railway Gate Conrol System

    37/57

    and when they are arranged as shown in the circuit they are used to amplify weak signals.

    'he amount "y which the w eak signal is amplified is called the !A"#$. .

    +. . FEATURES OF DRIVER1• :e en Darlington

    • Asta"le # producing a s*uare wa e

    • %onosta"le # producing a single pulse when triggered

    • &ista"le # a simple memory which can "e set and reset

    http://www.kpsec.freeuk.com/555timer.htm#astablehttp://www.kpsec.freeuk.com/555timer.htm#monostablehttp://www.kpsec.freeuk.com/555timer.htm#bistablehttp://www.kpsec.freeuk.com/555timer.htm#monostablehttp://www.kpsec.freeuk.com/555timer.htm#bistablehttp://www.kpsec.freeuk.com/555timer.htm#astable

  • 8/17/2019 Automatic Railway Gate Conrol System

    38/57

    • &uffer # an in erting "uffer (:chmitt trigger)

    I#p5!- &* 999 >

    'rigger input> when S 4 B 1s (Racti e lowR) this makes the output high (Q1s). It monitors

    the discharging of the timing capacitor in an asta"le circuit. It has a high input impedance

    J % .

    'hreshold input > when J B 1s (Racti e highR) this makes the output low (51)T. It

    monitors the charging of the timing capacitor in asta"le and monosta"le circuits. It has a

    high input impedance J 45% .

    T pro iding the trigger input is J 4 B 1s, otherwise the trigger input will o erride the

    threshold input and hold the output high (Q1s).

    +eset input> when less than a"out 5. 1 (Racti e lowR) this makes the output low (51),

    o erriding other inputs. !hen not re*uired it should "e connected to Q1s. It has an input

    impedance of a"out 45k .

    Control input> this can "e used to adjust the threshold oltage which is set internally to "e

    B 1s. 0sually this function is not re*uired and the control input is connected to 51 with

    a 5.54KH capacitor to eliminate electrical noise. It can "e left unconnected if noise is not a

    pro"lem.

    'he discharge pin is not an input, "ut it is listed here for con enience. It is connected to

    51 when the timer output is low and is used to discharge the timing capacitor in asta"le

    and monosta"le circuits.

    O5!p5! &* 999

    'he output of a standard 333 or 33 can sink and source up to 55mA. 'his is more than

    most ICs and it is sufficient to supply many output transducers directly, including ?ed

  • 8/17/2019 Automatic Railway Gate Conrol System

    39/57

    protection). 'he output oltage does not *uite reach 51 and Q1s, especially if a large

    current is flowing.

    'o switch larger currents you can connect a transistor.

    'he a"ility to "oth sink and source current means that two de ices can "e connected to

    the output so that one is on when the output is low and the other is on when the output is

    high. 'he top diagram shows two ?ed the output is continually changing "etween RlowR and RhighR.

    'he time period (') of the s*uare wa e is the time for one complete cycle, "ut it is

    usually "etter to consider fre*uency (f) which is the num"er of cycles per second.

    ' U 5. V (+4 Q + ) V C4 and f U4.G

    (+4 Q + ) V C4

    ' U time period in seconds (s)

    f U fre*uency in hert2 (=2)

    +4 U resistance in ohms ( )

    + U resistance in ohms ( )

    C4 U capacitance in farads (H)

    'he time period can "e split into two parts> ' U 'm Q 's

    %ark time (output high)> 'm U 5. V (+4 Q + ) V C4

    :pace time (output low)> 's U 5. V + V C4

    http://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/projects/levelc.htmhttp://www.kpsec.freeuk.com/acdc.htm#propshttp://www.kpsec.freeuk.com/acdc.htm#propshttp://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/projects/levelc.htmhttp://www.kpsec.freeuk.com/acdc.htm#propshttp://www.kpsec.freeuk.com/acdc.htm#props

  • 8/17/2019 Automatic Railway Gate Conrol System

    40/57

    %any circuits re*uire 'm and 's to "e almost e*ual9 this is achie ed if + is much larger

    than +4.

    fig

    * + :.8.2

    Hor a standard asta"le circuit 'm cannot "e less than 's, "ut this is not too restricting

    "ecause the output can "oth sink and source current. Hor example an ?ED can "e made to

    flash "riefly with long gaps "y connecting it (with its resistor) "etween Q1s and the

    output. 'his way the ?ED is on during 's, so "rief flashes are achie ed with +4 larger

    than + , making 's short and 'm long. If 'm must "e less than 's a diode can "e added

    to the circuit as explained under duty cycle "elow.

    Choosing +4, + and C4

    +4 and + should "e in the range 4k to 4% . It is "est to choose C4 first "ecause

    capacitors are a aila"le in just a few alues.

    • Choose C4 to suit the fre*uency range you re*uire (use the ta"le as a guide).

    • Choose + to gi e the fre*uency (f) you re*uire. Assume that +4 is much smaller

    than + (so that 'm and 's are almost e*ual), then you can use>

    + U5.

    f V C4• Choose +4 to "e a"out a tenth of + (4k min.) unless you want the mark time

    'm to "e significantly longer than the space time 's.

    http://www.kpsec.freeuk.com/555timer.htm#dutycyclehttp://www.kpsec.freeuk.com/555timer.htm#dutycyclehttp://www.kpsec.freeuk.com/555timer.htm#dutycyclehttp://www.kpsec.freeuk.com/555timer.htm#dutycycle

  • 8/17/2019 Automatic Railway Gate Conrol System

    41/57

    • If you wish to use a aria"le resistor it is "est to make it + .

    • If +4 is aria"le it must ha e a fixed resistor of at least 4k in series

    (this is not re*uired for + if it is aria"le).

    A-! 'e &per !

    !ith the output high (Q1s) the capacitor C4 is charged "y current flowing through +4

    and + . 'he threshold and trigger inputs monitor the capacitor oltage and when it

    reaches B1s (threshold oltage) the output "ecomes low and the discharge pin is

    connected to 51.

    'he capacitor now discharges with current flowing through + into the discharge pin.

    !hen the oltage falls to 4 B1s (trigger oltage) the output "ecomes high again and the

    discharge pin is disconnected, allowing the capacitor to start charging again.

    'his cycle repeats continuously unless the reset input is connected to 51 which forces theoutput low while reset is 51.

    An asta"le can "e used to pro ide the clock signal for circuits such as counters.

    A low fre*uency asta"le (S 45=2) can "e used to flash an ?ED on and off, higher fre*uency flashes are too fast to "e seen clearly. Dri ing a loudspeaker or pie2otransducer with a low fre*uency of less than 5=2 will produce a series of RclicksR (onefor each low high transition) and this can "e used to make a simple metronome.

    An audio fre*uency asta"le ( 5=2 to 5k=2) can "e used to produce a sound from aloudspeaker or pie2o transducer. 'he sound is suita"le for "u22es and "eeps. 'he natural(resonant) fre*uency of most pie2o transducers is a"out Bk=2 and this will make them

    produce a particularly loud sound.

    D5! 'e'he duty cycle of an asta"le circuit is the proportion of the complete cycle for which the

    output is high (the mark time). It is usually gi en as a percentage.Hor a standard 333 33 asta"le circuit the mark time ('m) must "e greater than the spacetime ('s), so the duty cycle must "e at least 35W>

  • 8/17/2019 Automatic Railway Gate Conrol System

    42/57

    %uty cycle &T"

    3R1 4 R2

    T" 4 T R1 4 2R2

    'o achie e a duty cycle of less than 35W a diode can "e added in parallel with + asshown in the diagram. 'his "ypasses + during the charging (mark) part of the cycle sothat 'm depends only on +4 and C4>

    'm U 5. V +4 V C4 (ignoring 5. 1 across diode)'s U 5. V + V C4 (unchanged)

    duty cycle with diode U'm

    U+4

    'm Q 's +4 Q +A monosta"le circuit produces a single output pulse when triggered. It is called a

    monosta"le "ecause it is sta"le in just one state> Routput lowR. 'he Routput highR state istemporary.

    'he duration of the pulse is called the time period (') and this is determined "y resistor +4 and capacitor C4>

    time period, ' U 4.4 V +4 V C4

    ' U time period in seconds (s)+4 U resistance in ohms ( )

    C4 U capacitance in farads (H)'he maximum relia"le time period is a"out 45 minutes.

    • Choose C4 first (there are relati ely few alues a aila"le).

    • Choose +4 to gi e the time period you need. +4 should "e in the range 4k to4% , so use a fixed resistor of at least 4k in series if +4 is aria"le.

    &eware that electrolytic capacitor alues are not accurate9 errors of at least 5Ware common.• &eware that electrolytic capacitors leak charge which su"stantially increases the

    time period if you are using a high alue resistor # use the formula as only a eryrough guideX

  • 8/17/2019 Automatic Railway Gate Conrol System

    43/57

    :.8.3.2 M&-! 'e &per ! 'he timing period is triggered (started) when the trigger input (333 pin ) is less than4

    B 1s, this makes the output high (Q1s) and the capacitor C4 starts to charge throughresistor +4. -nce the time period has started further trigger pulses are ignored.

    'he threshold input (333 pin ) monitors the oltage across C4 and when this reachesB 1s the time period is o er and the output "ecomes low. At the same time discharge

    (333 pin ) is connected to 51, discharging the capacitor ready for the next trigger.

    'he reset input (333 pin G) o errides all other inputs and the timing may "e cancelled atany time "y connecting reset to 51, this instantly makes the output low and discharges thecapacitor. If the reset function is not re*uired the reset pin should e connected to Q1s.

    7.4.3 Inverting Buffer (S !"itt trigger# $r NOT g%te

    the "uffer circuitRs input has a ery high impedance (a"out 4% ) so it re*uires only a fewKA, "ut the output can sink or source up to 55mA. 'hisena"les a high impedance signal source (such as an ?D+) toswitch a low impedance output transducer (such as a lamp).

    It is an in erting "uffer or $-' gate "ecause the output

    logic state (low high) is the in erse of the input state>

    • Input low (S 4 B 1s) makes output high, Q1s• Input high (J B 1s) makes output low, 51

    !hen the input oltage is "etween 4 B and B 1s the output remains in its present state.

    'his intermediate input region is a dead space where there is no response, a property

    called hysteresis, it is like "acklash in a mechanical linkage. 'his type of circuit is called

    a :chmitt trigger.

    If high sensiti ity is re*uired the hysteresis is a pro"lem, "ut in many circuits it is a

    helpful property. It gi es the input a high immunity to noise "ecause once the circuit

    output has switched high or low the input must change "ack "y at least 4 B 1s to make the

    output switch "ack.

    555 inverting 'uffer circuit(a #)* gate+

    #)* gate sym'ol

    http://www.kpsec.freeuk.com/gates.htm#nothttp://www.kpsec.freeuk.com/gates.htm#not

  • 8/17/2019 Automatic Railway Gate Conrol System

    44/57

    7.4.5 555 timer to modulate infrared (IR) light

    An I+ emitter is going to "e modulated using an asta"le 333 timer in this electronics

    exercise. 'he I+ emitter needs to "e modulated "y a fre*uency of B6 k=2 since the

    detector used in this exercise only detects B6 k=2 modulated I+. 'he detector is set toonly see B6 k=2 modulated I+ "ecause there are random I+ sources such as o erhead

    lights, the sun, heaters, etc. in most en ironments that can cause interference if using un#

    modulated I+.

    'he following two circuits shown in Hig.G and Hig. 3 are modulated I+

    transmitter and recei ers. Each circuit should "e soldered on separate proto#"oards.

    1erify with the 'A that e erything is soldered correctly. 'hen apply

    power to the transmitter circuit. 0se an oscilloscope to o"ser e the signal at node A.

    Adjust the 45kY aria"le resistor until the signal at node A is a B6 k=2 series of pulses.

    Apply power to the recei er circuit Point the I+ light emitting diode (?ED) on the

    transmitter to the detector on the recei er. !hen the push"utton is depressed the isi"le

    ?ED on the recei er should "link. If the isi"le led is "linking randomly, put exposed B3

    mm camera film around the I+ detect

    Stepper "otor

    +.5.1 De cription:

    A stepper motor (or step motor) is a "rushless , synchronous electric motor that

    can di ide a full rotation into a large num"er of steps. 'he motorRs position can "e

    controlled precisely, without any feed"ack mechanism (see open loop control). :tepper motors are similar to switched reluctance motors (which are ery large stepping motors

    with a reduced pole count, and generally are closed#loop commutated).

    http://en.wikipedia.org/wiki/Brushless_DC_electric_motorhttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Open_loophttp://en.wikipedia.org/wiki/Reluctance_motorhttp://en.wikipedia.org/wiki/Brushless_DC_electric_motorhttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Open_loophttp://en.wikipedia.org/wiki/Reluctance_motor

  • 8/17/2019 Automatic Railway Gate Conrol System

    45/57

    F + :.9.2.2

    7.5.2 Fundamentals of Operation

    :tepper motors operate differently from normal DC motors, which rotate when oltage is

    applied to their terminals. :tepper motors, on the other hand, effecti ely ha e multiple

    ZtoothedZ electromagnets arranged around a central gear#shaped piece of iron. 'he

    electromagnets are energi2ed "y an external control circuit, such as a microcontroller. 'o

    make the motor shaft turn, first one electromagnet is gi en power, which makes the gearRs

    teeth magnetically attracted to the electromagnetRs teeth. !hen the gearRs teeth are thus

    aligned to the first electromagnet, they are slightly offset from the next electromagnet. :o

    when the next electromagnet is turned on and the first is turned off, the gear rotates

    slightly to align with the next one, and from there the process is repeated. Each of thoseslight rotations is called a Zstep,Z with an integral num"er of steps making a full rotation.

    In that way, the motor can "e turned "y a precise angle.

    7.5.3 Stepper motor characteristics

    :tepper motors are constant power de ices. As motor speed increases, tor*ue decreases.

    'he tor*ue cur e may "e extended "y using current limiting dri ers and increasing the

    dri ing oltage. :teppers exhi"it more i"ration than other motor types, as the discrete

    step tends to snap the rotor from one position to another. 'his i"ration can "ecome ery

    "ad at some speeds and can cause the motor to lose tor*ue. 'he effect can "e mitigated "y

    accelerating *uickly through the pro"lem speed range, physically damping the system, or

    using a micro#stepping dri er. %otors with a greater num"er of phases also exhi"it

    smoother operation than those with fewer phases.

  • 8/17/2019 Automatic Railway Gate Conrol System

    46/57

    7.5.4 Open-loop versus closed-loop commutation

    :teppers are generally commutated open loop, i.e. the dri er has no feed"ack on where

    the rotor actually is. :tepper motor systems must thus generally "e o er engineered,

    especially if the load inertia is high, or there is widely arying load, so that there is no possi"ility that the motor will lose steps. 'his has often caused the system designer to

    consider the trade#offs "etween a closely si2ed "ut expensi e ser omechanism system

    and an o ersi2ed "ut relati ely cheap stepper.

    A new de elopment in stepper control is to incorporate a rotor position feed"ack (eg. an

    encoder or resol er ), so that the commutation can "e made optimal for tor*ue generation

    according to actual rotor position. 'his turns the stepper motor into a high pole count

    "rushless ser o motor, with exceptional low speed tor*ue and position resolution. An

    ad ance on this techni*ue is to normally run the motor in open loop mode, and only enter

    closed loop mode if the rotor position error "ecomes too large ## this will allow the

    system to a oid hunting or oscillating, a common ser o pro"lem.

    7.5.5 Types

    'here are three main types of stepper motors>

    • Permanent %agnet :tepper

    • =y"rid :ynchronous :tepper

    • 1aria"le +eluctance :tepper

    Two-phase stepper motors

    *here are two 'asic winding arrangements for the electromagnetic coils in atwo phase stepper motor, 'ipolar and unipolar.

    http://en.wikipedia.org/wiki/Servomechanismhttp://en.wikipedia.org/wiki/Encoderhttp://en.wikipedia.org/wiki/Resolverhttp://en.wikipedia.org/wiki/Servomechanismhttp://en.wikipedia.org/wiki/Encoderhttp://en.wikipedia.org/wiki/Resolver

  • 8/17/2019 Automatic Railway Gate Conrol System

    47/57

    U# p&' r "&!&r-

    A unipolar stepper motor has logically two windings per phase, one for each direction of

    magnetic field. :ince in this arrangement a magnetic pole can "e re ersed without

    switching the direction of current, the commutation circuit can "e made ery simple (e.g.

    a single transistor) for each winding. 'ypically, gi en a phase, one end of each winding is

    made common> gi ing three leads per phase and six leads for a typical two phase motor.

    -ften, these two phase commons are internally joined, so the motor has only fi e leads.

    F + :.9.9.< Unipolar tepper "otor coil

    In the construction of unipolar stepper motor there are four coils. -ne end of each coil istide together and it gi es common terminal which is always connected with positi eterminal of supply. 'he other ends of each coil are gi en for interface. :pecific color code may also "e gi en. ?ike in my motor orange is first coil (?4), "rown is second (? ),yellow is third (?B), "lack is fourth (?G) and red for common terminal.

    &y means of controlling a stepper motor operation we can

    4. Increase or decrease the +P% (speed) of it. Increase or decrease num"er of re olutions of it

    B. Change its direction means rotate it clockwise or anticlockwise

    'o ary the +P% of motor we ha e to ary the P+H (Pulse +epetition Hre*uency). $um"er of applied pulses will ary num"er of rotations and last to change direction weha e to change pulse se*uence.

    :o all these three things just depends on applied pulses. $ow there are three differentmodes to rotate this motor

    4. :ingle coil excitation. Dou"le coil excitation

    B. half coil excitation

  • 8/17/2019 Automatic Railway Gate Conrol System

    48/57

    0nipolar stepper motors with six or eight wires may "e dri en using "ipolar dri ers "y

    lea ing the phase commons disconnected, and dri ing the two windings of each phase

    together [diagram needed\. It is also possi"le to use a "ipolar dri er to dri e only one

    winding of each phase, lea ing half of the windings unused [diagram needed\.

    B p&' r "&!&r

    &ipolar motors ha e logically a single winding per phase. 'he current in a winding needs

    to "e re ersed in order to re erse a magnetic pole, so the dri ing circuit must "e more

    complicated, typically with an =#"ridge arrangement. 'here are two leads per phase,

    none are common.

    :tatic friction effects using an =#"ridge ha e "een o"ser ed with certain dri e topologies

    &ecause windings are "etter utili2ed, they are more powerful than a unipolar motor of the

    same weight.

    ; 'e d -!epper

    An 6 lead stepper is wound like a unipolar stepper, "ut the leads are not joined to

    common internally to the motor. 'his kind of motor can "e wired in se eral

    configurations>

    • 0nipolar.

    • &ipolar with series windings. 'his gi es higher inductance "ut lower current per

    winding.• &ipolar with parallel windings. 'his re*uires higher current "ut can perform "etter

    as the winding inductance is reduced.

    • &ipolar with a single winding per phase. 'his method will run the motor on only

    half the a aila"le windings, which will reduce the a aila"le low speed tor*ue "ut

    re*uire less current.

    http://en.wikipedia.org/wiki/H-bridgehttp://en.wikipedia.org/wiki/H-bridge

  • 8/17/2019 Automatic Railway Gate Conrol System

    49/57

    7.5.6 Theory

    A step motor can "e iewed as a synchronous AC motor with the num"er of poles (on

    "oth rotor and stator) increased, taking care that they ha e no common denominator.

    Additionally, soft magnetic material with many teeth on the rotor and stator cheaplymultiplies the num"er of poles (reluctance motor). %odern steppers are of hy"rid design,

    ha ing "oth permanent magnets and soft iron cores.

    'o achie e full rated tor*ue, the coils in a stepper motor must reach their full rated

    current during each step. !inding inductance and re erse E%H generated "y a mo ing

    rotor tend to resist changes in dri e current, so that as the motor speeds up, less and less

    time is spent at full current ## thus reducing motor tor*ue. As speeds further increase, the

    current will not reach the rated alue, and e entually the motor will cease to produce

    tor*ue.

    P5'' # !&r 5e

    'his is the measure of the tor*ue produced "y a stepper motor when it is operated without

    an acceleration state. At low speeds the stepper motor can synchroni2e itself with an

    applied step fre*uency, and this Pull#In tor*ue must o ercome friction and inertia.

    P5'' &5! !&r 5e

    'he stepper motor Pull#-ut tor*ue is measured "y accelerating the motor to the desired

    speed and then increasing the tor*ue loading until the motor stalls or Zpulls -ut of

    synchronismZ with the step fre*uency. 'his measurement is taken across a wide range of

    speeds and the results are used to generate the stepper motorRs dynamic performance

    cur e. As noted "elow this cur e is affected "y dri e oltage, dri e current and current

    switching techni*ues. It is normally recommended to use a safety factor of "etween 35Wand 455W when comparing your desired tor*ue output to the pu"lished Zpull#-utZ tor*ue

    performance cur e of a step motor.

    http://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Current_(electricity)

  • 8/17/2019 Automatic Railway Gate Conrol System

    50/57

    De!e#! !&r 5e

    :ynchronous electric motors using permanent magnets ha e a remnant position holding

    tor*ue (called detent tor*ue, and sometimes included in the specifications) when not

    dri en electrically. :oft iron reluctance cores do not exhi"it this "eha ior.

    Stepper motor ratings and specifications

    :tepper motors nameplates typically gi e only the winding current and occasionally the

    oltage and winding resistance. 'he rated oltage will produce the rated winding current

    at DC> "ut this is mostly a meaningless rating, as all modern dri ers are current limiting

    and the dri e oltages greatly exceed the motor rated oltage.

    A stepperRs low speed tor*ue will ary directly with current. =ow *uickly the tor*ue falls

    off at faster speeds depends on the winding inductance and the dri e circuitry it is

    attached to, especially the dri ing oltage.

    :teppers should "e si2ed according to pu"lished tor*ue cur e, which is specified "y the

    manufacturer at particular dri e oltages and or using their own dri e circuitry. It is not

    guaranteed that you will achie e the same performance gi en different dri e circuitry, so

    the pair should "e chosen with great care.

    :.9.: RPM ' 5' !

    -ne can calculate the exact +P% at which motor will run. !e know that motor needs 55 pulses to complete 4 re olution. %eans if 55 pulses applied in 4 second motor willcomplete 4 re olution in 4 second. $ow 4 re . in 4 sec means 5 re . in 4 minute. 'hatwill gi e us 5 +P%. $ow 55 pulses in 4 sec means the P+H is 55 =2. And delay will

    "e 3 milli second (ms). $ow let

  • 8/17/2019 Automatic Railway Gate Conrol System

    51/57

    Computer#controlled stepper motors are one of the most ersatile forms of positioningsystems . 'hey are typically digitally controlled as part of an open loop system, and aresimpler and more rugged than closed loop ser o systems.

    Industrial applications are in high speed pick and place e*uipment and multi#axis

    machine C$C machines often directly dri ing lead screws or "all screws . In the field of lasers and optics they are fre*uently used in precision positioning e*uipment such aslinear actuators , linear stages, rotation stages , goniometers , and mirror mounts. -ther uses are in packaging machinery, and positioning of al e pilot stages for fluid controlsystems.

    Commercially, stepper motors are used in floppy disk dri es , flat"ed scanners , computer printers , plotters and many more de ices.

    E" edded C C&"p 'er >

    A$:I C # full featured and porta"le

    +elia"le # mature, field#pro en technology

    %ultiple C optimi2ation le els

    An optimi2ing assem"ler

    Hull linker, with o erlaying of local aria"les to minimi2e +A% usage

    Comprehensi e C li"rary with all source code pro ided

    Includes support for G#"it and B #"it IEEE floating point and B #"it long data

    types

    %ixed C and assem"ler programming

    0nlimited num"er of source files

    ?istings showing generated assem"ler

    +uns on multiple platforms> !indows, ?inux, 0$IN, %ac -: N, :olaris

    @ou can compile, assem"le and link your em"edded application with a single step.

    http://en.wikipedia.org/wiki/Positioning_systemhttp://en.wikipedia.org/wiki/Positioning_systemhttp://en.wikipedia.org/wiki/Open-loop_controllerhttp://en.wikipedia.org/wiki/Open-loop_controllerhttp://en.wikipedia.org/wiki/Open-loop_controllerhttp://en.wikipedia.org/wiki/Closed_loophttp://en.wikipedia.org/wiki/Servomechanismhttp://en.wikipedia.org/wiki/CNChttp://en.wikipedia.org/wiki/Lead_screwhttp://en.wikipedia.org/wiki/Ballscrewhttp://en.wikipedia.org/wiki/Linear_actuatorhttp://en.wikipedia.org/wiki/Linear_stagehttp://en.wikipedia.org/wiki/Rotation_stagehttp://en.wikipedia.org/wiki/Goniometer_(positioning)http://en.wikipedia.org/wiki/Mirror_mounthttp://en.wikipedia.org/wiki/Floppy_diskhttp://en.wikipedia.org/wiki/Image_scannerhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Plotterhttp://en.wikipedia.org/wiki/Positioning_systemhttp://en.wikipedia.org/wiki/Positioning_systemhttp://en.wikipedia.org/wiki/Open-loop_controllerhttp://en.wikipedia.org/wiki/Closed_loophttp://en.wikipedia.org/wiki/Servomechanismhttp://en.wikipedia.org/wiki/CNChttp://en.wikipedia.org/wiki/Lead_screwhttp://en.wikipedia.org/wiki/Ballscrewhttp://en.wikipedia.org/wiki/Linear_actuatorhttp://en.wikipedia.org/wiki/Linear_stagehttp://en.wikipedia.org/wiki/Rotation_stagehttp://en.wikipedia.org/wiki/Goniometer_(positioning)http://en.wikipedia.org/wiki/Mirror_mounthttp://en.wikipedia.org/wiki/Floppy_diskhttp://en.wikipedia.org/wiki/Image_scannerhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Plotter

  • 8/17/2019 Automatic Railway Gate Conrol System

    52/57

    -ptionally, the compiler may "e run directly from the command line, allowing

    you to compile, assem"le and link using one command. 'his ena"les the compiler to "e

    integrated into third party de elopment en ironments, such as %icrochipRs %P?A& IDE.

    E" edded - -!e" !&&'-1

    A--e" 'er1

    An assem"ler is a computer program for translating assem"ly language ^

    essentially, a mnemonic representation of machine language ^ into o"ject code . A cross

    assem"ler (see cross compiler ) produces code for one type of processor, "ut runs on

    another. 'he computational step where an assem"ler is run is known as assem"ly time.'ranslating assem"ly instruction mnemonics into opcodes , assem"lers pro ide the a"ility

    to use sym"olic names for memory locations (sa ing tedious calculations and manually

    updating addresses when a program is slightly modified), and macro facilities for

    performing textual su"stitution ^ typically used to encode common short se*uences of

    instructions to run inline instead of in a su"routine . Assem"lers are far simpler to write

    than compilers for high#le el languages .

    Assem"ly language has se eral "enefits>

    • Speed > Assem"ly language programs are generally the fastest programs around.

    • Sp e1 Assem"ly language programs are often the smallest.

    • C p ' ! 1 @ou can do things in assem"ly, which are difficult or impossi"le in

    =igh#le el languages.

    http://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/Machine_languagehttp://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Cross_compilerhttp://en.wikipedia.org/wiki/Opcodehttp://en.wikipedia.org/wiki/Macrohttp://en.wikipedia.org/wiki/Subroutinehttp://en.wikipedia.org/wiki/Compilerhttp://en.wikipedia.org/wiki/High-level_languagehttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/Machine_languagehttp://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Cross_compilerhttp://en.wikipedia.org/wiki/Opcodehttp://en.wikipedia.org/wiki/Macrohttp://en.wikipedia.org/wiki/Subroutinehttp://en.wikipedia.org/wiki/Compilerhttp://en.wikipedia.org/wiki/High-level_language

  • 8/17/2019 Automatic Railway Gate Conrol System

    53/57

    C '5- #d F5!5re S &pe

    C '5-

    A new approach for impro ing safety at ?Cs on I+ has "een suggested. Hormats ha e

    "een gi en to maintain records of ?C in entories, accident incident reports. Each ?C

    should "e assigned a ha2ard rating and the priority of safety enhancement works "e

    decided accordingly. A regular assessment of safety performance should "e done. 'his

    approach should "e a"le to "ring down the rising trend in accidents at ?Cs.

    S &pe &* pr&4e !

    'his project is de eloped in order to help the I$DIA$ +AI?!A@: in making its

    present working system a "etter one, "y eliminating some of the loopholes existing in it.

    &ased on the responses and reports o"tained as a result of the significant

    de elopment in the working system of I$DIA$ +AI?!A@:, this project can "e further

    extended to meet the demands according to situation.

    'his can "e further implemented to ha e control room to regulate the working of

    the system. 'hus "ecomes the user friendliness.

    'his circuit can "e expanded and used in a station with any num"er of platforms

    as per the usage.

    Additional modules can "e added with out affecting the remaining modules. 'his

    allows the flexi"ility and easy maintenance of the de eloped system.

    'his system consists of following features o er manual system>

    'here is no time lag to operate the de ice.

    Accuracy.

    :imulation is pro ided to reflect the present status of the system.

  • 8/17/2019 Automatic Railway Gate Conrol System

    54/57

    End user can operate this without knowing a"out electronics.

    Re0erence :6

    [4\ 8rishna, :hashi @ada and $idhi, Automatic +ailway /ate Control 0sing

    %icrocontrollerF, -riental ournal -f Computer :cience 'echnology, 1ol. , $o.G,

    Decem"er 54B.

    [ \ Ahmed :alih %ahdi. Al#Muhairi, Automatic +ailway /ate and Crossing Control

    "ased :ensors %icrocontroller F, I$ International ournal of Computer 'rends and

    'echnology (I C'') _ 1olume G Issue _ uly 54B

    [B\ . &anuchandar, 1. 8aliraj, P. &alasu"ramanian, :. Deepa, $. 'hamilarasi,

    Automated 0nmanned +ailway ?e el Crossing :ystemF, in International ournal of

    %odern Engineering +esearch (I %E+)1olume. , Issue.4, an#He" 54 pp#G36#G B

    [G\ Hred Coleman III, @oung . %oon ( 544) 'rapped 1ehicle Detection :ystem for Hour

    `uadrant /ates in =igh :peed +ail Corridors, 'ransportation +esearch +ecord 4 G6

    [3\ Hred Coleman III, @oung . %oon ( 545) Design of /ate Delay and /ate Inter al

    'ime for Hour `uadrant /ate :ystem at +ailroad#=ighway /rade Crossings

    'ransportation +esearch +ecord.

    [ \ 'he 6534 %icrocontroller and Em"edded :ystems &y %uhammad Ali %a2idi

    [ \ Hundamentals -f Em"edded :oftware &y Daniel ! ?ewis

  • 8/17/2019 Automatic Railway Gate Conrol System

    55/57

    Appe#d

    Co#in!

    #define F_CPU 1000000UL#include #include

    #define CUT1 bit_i _clear!P" $%0&#define CUT' bit_i _clear!P" $%1&

    #define ())P P*+T$,-!1

  • 8/17/2019 Automatic Railway Gate Conrol System

    56/57

    Dhile! &@ _delay_ !1& EE

    int ain!&@$$+C - 0AFF //9ll *ut ut$$+( - 0AFF //9ll *ut ut$$+$ - 08F0 //P$0%P$1 "n ut %P$ EP$; *ut utP*+T$,-!1

  • 8/17/2019 Automatic Railway Gate Conrol System

    57/57