You are on page 1of 38

PROJECT REPORT ON Automatic Railway Gate Controller Using Stepper Motor

A!STRACT
This project work aims at the design, development, fabrication and testing of working model entitled Automatic Railway Gate Controller ! "t is basically related to Radio communication and signalling system! An Automatic Railway gate controller is uni#ue in which the railway gate is closed and opened or operated by the Train itself by eliminating the chances of human errors! The largest public sector in "ndia is the Railways! The network of "ndian Railways covering the length and breath of "ndian Railways covering the length and breath of our country is divided into nine Railway $ones for operational convenience! The railway tracks criss%cross the state &ighways and of course village road along their own length! The points or places where the Railway track crosses the road are called level crossings! 'evel crossings cannot be used simultaneously both by road traffic and trains, as this result in accidents leading to loss of precious lives!

"N#E$
S%no
()

&ist o' contents


"ntro*uction (!( "ntroduction (!) *lock diagram + ,escription

page No

(+

Stepper motor -!( "ntroduction to stepper motor -!) types + applications!

(,

U&N +((, .!( "ntroduction to /'0 )11.!) 2in description of /'0 )11-

(-

&M ,+3!( '4 -). + 5eatures

13 (0

&ig.t #epen*a/le Resistor "nter'acing #e1ices 6!( "nterfacing of 7tepper 4otor with /'0)116!) 7tepper 4otor "nterfacing with AT89C3( 7.3 Interfacing of Lm324 with At89c51

Regulate* Power Supply 8!( Regulated 2ower 7upply + 5eatures

2 3

Conclusion !i/liograp.y

CHAPTER 1 INTRODUCTION

)%) "NTRO#UCT"ON
Aim of this project is to control the unmanned rail gate automatically using embedded platform! Today often we see news papers very often about the railway accidents happening at un% attended railway gates! 2resent project is designed to avoid such accidents if implemented in spirit! This project is developed in order to help the "0,"A0 RA"':A;7 in making its present working system a better one, by eliminating

some of the loopholes e<isting in it! *ased on the responses and reports obtained as a result of the significant development in the working system of "0,"A0 RA"':A;7, This project can be further e<tended to meet the demands according to situation! This can be further implemented to have control room to regulate the working of the system! Thus becomes the user friendliness! "n this project AT89c3( 4icro controller "ntegrated Chip plays the main role! The program for this project is embedded in this 4icro controller "ntegrated Chip and interfaced to all the peripherals! The timer program is inside the 4icro controller "C to maintain all the functions as per the scheduled time! 7tepper motors are used for the purpose of gate control interfaced with current drivers chip /'0)11- it=s a (> pin "C!

4eatures5
There is no time lag to operate the device Accuracy!

!&OC6 #"AGRAM5

REGU&ATE# PO8ER SUPP&9

U&N +((,

STEPPER MOTOR

&M ,+-

&"G:T #EPEN#ANT RES"STOR

4ig )% )%) !loc7 #iagram o' AUTOMAT"C RA"&8A9 GATE CONTRO&&ER

)%+ !&OC6 #"AGRAM #ESCR"PT"ON5


&ere a stepper motor is used for controlling the gates! A stepper motor is a widely used device that translates electrical pulses into mechanical movement! They function as their name suggests % they step a little bit at a time! 7teppers don=t simply respond to a

clock signal! They have several windings which need to be energi$ed in the correct se#uence before the motor=s shaft will rotate! Reversing the order of the se#uence will cause the motor to rotate the other way!This project work aims at the design, development, fabrication and testing of working model entitled Automatic Railway Gate Controller ! "t is basically related to Radio communication and signalling system! An Automatic Railway gate controller is uni#ue in which the railway gate is closed and opened or operated by the Train itself by eliminating the chances of human errors!The largest public sector in "ndia is the Railways! The network of "ndian Railways covering the length and breath of "ndian Railways covering the length and breath of our country is divided into nine Railway $ones for operational convenience! The railway tracks criss% cross the state &ighways and of course village road along their own length! The points or places where the Railway track crosses the road are called level crossings! 'evel crossings cannot be used simultaneously both by road traffic and trains, as this result in accidents leading to loss of precious lives!

CHAPTER 2

STEPPER MOTOR

STEPPER MOTOR
,%) "ntro*uction to stepper motor5
A stepper motor ?or step motor@ is a brushless, synchronous electric motor that can divide a full rotation into a large number of steps! The motorAs position can be

controlled precisely, without any feedback mechanism ?see open loop control@! 7tepper motors are similar to switched reluctance motors ?which are very large stepping motors with a reduced pole count, and generally are closed%loop commutated@!

Fig no: 3.1.1 Basic ste e! "oto!

F#n$a"enta%s o& O e!ation:


7tepper motors operate differently from normal ,C motors, which rotate when voltage is applied to their terminals! 7tepper motors, on the other hand, effectively have multiple BtoothedB electromagnets arranged around a central gear%shaped piece of iron! The electromagnets are energi$ed by an e<ternal control circuit, such as a microcontroller! To make the motor shaft turn, first one electromagnet is given power, which makes the gearAs teeth magnetically attracted to the electromagnetAs teeth! :hen the gearAs teeth are thus aligned to the first electromagnet, they are slightly offset from the ne<t electromagnet! 7o when the ne<t electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the ne<t one, and from there the process is repeated! Cach of those slight rotations is called a Bstep,B with an integral number of steps making a full rotation! "n that way, the motor can be turned by a precise angle!

Ste

e! "oto! c'a!acte!istics:
7tepper motors are constant power devices! As motor speed increases, tor#ue

decreases! The tor#ue curve may be e<tended by using current limiting drivers and increasing the driving voltage! 7teppers e<hibit more vibration than other motor types, as

the discrete step tends to snap the rotor from one position to another! This vibration can become very bad at some speeds and can cause the motor to lose tor#ue! The effect can be mitigated by accelerating #uickly through the problem speed range, physically damping the system, or using a micro%stepping driver! 4otors with a greater number of phases also e<hibit smoother operation than those with fewer phases!

Open;loop 1ersus close*;loop commutation


7teppers are generally commutated open loop, i!e! the driver has no feedback on where the rotor actually is! 7tepper motor systems must thus generally be over engineered, especially if the load inertia is high, or there is widely varying load, so that there is no possibility that the motor will lose steps! This has often caused the system designer to consider the trade%offs between a closely si$ed but e<pensive servomechanism system and an oversi$ed but relatively cheap stepper! A new development in stepper control is to incorporate a rotor position feedback ?eg! an encoder or resolver@, so that the commutation can be made optimal for tor#ue generation according to actual rotor position! This turns the stepper motor into a high pole count brushless servo motor, with e<ceptional low speed tor#ue and position resolution! An advance 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 becomes too large %% this will allow the system to avoid hunting or oscillating, a common servo problem!

,%+ Types < Applications5


There are three main types of stepper motorsD

2ermanent 4agnet 7tepper

&ybrid 7ynchronous 7tepper Eariable Reluctance 7tepper

T(o) 'ase ste

e! "oto!s:

There are two basic winding arrangements for the electromagnetic coils in a two phase stepper motorD bipolar and unipolar!

Unipolar motors5
A unipolar stepper motor has logically two windings per phase, one for each direction of magnetic field! 7ince in this arrangement a magnetic pole can be reversed without switching the direction of current, the commutation circuit can be made very simple ?e!g! a single transistor@ for each winding! Typically, given a phase, one end of each winding is made commonD giving three leads per phase and si< leads for a typical two phase motor! Fften, these two phase commons are internally joined, so the motor has only five leads!

4ig ,%+ Unipolar stepper motor coils "n the construction of unipolar stepper motor there are four coils! Fne end of each coil is tide together and it gives common terminal which is always connected with positive terminal of supply! The other ends of each coil are given for interface! 7pecific color code may also be given! 'ike in my motor orange is first coil ?'(@, brown is second ?')@, yellow is third ?'-@, black is fourth ?'.@ and red for common terminal! *y means of controlling a stepper motor operation we can (! "ncrease or decrease the R24 ?speed@ of it

)! "ncrease or decrease number of revolutions of it -! Change its direction means rotate it clockwise or anticlockwise To vary the R24 of motor we have to vary the 2R5 ?2ulse Repetition 5re#uency@! 0umber of applied pulses will vary number of rotations and last to change direction we have to change pulse se#uence! 7o all these three things just depends on applied pulses! 0ow there are three different modes to rotate this motor (! 7ingle coil e<citation )! ,ouble coil e<citation -! half coil e<citation /nipolar stepper motors with si< or eight wires may be driven using bipolar drivers by leaving the phase commons disconnected, and driving the two windings of each phase together Gdiagram neededH! "t is also possible to use a bipolar driver to drive only one winding of each phase, leaving half of the windings unused Gdiagram neededH!

!ipolar motor5
*ipolar motors have logically a single winding per phase! The current in a winding needs to be reversed in order to reverse a magnetic pole, so the driving circuit must be more complicated, typically with an &%bridge arrangement! There are two leads per phase, none are common! 7tatic friction effects using an &%bridge have been observed with certain drive topologies *ecause windings are better utili$ed, they are more powerful than a unipolar motor of the same weight!

Applications5
Computer%controlled stepper motors are one of the most versatile forms of positioning systems! They are typically digitally controlled as part of an open loop system, and are simpler and more rugged than closed loop servo systems!

"n the field of linear actuators, linear stages, rotation stages, goniometers, and mirror mounts! Fther uses are in packaging machinery, and positioning of valve pilot stages for fluid control systems!

"n floppy disk drives, flatbed scanners, computer printers, plotters and many more devices!

CHAPTER 3 U*N 2++3

/'0 )11-%) "ntro*uction5

The /'0)11- is a high%voltage, high current ,arlington drivers comprised of seven 020 ,arlington pairs!

4eatures5
(@ Futput current ?single output@ 311mA 4AI! )@ &igh sustaining voltage output 31E 4"0! -@ "nput compatible with various types of logic!

ApplicationsD
Relay &ammers

'amp and display?'C,@drivers

-%+ P"N #"AGRAM5

4ig5-%+%) Pin *iagram o' U&N+((,

4eatures5

0o! of pinsD(> Temperature, Fperating RangeD%)1JC to K83JC Transistor 2olarityD020 0o! of TransistorsD6 Case 7tyleD,"2%(> 4in operating temperatureD%)1JC 4a< operating temperatureD83JC *ase 0umberD)114a< Futput currentD311mA "C Generic 0umberD)11"nput TypeDTT', C4F7 3E Futput TypeD Fpen Collector Transistor TypeD 2ower ,arlington 4a< "nput EoltageD3E 4a< Futput voltageD31E

P"N CONNECT"ONS O4 U&N+((,5

4ig -%+%+ Pin con'iguration o' U&N +((, The /'0)11(A, /'0)11)A, /'0)11- and /'0)11.Aare high Eoltage, high current ,arlington arrays each containing seven open collector ,arlington pairs with common emitters! Cach channel rated at 311mAand can withstand peak currents of >11mA!7uppressiondiodesare included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout! These versatile devices are useful for driving a wide range of loads including solenoids, relays ,C motorsL 'C, displays filament lamps, thermal print heads and high power buffers! The /'0)11(AM)11)AM)11-A and )11.A are supplied in (> pin plastic ,"2 packages with a copper lead frame to reduce thermal resistance! They are available also in small outline package ?7F%(>@ as /'0)11(,M)11),M)11-,M)11.,!

SC:EMAT"C #"AGRAM O4 #AR&"NGTON PA"R5 The circuit below is


a N,arlington 2air= driver! The first transistor=s emitter feeds into the second transistor=s base and as a result the input signal is amplified by the time it reaches the output! ,arlington pairs are back to back connection of two transistors with some source resistors!

4ig5 -%+%, T.e #arlington pair connection o' transistor% The important point to remember is that the ,arlington 2air is made up of two transistors and when they are arranged as shown in the circuit they are used to amplify weak signals! The amount by which the weak signal is amplified is called the NGA"0=! !

CHAPTER , *M 32,

&M ,+-5
=%) "ntro*uction5
These amplifiers are designed to specifically to operate from a solitary supply over a wide range of voltages! Also can function when the difference between the two supplies is -E to -1E and ECC is at least (!3E more positive than the input common mode voltage!

4ig5 =%) Pin *iagram o' &M,+-

