Automatic Railway Gate Control
Automatic Railway Gate Control
Certificate
Certified that this project entitled Automatic Railway Gate Control submitted by u!esh
"aberwal (RE38E1B46), students of #lectronics $ Communication #ngineering %epartment& 'o(ely )rofessional *ni(ersity& )hagwara )unjab in the partial fulfillment of the requirement for the award of "achelors of +echnology ,#lectronics $ Communication #ngineering%egree of ')*& is a record of student.s own study carried under my super(ision $ guidance/
+his report has not been submitted to any other uni(ersity or institution for the award of any degree/
Acknowledgement
1 would li!e to ac!nowledge and e2tend my heartfelt gratitude to my entor #r/ Same!sha "has!ar who supported me to ma!e this Capstone )roject with proper guidance/ 1 would also than! my groupmates ,)alla(i & Sushant and %hananjay- who ha(e gi(en their inputs equally and effecti(ely without whom it was impossible to ma!e this )roject/ 1 am heartly than!ful to college for facilitating (arious means li!e wifi which helped to accomplish the tas!/
Abstract
OBJECTIVE: +he aim of this project is to Automate unmanned railway gate// +he objecti(e of this project is to manage the control system of railway gate using the microcontroller/ +he control system acti(ates and closes the gate on either side of the trac!/ once the train crosses the other end control system automatically lifts the gate/ 4or mechanical operation of the gates dc motors are employed/ 5ere we are using embedded controller built around the 6781 family ,A+69C80- for the control according to the data pattern produced at the input port of the micro controller& the appropriate selected action will be ta!en// +he logic is produced by the program written in Assembly language/ +he software program is written& by using the :#1' micro (ision en(ironment/ +he program written is then con(erted in 5#; code after simulation and burned on to microcontroller/ +he basic idea behind this project is an automatic railway gate at a le(el crossing replacing the gates operated by the gate!eeper/ 1t deals with two things/ 4irstly& it deals with the reduction of time for which the gate is being !ept closed/ And secondly& to pro(ide safety to the road users by reducing the accidents/ "y the presently e2isting system once the train lea(es the station& the stationmaster informs the gate!eeper about the arri(al of the train through the telephone/ <nce the gate!eeper recei(es the information& he closes the gate depending on the timing at which the train arri(es/ 5ence& if the train is late due to certain reasons& then gate remain closed for a long time causing traffic near the gates/
Automatic Railway Gate Control +able of Contents 1/ 1ntroduction>>>>>>>>>>>>>>>>>>>>>//?@A 1/1 Aim>>>>>>>>>>>>>>>>>>>>>>> ? 1/0 4unction >>>>>>>>>>>>>>>>>>>>/////A 0/ 4igures>>>>>>>>>>>>>>>>>>>>>>>/6@ 0/1 Circuit %iagram>>>>>>>>>>>>>>>>>>>A 0/0 "loc! %iagram>>>>>>>>>>>>>>>>>>>//6 3/ 5ardware description>>>>>>>>>>>>>>>>>>//9@ 3/1 69S80 microcontroller>>>>>>>>>>>>>>>>// 3/0 '093% motor dri(er>>>>>>>>>>>>>>>>>// 3/3 A678 (oltage regulator>>>>>>>>>>>>>>>>// 3/= 1R Sensors>>>>>>>>>>>>>>>>>>>>> 3/8 ' 386 opamp>>>>>>>>>>>>>>>>>>>/// =/ Software %escription>>>>>>>>>>>>>>>>>>/// =/1 :eil icro Bision3>>>>>>>>>>>>>>>>>> 8/ Source Code>>>>>>>>>>>>>>>>>>>>>>/ ?/ %ata Sheets>>>>>>>>>>>>>>>>>>>>>>// ?/1 69S80 microcontroller>>>>>>>>>>>>>>>>/// ?/0 '093%>>>>>>>>>>>>>>>>>>>>>>// ?/3 ' 386>>>>>>>>>>>>>>>>>>>>>>// ?/= A678>>>>>>>>>>>>>>>>>>>>>>>/ A/ Conclusion >>>>>>>>>>>>>>>>>>>>>>/ 6/ )roblems occurred>>>>>>>>>>>>>>>>>>>// 9/ Reference >>>>>>>>>>>>>>>>>>>>>>///
1. Introduction
1.1 Aim
#arly le(el crossings had a flagman in a nearby booth who would& on the approach of a train& wa(e a red flag or lantern to stop all traffic and clear the trac!s/ anual or electrical closable gates that barricaded the roadway were later introduced/ +he gates were intended to be a complete barrier against intrusion of any road traffic onto the railway/ 1n the early days of the railways much road traffic was horse drawn or included li(estoc!/ 1t was thus necessary to pro(ide a real barrier/ +hus& crossing gates& when closed to road traffic& crossed the entire width of the road/ Chen opened to allow road users to cross the line& the gates were swung across the width of the railway& pre(enting any pedestrians or animals getting onto the line/ Cith the appearance of motor (ehicles& this barrier became less effecti(e and the need for a barrier to li(estoc! diminished dramatically/ any countries therefore substituted the gated crossings with wea!er but more highly (isible barriers and relied upon road users following the associated warning signals to stop/ Ce are concerned of pro(iding an automatic railway gate control at unmanned le(el crossings replacing the gates operated by gate !eepers and also the semi automatically operated gates/ 1t deals with two things/ 4irstly& it deals with the reduction of time for which the gate is being !ept closed/ And secondly& to pro(ide safety to the road users by reducing the accidents that usually occur due to carelessness of road users and at times errors made by the gate!eepers/
1.2 unction
"y employing the automatic railway gate control at the le(el crossing the arri(al of train is detected by the sensor placed on either side of the gate at about 8!m from the le(el crossing/ <nce the arri(al is sensed& the sensed signal is sent to the microcontroller and it chec!s for possible presence of (ehicle between the gates& again using sensors/ Subsequently adequate signals on either side are pro(ided to the road users indicating the closure of gates/ <nce& no (ehicle is sensed in between the gate the motor is acti(ated and the gates are closed/ "ut& for the worst case if any obstacle is sensed it is indicated to the train dri(er by signals placed at about 0!m and 167m& so as to bring it to halt well before the le(el crossing/ Chen no obstacle is there and the train is to free to mo(e/ +he departure of the train is detected by sensors placed at the gate/ +he signal about the departure is sent to the microcontroller& which in turn operates the motor and opens the gate/ +hus& the time for which the gate is closed is less compared to the manually operated gates since the gate is closed depending upon the telephone call from the pre(ious station/ Also reliability is high as it is not subjected to manual errors/
<ur project is designed using 6780 microcontroller to a(oid railway accidents happening at unattended railway gates/ +his project utiliDes An 1R sensor which is fi2ed at the railway gate/ Chene(er a signal from the sensor is detected then the gates are closed/ Ce will be using %C geared motor to open and close the gates/ Ce will be using '093% dri(er 1C to control the motor i/e/ open and close the gates/ +his type of gates can be employed in an unmanned le(el crossing where the chances of accidents are higher and reliable operation is required/ Since& the operation is automaticE error due to manual operation is pre(ented/ Automatic railway gate control is highly economical microcontroller based arrangement& designed for use in almost all the unmanned le(el crossings in the country/
GB
1R transmitter
1R recei(er
Comparator
+ransistor switch
O!er!iew of "ro#ect
2. i$ure%
17
(.)ardware 'e%cri"tion
(.1 *+,-2 .icrocontroller
1n 1961& 1ntel Corporation introduced an 6@bit microcontroller called the 6780/ +his microcontroller had 106 bytes of RA & =: bytes of on@chip R< & two timers& one serial port& and four ports ,each 6@bits wide- all on a single chip/ +he 6780 is an 6@bit processor& meaning that the C)* can wor! on only 6 bits of data at a time/ %ata larger than 6 bits has to bro!en into 6@bit pieces to be processed by the C)*/ +he 6780 has a total of four 1H< ports& each 6 bits wide/ Although the 6780 can ha(e a ma2imum of ?=: bytes of on@chip R< & many manufacturers ha(e put only =: bytes on the chip/ +here are different fla(ors of the 6780 in terms of speed and amount of on@chip R< & but they are all compatible with the original 6780 as far as the instructions are concerned/ +he (arious members of the 6780 family are 6780 microcontroller& 6780 microcontroller and 6731 microcontroller/
11
Bloc& dia$ram of microcontroller */-2 */-2 .icrocontroller +he 6780 is the original member of the 6780 family/ 4igure 0/1 shows the bloc! diagram of the 6780 microcontroller/ +he A+69C81 is a low@power& high@performance C <S 6@bit microcomputer with =: bytes of 4lash programmable and erasable read only memory ,)#R< -/ +he de(ice is manufactured using Atmel.s high@density non(olatile memory technology and is compatible with the industry@standard CS@81 instruction set and pin out/ +he on@chip 4lash allows the program memory to be reprogrammed in@system or by a con(entional non(olatile memory programmer/ "y combining a (ersatile 6@bit C)* with 4lash on a monolithic chip& the Atmel A+69C81 is a powerful microcomputer which pro(ides a highly@fle2ible and cost@effecti(e solution to many embedded control applications/ +he A+69C81 pro(ides the following standard featuresI =:bytes of 4lash& 106 bytes of RA & 30 1H< lines& two 1?@bittimerHcounters& fi(e (ector two@le(el interrupt architecture& a full duple2 serial port& and on@chip oscillator and cloc! circuitry/ 1n addition& the A+69C81 is designed with static logic for operation down to Dero frequency and supports two software selectable power sa(ing modes/ +he 1dle ode stops the C)* while allowing the RA & timerHcounters& serial port and interrupt system to continue functioning/ +he )ower@down ode sa(es the RA contents but freeDes the oscillator disabling all other chip functions until the ne2t hardware reset/
$o%ely Pro&essional 'ni%ersity Punjab
10
0in dia$ram for microcontroller */-2 0ort / )ort 7 is an 6@bit open@drain bi@directional 1H< port/ As an output port& each pin can sin! eight ++' inputs/ Chen 1s are written to port 7 pins& the pins can be used as high@impedance inputs/ )ort 7 may also be configured to be the multiple2ed low@ order addressHdata bus during accesses to e2ternal program and data memory/ 1n this mode )7 has internal pull@ups/ )ort 7 also recei(es the code bytes during 4lash programming& and outputs the code bytes during program (erification/ #2ternal pull@ups are required during program (erification/
$o%ely Pro&essional 'ni%ersity Punjab
13
Automatic Railway Gate Control 0ort 1 )ort 1 is an 6@bit bi@directional 1H< port with internal pull@ups/ +he )ort 1 output buffers can sin!Hsource four ++' inputs/ Chen 1s are written to )ort 1 pins they are pulled high by the internal pull@ups and can be used as inputs/ As inputs& )ort 1 pins that are e2ternally being pulled low will source current ,11'- because of the internal pull@ups/ )ort 1 also recei(es the low@order address bytes during 4lash programming and (erification/ 0ort 2 )ort 0 is an 6@bit bi@directional 1H< port with internal pull@ups/ +he )ort 0 output buffers can sin!Hsource four ++' inputs/ Chen 1s are written to )ort 0 pins they are pulled high by the internal pull@ups and can be used as inputs/ As inputs& )ort 0 pins that are e2ternally being pulled low will source current ,11'- because of the internal pull@ups/ )ort 0 emits the high@ order address byte during fetches from e2ternal program memory and during accesses to e2ternal data memory that uses 1?@bit addresses , <B; K%)+R-/ 1n this application& it uses strong internal pull@ups when emitting 1s/ %uring accesses to e2ternal data memory that uses 6@bit addresses , <B; K R1-& )ort 0 emits the contents of the )0 Special 4unction Register/ )ort 0 also recei(es the high@order address bits and some control signals during 4lash programming and (erification/ 0ort ( )ort 3 is an 6@bit bi@directional 1H< port with internal pull@ups/ +he )ort 3 output buffer scan sin!Hsource four ++' inputs/ Chen 1s are written to )ort 3 pins they are pulled high by the internal pull@ups and can be used as inputs/ As inputs& )ort 3 pins that are e2ternally being pulled low will source current ,11'- because of the pull@ups/ )ort 3 also ser(es the functions of (arious special features of the A+69C81 as listed belowI
Ta1le %2owin$ function of "ort ( )ort 3 also recei(es some control signals for 4lash programming and (erification/ R,T Reset input/ A high on this pin for two machine cycles while the oscillator is running resets the de(ice/
$o%ely Pro&essional 'ni%ersity Punjab
1=
Automatic Railway Gate Control A3E40ROG Address 'atch #nable output pulse for latching the low byte of the address during accesses to e2ternal memory/ +his pin is also the program pulse input ,)R<G- during 4lash programming/ 1n normal operation A'# is emitted at a constant rate of 1H? the oscillator frequency& and may be used for e2ternal timing or cloc!ing purposes/ Jote& howe(er& that one A'# pulse is s!ipped during each access to e2ternal %ata emory/ 1f desired& A'# operation can be disabled by setting bit 7 of S4R location 6#5/ Cith the bit set& A'# is acti(e only during a <B; or <BC instruction/ <therwise& the pin is wea!ly pulled high/ Setting the A'#@disable bit has no effect if the microcontroller is in e2ternal e2ecution mode/ 0,E5 )rogram Store #nable is the read strobe to e2ternal program memory/Chen the A+69C81 is e2ecuting code from e2ternal program memory& )S#J is acti(ated twice each machine cycle& e2cept that two )S#J acti(ations are s!ipped during each access to e2ternal data memory/ EA4V00 #2ternal Access #nable/ #A must be strapped to GJ% in order to enable the de(ice to fetch code from e2ternal program memory locations starting at 77775 up to 44445/ Jote& howe(er& that if loc! bit 1 is programmed& #A will be internally latched on reset/ #A should be strapped to BCC for internal program e2ecutions/ +his pin also recei(es the 10@(olt programming enable (oltage ,B))- during 4lash programming& for parts that require 10@(olt B))/ 6TA31 1nput to the in(erting oscillator amplifier and input to the internal cloc! operating circuit/ 6TA32 <utput from the in(erting oscillator amplifier/ <scillator Characteristics ;+A'1 and ;+A'0 are the input and output& respecti(ely& of an in(erting amplifier which can be configured for use as an on@chip oscillator& as shown in 4igure 1/ #ither a quartD crystal or ceramic resonator may be used/ +o dri(e the de(ice from an e2ternal cloc! source& ;+A'0 should be left unconnected while ;+A'1 is dri(en as shown/
Crystal <scillator Connections +here are no requirements on the duty cycle of the e2ternal cloc! signal& since the input to the internal cloc!ing circuitry is through a di(ide@by@two flip@flop& but minimum and ma2imum (oltage high and low time specifications must be obser(ed/
$o%ely Pro&essional 'ni%ersity Punjab
18
Automatic Railway Gate Control )ow O%cillator wor&% Chen quartD crystal is subjected to mechanical pressure& they produce a measurable electrical (oltage con(ersely when an electric current is applied to a crystal& it will induce mechanical mo(ement/ 1f an ac is passed through the crystal plate the charges oscillate bac! and front at the resonant frequency of crystal/
fL1/0 (,,1GCHC)-H,'C---
MuartD crystal e2hibits a property called the pieDo@electric effect that is they produce an electric (oltage/ Chen subjected to pressure along certain direction of the crystal because of this property quartD crystal has important application in electronics industry for controlling the frequency of radio wa(es/Chen pieDo@electric crystal is used in place of 'C circuit for higher frequency stability& the oscillator is called as crystal oscillator/
Crystal oscillator is used for stability frequency for a long period of time/ +he
1?
Automatic Railway Gate Control resolution of 7/71 nmHs can be obtained/ Crystal operates between f p and fs frequency ,a (ery narrow bandwidth-/ ,tatu% of E7ternal 0in% durin$ Idle and 0ower8down .ode% 0ro$ram .emory 1nternal #2ternal 1nternal #2ternal
A3E 1 1 7 7
PSEN
0ort 2
0ort(
1 1 7 7
0ro$ram .emory 3oc& Bit% <n the chip are three loc! bits which can be left un@programmed ,*- or can be programmed ,)- to obtain the additional features listed in the table below/ Chen loc! bit 1 is programmed& the logic le(el at the #A pin is sampled and latched during reset/ 1f the de(ice is powered up without a reset& the latch initialiDes to a random (alue& and holds that (alue until reset is acti(ated/ 1t is necessary that the latched (alue of #A be in agreement with the current logic le(el at that pin in order for the de(ice to function properly/ 3oc& Bit 0rotection .ode%
0ro$ram 3oc& Bit% '"1 1 * '"0 * '"3 * 0rotection Ty"e Jo program loc! features <BC instructions e2ecuted
from
e2ternal
program memory are disabled from fetching code 0 ) * * bytes from internal memory& #A is sampled and latched on reset& and further programming of the 3 = ) ) ) ) * ) 4lash is disabled Same as mode 0& also (erify is disabled Same as mode 3& also e2ternal e2ecution is disabled
1A
Automatic Railway Gate Control 0ro$rammin$ t2e la%2 +he A+69C81 is normally shipped with the on@chip 4lash memory array in the erased state ,that is& contents L 445- and ready to be programmed/ +he programming interface accepts either a high@(oltage ,10@(olt- or a low@(oltage ,BCC- program enable signal/ +he low@(oltage programming mode pro(ides a con(enient way to program the A+69C81 inside the user.s system& while the high@(oltage programming mode is compatible with con(entional third@party 4lash or #)R< Readin$ t2e ,i$nature Byte%: +he signature bytes are read by the same procedure as a normal (erification of locations 7375& 7315& and 7305& e2cept that )3/? and )3/A must be pulled to a logic low/ +he (alues returned are as follows/ ,7375- L 1#5 indicates manufactured by Atmel ,7315- L 815 indicates 69C81 ,7305- L 445 indicates 10B programming ,7305- L 785 indicates 8B programming/ 0ro$rammin$ Interface #(ery code byte in the 4lash array can be written and the entire array can be erased by using the appropriate combination of control signals/ +he write operation cycle is self timed and once initiated& will automatically time itself to completion/ All major programming (endors offer worldwide support for the Atmel microcontroller series/ )lease contact your local programming (endor for the appropriate software re(ision/ programmers/
16
Automatic Railway Gate Control la%2 0ro$rammin$ .ode% .ode Crite Code %ata Read Code %ata Crite 'oc! "it@1 "it@0 "it@3 R,T 5 5 5 5 5 0,E5 ' ' ' ' ' 5 A3E40ROG EA 02.9 02.: 0(.9 HV00 5H10B ' 5 5 5 ' ' 5 5 ' ' ' 5 5 ' 5 ' ' 5H10B 5 5H10B 5 5H10B 5 5H10B 5 5 ' 0(.: 5 5 5 ' ' ' '
Chip #rase 5 ' Read Signature 5 ' 5 "yte JoteI Chip #rase requires a 17 ms )R<G pulse/ E6TER5A3 0ROGRA. .E.OR; REA' C;C3E
19
0arameter <scillator 4requency Cloc! )eriod 5igh +ime 'ow +ime Rise +ime 4all +ime
.in 7 =1/? 18 18
.a7 0=
07 07
=nit% 5D ns ns ns ns ns
07
CIRCUIT DIAGRAM:
7805
1 ! .
IN4007
" "
"/0 0 AC ,'PP$1 !0 23
4
*RA+,-ORM(R
1 100u
1k
1 $()
" 1000u
1f
IN4007
0O<ER ,=003;: +o run the electronic gadget at home it is pro(ided by some power supply/ +he microcontroller used ,at69c81- requires 10( %/C supply/ +he %+ 4 recei(er used ,mt66A7requires 8( %/C/ so design of these regulated power supply is also an important part in hardware design/ +he A/C power supply from mains is ta!en and regulated using the rectifiers/ 4or design of a regulated power supply components used areI +ransformer/ %iodes/ Rectifiers/ Regulated 1C chips/ Capaciti(e filters/ Tran% former: A transformer is required to couple the mains to the actual power supply circuit/ +his is required to isolate the mains from the actual regulated power supply circuit and the other part of the !it/ +his isolation eliminates the dame of the !it to any power supply (ariations or from a faulty shoc!/
01
V1 V2
i2 n1 i1 n2
'iode%: 1n bride rectifier four diodes are used/ +he specifications of diodes are chosen asI )1B N input (oltage/ Si diode is better/ )ower dissipation is !ept fi2ed with respect to current through the diode/ Ounction capacitance need not be considered for frequencies P1 !5D/ R#C+141#RSI Rectification is a process of con(ersion of AC to %C/ 5ere& the AC of transformer output is gi(en to the rectifier input& which con(erts it to %C output/ "asically& bridge rectifiers or diodes arranged in bridge called %iode arrangement are used for power supply design/ A bridge rectifier ma!es use of four diodes in a bridge arrangement to achie(e full@ wa(e rectification/ +his is a widely used configuration& both with indi(idual diodes wired as shown and with single component bridges where the diode bridge is wired internally
00
Automatic Railway Gate Control 4or both positi(e and negati(e swings of the transformer& there is a forward path through the diode bridge/ "oth conduction paths cause current to flow in the same direction through the load resistor& accomplishing full@wa(e rectification/ Chile one set of diodes is forward biased& the other set is re(erse biased and effecti(ely eliminated from the circuit/ Diode Bridge: A diode bridge is an arrangement of four diodes connected in a bridge circuit as shownbelow& that pro(ides the same polarity of output (oltage for any polarity of the input (oltage/ Chen used in its most common application& for con(ersion of alternating current ,AC- input into direct current ,%C- output& it is !nown as a bridge rectifier/ +he diagram describes a diode@bridge design !nown as a full@wa(e rectifier or GraetD circuit/ Bridge Rectifier Circuit: +his design can be used to rectify single phase AC when no transformer center tap is a(ailable
+he essential feature of this arrangement is that for both polarities of the (oltage at the bridge input& the polarity of the output is constant/
Capacitors: Capaciti(e filters are used stabiliDed or perfect regulation of the (oltage/ +he capaciti(e filters are opted because& they are more efficient/ "ut they are also more costly/ %ifferent types of capacitors areI 1/ Ceramic capacitors/ 0/ #lectrolyte capacitors/ 3/ )aperH ica capacitors/ =/ Sil(er capacitors/ 8/ +antalum capacitors/
03
Ceramic& )aperH ica& Sil(er are nonpolariDed capacitors/ #lectrolyte and +antalum are polariDed capacitors/ 4or high frequency& Ceramic capacitors are used/ 4or low frequencies& #lectrolyte capacitors are used/
0=
Automatic Railway Gate Control As you can see in the figure abo(e there are four switching elements named as R5igh side leftR& R5igh side rightR& R'ow side rightR& R'ow side leftR/ Chen these switches are turned on in pairs motor changes its direction accordingly/ 'i!e& if we switch on 5igh side left and 'ow side right then motor rotate in forward direction& as current flows from )ower supply through the motor coil goes to ground (ia switch low side right/ +his is shown in the figure below/
Similarly& when you switch on low side left and high side right& the current flows in opposite direction and motor rotates in bac!ward direction/ +his is the basic wor!ing of 5@"ridge/ Ce can also ma!e a small truth table according to the switching of 5@"ridge e2plained abo(e/ +ruth +able 5igh 'eft 5igh Right 'ow 'eft 'ow Right %escription <n <ff <ff <n otor runs cloc!wise <ff <n <n <ff otor runs anti@cloc!wise <n <n <ff <ff otor stops or decelerates <ff <ff <n <n otor stops or decelerates As already said& 5@bridge can be made with the help of trasistors as well as <S4#+s& the only thing is the power handling capacity of the circuit/ 1f motors are needed to run with high current then lot of dissipation is there/ So head sin!s are needed to cool the circuit/ Jow you might be thin!ing why 1 did not discuss the cases li!e 5igh side left on and 'ow side left on or high side right on and low side right on/ Clearly seen in the diagram& you donSt want to burn your power supply by shorting them/ So that is why those combinations are not discussed in the truth table/ So we ha(e seen that using simple switching elements we can ma!e our own 5@"ridge& or other option we ha(e is using an 1C based 5@bridge dri(er/ "oth of them are discussed in the ne2t section of the tutorial/
$o%ely Pro&essional 'ni%ersity Punjab
08
Automatic Railway Gate Control QBJT )8Brid$e A simple 5@bridge can be made with the help of )ower "O+s li!e +1)31 and +1)30/ An e2ample and a wor!ing demo of this circuit is shown in the figure below/
0?
Q32+(' 'ual )8Brid$e .otor 'ri!er '093% is a dual 5@"ridge motor dri(er& So with one 1C we can interface two %C motors which can be controlled in both cloc!wise and counter cloc!wise direction and if you ha(e motor with fi2 direction of motion the you can ma!e use of all the four 1H<s to connect up to four %C motors/ '093% has output current of ?77mA and pea! output current of 1/0A per channel/ oreo(er for protection of circuit from bac! # 4 ouput diodes are included within the 1C/ +he output supply ,BCC0- has a wide range from =/8B to 3?B& which has made '093% a best choice for %C motor dri(er/
0A
0in 'e%cri"tion: 0in 5o unction 1 1nput (oltage ,8B@16B0 Ground ,7B3 Regulated outputE 8B ,=/6B@8/0B5ame 1nput Ground <utput
(.- IR ,E5,OR
,1R- light radiating from objects in its field of (iew/ )1R sensors are often used in the construction of PIR-based motion detectors ,see below-/ Apparent motion is detected when an infrared source with one temperature& such as a human& passes in front of an infrared source with another temperature& such as a wall/ All objects emit what is !nown as blac! body radiation/ 1t is usually infrared radiation that is in(isible to the human eye but can be detected by electronic de(ices designed for such a purpose/ +he term passive in this instance means that the )1R de(ice does not emit an infrared beam but merely passi(ely accepts incoming infrared radiation/ 1nfra meaning below our ability to detect it (isually& and Red because this color represents the lowest energy le(el that our eyes can sense before it becomes in(isible/ +hus& infrared means below the energy le(el of the color red& and applies to many sources of in(isible energy/
$o%ely Pro&essional 'ni%ersity Punjab
06
+he 1R range falls between the (isible portion of the spectrum and radio wa(es/ 1R wa(elengths are usually e2pressed in microns& with the lR spectrum e2tending from 7/A to 1777 microns/ <nly the 7/A@1= micron band is used for 1R temperature measurement/ *sing ad(anced optic systems and detectors& noncontact 1R thermometers can focus on nearly any portion or portions of the7/A@1= micron band/ "ecause e(ery object ,with the e2ception of a blac!body- emits an optimum amount of 1R energy at a specific point along the 1R band& each process may require unique sensor models with specific optics and detector types/ 4or e2ample& a sensor with a narrow spectral range centered at 3/=3 microns is optimiDed for measuring the surface temperature of polyethylene and related materials/ A sensor set up for 8 microns is used to measure glass surfaces/ A 1 micron sensor is used for metals and foils/ +he broader spectral ranges are used to measure lower temperature surfaces& such as paper& board& poly& and foil composites/
+he intensity of an objectSs emitted 1R energy increases or decreases in proportion to its temperature/ 1t is the emitted energy& measured as the targetSs emissi(ity& that indicates an objectSs temperature/ #missi(ity is a term used to quantify the energy@emitting characteristics of different materials and surfaces/ 1R sensors ha(e adjustable emissi(ity settings& usually from 7/1 to 1/7& which allow accurate temperature measurements of se(eral surface types/ +he emitted energy comes from an object and reaches the 1R sensor through its optical system& which focuses the energy onto one or more photosensiti(e detectors/ +he
$o%ely Pro&essional 'ni%ersity Punjab
09
Automatic Railway Gate Control detector then con(erts the 1R energy into an electrical signal& which is in turn con(erted into a temperature (alue based on the sensorSs calibration equation and the targetSs emissi(ity/ +his temperature (alue can be displayed on the sensor& or& in the case of the smart sensor& con(erted to a digital output and displayed on a computer terminal/
(.9 3.(-*
+he ' 386 is a great& easy@to@use dual@channel opamp/ <pamps ha(e so many applications we figured we should probably carry at least one in a %1) pac!age/ ' 386 applications include transducer amplifiers& %C gain bloc!s and all the con(entional opamp circuits/1f youSre loo!ing for a good& standard opamp the ' 386 should fill most of your needs/ 1t can handle a supply of 3@30B%C and source up to 07mA per channel/ +his opamp is great if you need to operate two indi(idual opamps from a single power supply/ Comes in an 6@pin %1) pac!age/
eature% T T T T T T T T T T T T A(ailable in 6@"ump micro S % chip siDed pac!age& ,See AJ@11101nternally frequency compensated for unity gain 'arge dc (oltage gainI 177 d" Cide bandwidth ,unity gain-I 1 5D ,temperature compensatedCide power supply rangeI Single supplyI 3B to 30B or dual suppliesI U1/8B to U1?B Bery low supply current drain ,877 VA-@essentially independent of supply (oltage 'ow input offset (oltageI 0 mB 1nput common@mode (oltage range includes ground %ifferential input (oltage range equal to the power supply (oltage 'arge output (oltage swing/
'e%cri"tion +he ' 186 series consists of two independent& high gain& internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply o(er a wide range of (oltages/ <peration from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply (oltage/ Application areas include transducer amplifiers& dc gain bloc!s and all the con(entional op amp circuits which now can be more easily implemented in single power supply systems/ 4or e2ample& the ' 186 series can be directly operated off of the standard G8B power supply
$o%ely Pro&essional 'ni%ersity Punjab
37
Automatic Railway Gate Control (oltage which is used in digital systems and will easily pro(ide the required interface electronics without requiring the additional U18B power supplies/
Chen starting a new project& simply select the microcontroller you use from the %e(ice %atabase and the VBision 1%# sets all compiler& assembler& lin!er& and memory options for you/
$o%ely Pro&essional 'ni%ersity Punjab
31
Automatic Railway Gate Control Jumerous e2ample programs are included to help you get started with the most popular embedded 6781 de(ices/
+he :eil VBision %ebugger accurately simulates on@chip peripherals ,1WC& CAJ& *AR+& S)1& 1nterrupts& 1H< )orts& AH% Con(erter& %HA Con(erter& and )C odules- of your 6781 de(ice/ Simulation helps you understand hardware configurations and a(oids time wasted on setup problems/ Additionally& with simulation& you can write and test applications before target hardware is a(ailable/ Chen you are ready to begin testing your software application with target hardware& use the <J81& <J397& <JA%1& or 4lash <J81 +arget onitors& the 1S%81 1n@System %ebugger& or the *'1J: *S"@O+AG Adapter to download and test program code on your target system/
+he VBision3 1%# is a Cindows@based software de(elopment platform that combines a robust editor& project manager& and ma!e facility/ VBision3 integrates all tools including the C compiler& macro assembler& lin!erHlocator& and 5#; file generator/
VBision3 helps e2pedite the de(elopment process of your embedded applications by pro(iding the followingI
4ull@featured source code editor& %e(ice database for configuring the de(elopment tool setting& )roject manager for creating and maintaining your projects& 1ntegrated ma!e facility for assembling& compiling& and lin!ing your embedded applications& %ialogs for all de(elopment tool settings& +rue integrated source@le(el %ebugger with high@speed C)* and peripheral simulator& Ad(anced G%1 interface for software debugging in the target hardware and for connection to :eil *'1J:& 4lash programming utility for downloading the application program into 4lash R< & 'in!s to de(elopment tools manuals& de(ice datasheets $ user.s guides/
+he VBision3 1%# offers numerous features and ad(antages that help you quic!ly and successfully de(elop embedded applications/ +hey are easy to use and are guaranteed to help you achie(e your design goals/ +he @Vi%ion( I'E and 'e1u$$er is the central part of the :eil de(elopment tool chain/ VBision3 offers a Build .ode and a 'e1u$ .ode/ 1n the VBision3 Build .ode you maintain the project files and generate the application/
$o%ely Pro&essional 'ni%ersity Punjab
30
Automatic Railway Gate Control 1n the VBision3 'e1u$ .ode you (erify your program either with a powerful C)* and peripheral simulator or with the ?eil =3I5? =,B8JTAG Ada"ter ,or other AG%1 dri(ersthat connect the debugger to the target system/ +he *'1J: allows you also to download your application into 4lash R< of your target system/
'e%cri"tion :eil Software de(elopment tools are used to create products for practically e(ery industryI consumer electronics& industrial control& networ!ing& office automation& automoti(e& space e2ploration/ icro Bision +wo is a second generation 1%# that simplifies project de(elopment and application testing/ Cith icro Bision +wo& we can easily create embedded applications in a mi2ture of C and assembly/ Real@time applications benefit from our highly optimiDed C libraries and real@time !ernels/ icroBision3 pro(ides a centraliDed front@end interface for the compiler& assembler& lin!er& debugger& and other de(elopment tools/ +he )roject Cindow in icroBision3 displays the current target& groups& and source files that comprise our project/ Rather than creating a single target for each project& icroBision0allows multiple targets for each project file/ So& with a single project file& we can create a target for simulating& a target for our emulator& and a production target for programming into #)R< X#@)R< Y/ #ach target is composed of one or more groups which are in turn composed of one or more source files/ Groups let us di(ide the source files into functional bloc!s or assign source files to different team members/ <ptions may be configured at each le(el of the project/ +his gi(es us a great deal of freedom and fle2ibility when organiDing our application/ 1n addition to the on@line help& icroBision3 pro(ides on@line (ersions of the de(elopment tool manuals as well as the de(ice manuals/ :eil C Compilers are based on the AJS1 standard and include e2tensions necessary to support the 6781& 081& and 1?? microcontroller families/ +he optimiDer in our compiler is tuned for each specific architecture and pro(ides the highest le(el of code density and e2ecution speed/ +he :eil C compilers gi(e full us control o(er our embedded platform/ Ce decide which register ban!s are used& when to access certain memory areas& which (ariables are stored in bits& when and how to use special function registers& and so on/ Cithout e(er writing any assembly code we may e(en write interrupt ser(ice routines in C/ Code generated by the :eil C Compiler compares with that of a professional assembly programmer/ +his is due to the le(el of optimiDations that are performed/ <ne such optimiDation is global register optimiDation/ "y analyDing which registers are used in each function& the compiler can better optimiDe register usage program@wide and generate smaller& faster programs/ +his is accomplished by iterati(e compilation steps during the ma!e process/ +he icroBision3 debugger is designed to ma!e testing your programs as efficient as possible/ Chile editing and debugging your programs& te2t and code attributes are displayed in the source window/ As you step through your program& the current line is mar!ed with a yellow arrow/ Code co(erage shows you which lines of your program ha(e been e2ecuted/ Green means the line has been run/ Grey means is has not/ "rea!points are clearly mar!ed in the source window/ Red for enabled& white for disabled/ +hese attributes ma!e following program flow easier than e(er/ +he features of the icro Bision +wo debugger don.t stop there/ Chen simulating your programs& you not only get source@le(el& symbolic simulation/ Zou also get on@chip peripheral simulation/ %ialog bo2es display the condition of all peripherals and on@chip components/
$o%ely Pro&essional 'ni%ersity Punjab
33
-. ,ource Code
<RG 77775 <B )1&[7445 <B )0&[775 "AC:I <B A&)1 COJ# A&[74#5& '1 ACA'' %#'AZ <B )0& [785 ACA'' %#'AZ SO ) "AC: '1I COJ#& [74%5& '0 ACA'' %#'AZ <B )0& [7A5 ACA'' %#'AZ SO ) "AC: '0I J<) SO ) "AC: %#'AZI <B R0& [088 AGA1JI <B R1&[088 5#R#I %OJ\ R1& 5#R# %OJ\ R0& AGA1J R#+ #J%
3=
38
Co%t of com"onent%
Component 69S80 A678 ' 386 '093% Crystal oscillator 1R sensors Cost
1/ 0/ 3/ =/ 8/ ?/
3?
3imitation% of e7i%tin$ %y%tem:8 1/ Chances of human error/ 0/ +ime consuming/ 3/ A lot of human resource is required/
eature% of 0ro"o%ed ,y%tem:8 1/ +he system will consist of 0 1R trans@recei(er pairs/ 0/ icro controller based circuit design/
3/ Automatic train sensing $ gate controlling/ =/ "idirectional gate controlling or "idirectional train sensing/ 8/ 1f required )C based G*1 for better interface/ ?/ +he gate will be closed till the whole train passes out/ A/ +he opening of gate will be sensor based not delay based/
3imitation: 1n this project sensors are placed on two sides of the trac! an when tarin comes the two sensors get disconnected which gi(es signal to controller and if any obstacle comes inbetween the trac! then also the signal will go to the controller which can create incon(enience to the road users/ oreo(er we are using wired system in this project so further project can be impro(ed by using wireless system/
3A
uture En2ancement
+his paper has satisfactorily fulfilled the basic things such as pre(ention of accidents inside the gate and the unnecessary of a gate!eeper/ "ut still the power supply for the motor operation and signal lights/ 1t can be a(oided and a battery charged by means of a solar cell/ 1t can be used directly during the daytime and by charging the battery during night/ 5ence this arrangement can be used in remote areas where the power supply can.t be e2pected/ +he obstacle detection part can be implemented using 4uDDy logic/ As it thin!s in different angles or aspects& the system wor!s still more efficiently/
Conclu%ion
+he idea of automating the process of railway gate operation in le(el crossings has been underta!en/ As the system is completely automated& it a(oids manual errors and thus pro(ides ultimate safety to road users/ "y this mechanism& presence of a gate!eeper is not necessary and automatic operation of the gate through the motor action is achie(ed/ icrocontroller 69C81 performs the complete operation i/e/& sensing &gate closing and opening operation is done by software coding written for the controller/ +he mechanism wor!s on a simple principle and there is not much of comple2ity needed in the circuit/
36
Reference%
39