Pin #escriptions
EK O 7upply voltage G0, O Gnd ?1E@ connection for supply voltage

"nput?s@ O "nput to Fp%Amp Futput?s@ O Futput of Fp%Amp

4eatures5

7upply voltage E K D K-)E,C or K(>E,C ,ifferential "nput Eoltage D -)E,C "nput Eoltage D %1!-E,C to K-)E,C 2ower ,issipation D 361m: Fperating Temperature D 1 to 61C degree Futput Current 7ource D Typical .1mA Futput Current 7ource D Typical .1mA Futput Current 7ink D Typical )1mA "nput Fffset Eoltage D Typical )!1mVDC Fperates on a single supply over a range of voltages

Uni>ue 'eatures5
"n the linear mode, the input common%mode voltage range includes ground and the output voltage can also swing to ground, even though operated from only a single power supply voltage! The unity gain crossover fre#uency and the input bias current are temperature%compensated!

Applications5
"n Transducer amplifiers! ,C amplification blocks and conventional operations!

).

CHAPTER *I.HT DEPENDENT RESISTOR

&"G:T #EPEN#ENT RES"STOR

0%) #escription5
This practical is about using a lig.t *epen*ent resistor ?&#R@ as a sensor! The ',R must be part of a voltage divider circuit in order to give an output voltage, Eout , which changes with illumination!

A lig.t *epen*ent resistor is a resistor whose resistance decreases with increasing incident light intensity! "t can also be referenced as a photo conductor! An ',R is made of a high resistance semiconductor! "f light falling on the device is of high enough fre#uency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band! The resulting free electron ?and its hole partner@ conduct electricity, thereby lowering resistance! An ',R device can be either intrinsic or e<trinsic! An intrinsic semiconductor has its own charge carriers and is not an efficient semiconductor, e!g! silicon! "n intrinsic devices the only available electrons are in the valence band, and hence the photon must have enough energy to e<cite the electron across the entire band gap! C<trinsic devices have impurities, also called do pants, and added whose ground state energy is closer to the conduction bandL since the electrons do not have as far to jump, lower energy photons ?i!e!, longer wavelengths and lower fre#uencies@ are sufficient to trigger the device! "f a sample of silicon has some of its atoms replaced by phosphorus atoms ?impurities@, there will be e<tra electrons available for conduction!

4ig 0%)%) &ig.t *epen*ent resistor

)>
0ote that an ',R responds in an e<tremely non%linear way to the light intensity! The resistance of a ',R changes from a few meg%ohms in dim light to a few kilo ohms in bright light ?maybe even a few ohms depending upon the light intensity and ',R used!@!

7o " would suggest that u first connect the ',R as ECC %%%%%% ',R%%%%%%% '4 -). %%%%%%%% 4icrocontroller! and plot the voltage across the (P resistor with respect to different light intensities on the ',R!Then connect this voltage output to a A,C via a simple non%inverting op%amp amplifier and connect the A,C to the 4icrocontroller! Applications5 Camera light meters, street lights, clock radios, alarms, and outdoor clocks! They are also used in so dynamic compressors together with a small incandescent lamp or light emitting diode to control gain reduction! 'ead sulfide and "diam sulfide ',Rs are used for the mid infrared spectral region!GeD Cu photoconductors are among the best far%infrared detectors available, and are used for infrared astronomy and infrared spectroscopy!

CHAPTER / INTERFACIN. DE0ICES

)8

>!( "0TCR5AC"0G F5 7TC22CR 4FTFR :"T& /'0)11-

4ig no5?%)%) U&N+((, is inter'ace* wit. t.e stepper motor /'0)11- is a (> pin dip! "ts connections can be e<plained as follows 5irst .%pins of chip are connected to microcontroller pin at -6%.1 pins and second at )(%). pins! And 8th pin of chip is grounded! A stepper contains 3 terminals, . winding wires and a power supply wire! These . winding wires are connected to chip and another to supply! in this circuit too the four pins BController pin (B,),- and . will control the motion and direction of the stepper motor according to the step se#uence sent by the controller!

)9

?%+ STEPPER MOTOR "NTER4AC"NG 8"T: AT23C=)

( ) . 3 > 6 8 9 (1 (( () ((. (3 (> (6 (8 (9

A T 8 9 C 3 (

vcc .1 -9 -8 -6 -> -3 -. --) -( -1 )9 )8 )6 )> )3 ). ))) )1 )( ( ) . u l n ) 9 (1 (( () ((. (3 (>

4FTFR

3 1 > 1 6 8

'ig no5 ?%+%) stepper motor inter'acing wit. AT23C=) using U&N+((,% The interfacing of stepper motor consists of several parts like AT89C3( microcontroller, stepper motor, and /'0)11- current driver chip! This can be used in this project for the purpose of gate control ! 5or the gate control a ()v stepper motor is used!/'0)11- is a current driver chip used for supply control to the stepper motorL it is a (> pin dip!AT89C3( is a .1 pin dip micro controller, can be divided in to four ports, it is driven by 3v supply!

-1

4ig no5 ?%+%+ T.e /loc7 *iagram o' stepper motor inter'acing &ere a stepper motor is used for controlling the gates! A stepper motor is a widely used device that translates electrical pulses into mechanical movement! They function as their name suggests % they step a little bit at a time! 7teppers don=t simply respond to a clock signal! They have several windings which need to be energi$ed in the correct se#uence before the motor=s shaft will rotate! Reversing the order of the se#uence will cause the motor to rotate the other way!

-(

?%, "NTER4AC"NG O4 &M ,+- wit. AT 23C=) M"CROCONTRO&&ER

.1 A T 8 9 C 3 ( -(

( ) . 3 > 6

' 4 ) .

(. (() (( (1 9 8

(3Pohm
(8

(9

)1

4ig ?%,%) "nter'acing o' &M,+- wit. AT23c=) Microcontroller The '4-). integrated circuit is a Quad operational amplifier?op%amp@!The device has four individual Fp%amp circuits housed in a single package!

-)

CHAPTER 1 RE.U*ATED PO2ERSUPP*3

--

2%) REGU&ATE# PO8ER SUPP&95


A variable regulated power supply,also called a variable bench power supply,is one which you can continuously adjust the output voltage to your re#uirements! Earying the output of the power supply is recommended way to test a project after having double checked parts placement against circuit drawings and the parts placement This type of regulation is ideal for having a simple variable bench power supply! Actually this is #uite important because one of the first projects a hobbyist should undertake is the construction of a variable regulated power supply! :hile a dedicated supply is #uite handy e!g 3E or ()E,it=s much handier to have a variable supply on hand, especially for testing! 4ost digital logic circuits and processors need a 3 volt power supply! To use these parts we need to build a regulated 3 volt source! /sually you start with an unregulated power to make a 3 volt power supply, we use a '46813 voltage regulator "C ?"ntegrated Circuit@!

The "C is shown below!

4ig5 2%)%) &M ?2(= /loc7 *iagram

-.

4ig5 2%)%+ Pin representation o' &M ?2(= The '46813 is simple to use! ;ou simply connect the positive lead of your unregulated ,C power supply?anything from 9E,C to ).E,C@ to the "nput pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 3 volt supply from the Futput pin!

Circuit 'eatures5
!rie' *escription o' operationD Gives out well regulated K3E output, output current capability of (11mA! Circuit protectionD *uilt%in overheating protection shuts down output when regulator "C gets too hot! Circuit comple@ityD Eery simple and easy to build! Circuit per'ormanceD Eery stable K3E output voltage, reliable operation A1aila/ility o' components5 Casy to get, uses only very common basic components! #esign testing5 *ased on datasheet e<ample circuit, " have used this circuit successfully as part of many electronic projects! Applications5 2art of electronics devices, small laboratory power supply

-3

CHAPTER 4 CONC*USION

2 CONC&US"ON5

5rom the above discussion and information of this system we, upto now surely comes to know that it is highly reliable effective and economical at dense traffic area, sub urban area and the route where fre#uency of trains is more! As it saves some au<iliary structure as well as the e<penditure on attendant it is more economical at above mentioned places than traditional railway crossing gate system! :e know that though it is very beneficial but it is also impossible to install such system at each and every places, but it gives certainly a considerable benefit to us, thereby to our nation!

CHAPTER 5 BIB*IO.RAPH3

.RE4ERENCES5

1. Penneth!R!Ayala The 89C3( 4icrocontroller Architecture programming and Applications , 2en ram "nternational! 2. ,!Roychoudary and 7ail Rain '!"!C , 0ew Age "nternational! 3. 2rinciples of Clectronics by E!P!4C&TA! 4. Communication 7ystems by 7imon &awkins. 5.

Clectrical Technology S vol! )% *!'! Theraja!

8E! RE4ERENCES5
(! httpDMMwww!learn%c!comMadc1819!pdf )! httpDMMwww!atmel!comMdynMresourcesMprodTdocumentsMdoc1)>3!pdf -! httpDMMwww!ortodo<ism!roMdatasheetsMte<asinstrumentsMma<)-)!pdf

You might also like