AUTOMATIC RAILWAY GATE CONTROL

58
1 AUTOMATIC RAILWAY GATE CONTROL (USING MICROCONTROLLERS)

Transcript of AUTOMATIC RAILWAY GATE CONTROL

Page 1: AUTOMATIC  RAILWAY  GATE   CONTROL

1

AUTOMATIC RAILWAY GATE CONTROL

(USING MICROCONTROLLERS)

Page 2: AUTOMATIC  RAILWAY  GATE   CONTROL

2

ACKNOWLEDGEMENT

The basic motto of our project is to show the importance of electronics field in controlling techniques. We have taken Microcontrollers as our key area to do our project work.

First of all we like to thank our honourable principal Mr.Ramachandran for providing us base to do our project. We hereby dedicate our project work to everyone who rendered their valuable support to us. We wish to express our profound thanks to all those who helped in making this project a reality. Much needed support and encouragement is provided by our HOD and our faculties.

We wish to thank Mr.Sanjeev kumar, Mr.Basheer.Mr. Kanagavel, Mr.Caran and Mr. Vinoth from Caliber Embedded Technologies who all guided us in an excellent manner. We express our heart felt thanks to Mr.Shiva who helped us to assemble our project effectively. Our project is dedicated to all the above.

By,

G.Valarumathi,

P.Valarmathi,

M.Vasanthamani,

Page 3: AUTOMATIC  RAILWAY  GATE   CONTROL

3

CONTENTS

CHAPTER

NO.

NAME OF THE CHAPTER PAGE

NO.

1 ABSTRACT 4

2 BLOCK DIAGRAM & DESCRIPTION 5

3 CIRCUIT DIAGRAM 8

4 CIRCUIT DESCRIPTION 9

5

a

b

c

d

HARDWARE DESCRIPTION

1.PIC 16F873

2.STEPPER MOTOR

3.SENSORS

5.OTHERS

10

12

18

20

6 COMPONENT SPECIFICATIONS

7 APPLICATIONS

8 DETAILED BUDGET

9 BIBILIOGRAPHY

Page 4: AUTOMATIC  RAILWAY  GATE   CONTROL

4

CHAPTER-1

ABSTRACT

Railways being the cheapest mode of transportation are preferred over all the other means .When we go through the daily newspapers we come across many railway accidents occurring at unmanned railway crossings. This is mainly due to the carelessness in manual operations or lack of workers. We, in this project have come up with a solution for the same. Using simple electronic components we have 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 been provided to alert the motorists about the approaching train.

Page 5: AUTOMATIC  RAILWAY  GATE   CONTROL

5

. CHAPTER-2

BLOCK DIAGRAM & DESCRIPTION

Page 6: AUTOMATIC  RAILWAY  GATE   CONTROL

6

Block diagram introduction:

The FIG2.1 shows the general block diagram of unmanned railway gate control, the various blocks of this are:

1. Power supply unit

2. Gate control unit

This project use PIC16F873 microcontroller for programming and operation along withULN2003 driver.

The Block diagram consists of the power supply, which is of single-phase 230V ac. This should be given to step down transformer to reduce the 230V ac voltage to lower value. i.e., to 9V or 18V ac this value depends on the transformer inner winding. The output of the transformer is given to the rectifier circuit. This rectifier converts ac voltage to dc voltage. But the voltage may consist of ripples or harmonics.

To avoid these ripples, the output of the rectifier is connected to filter. But the controller operates at 5V dc and the relays and driver operates at 12V dc voltage. So the regulator is required to reduce the voltage. Regulator 7805 produces 5V dc and regulator 7812 produces 12V dc. Both are positive ULN2003 the current driver chip. The supply of 12v is given to drive the stepper motor for the purpose of gate control

Page 7: AUTOMATIC  RAILWAY  GATE   CONTROL

7

OPERATION:

The above figure shows the view model of the project.This project utilizes two

powerful IR transmitters and two receivers; one pair of transmitter and receiver is

fixed at up side (from where the train comes) at a level higher than a human being

in exact alignment and similarly the other pair is fixed at down side of the train

direction. Sensor activation time is so adjusted by calculating the time taken at a

certain speed to cross at least one compartment of standard minimum size

The gate controlling unit consists of two pairs of infrared sensors placed at two sides of gate. They should keep at a distance of 9 cm (2km in usual case) from the gate. and a stepper motor is used for the purpose of the gate closing and opening. Interfaced to the ULN2003.

When train reaches the sensor, it is detected by IR sensors placed 9 cm before the station and led in the sensor will glow because the 555 timer works into quasi state of operation. such that the IR LED should glow till the timer works in quasi state i.e., when train passes away the sensors it again into normal state then it receives 5v at terminals that pin at the PIC 16F873 terminal goes high which enables the

Page 8: AUTOMATIC  RAILWAY  GATE   CONTROL

8

power to the stepper motor to rotate in steps which drives gate to close similarly when it reaches the second pair of sensors it senses and send the signal to the microcontroller to enable the current driver to open the gate by rotating the stepper motor in steps to get back in to original position

Train arrival detection:

Detection of train approaching the gate can be sensed by means of sensors R1, R2, R3&R4 placed on either side of the gate. In particular direction of approach, R1 is used to sense the arrival; R3 is used to sense the departure of the train. In the same way R4&R2 senses arrival and departure in the other direction. Train arrival and departure sensing can be achieved by means of relay technique. A confined part of parallel track is supplied with positive voltage and ground. As wheels of the train, is made up of aluminum which is a conducting material, it shorts two parallel tracks. When the wheels of the train moves over it, both tracks are shorted to ground and this acts as a signal to PIC 16F873 microcontroller indicating train arrival. The train detection in the other direction is done in the same way by the sensors R1 & R4. These sensors are placed five kilometers before the gate.

Warning for road users:

At that moment the train arrival is sensed on either of the gate, road users are warned about the train approach by RED signal placed to caution the road users passing through the gate .RED signal appears for the road user, once the train cuts the relay sensor placed before the 5Kms before the gate .A buzzer is for train, when there is any obstacle; signal is made RED for train in order to slow done its speed before 5km from gate.

Train departure detection:

Detection of train is also done using relay techniques as explained the head of train arrival detection. Sensor R3&R2 respectively considering direction of train approach do train departure. A message is displayed on LCD when train reaches the platform. Sensed by IR sensors.

Initial signal display:

Page 9: AUTOMATIC  RAILWAY  GATE   CONTROL

9

Signals are placed near gate each at a specified distance. Train may be approaching gate at either direction so all four signals are made RED initially to indicate gate is OPENED and vehicles are going through gate. The road user signals are made GREEN so that they freely move through gate. Buzzer is OFF since there is no approach of train and users need not be warned.

Page 10: AUTOMATIC  RAILWAY  GATE   CONTROL

10

Page 11: AUTOMATIC  RAILWAY  GATE   CONTROL

11

CHAPTER-4

CIRCUIT DIAGRAM DESCRIPTION

The supply +5v is given to the pin no.20 of PIC 16F73. The crystal oscillator of 4Mhz is connected to the pins 9 & 10 with two capacitors of 22pF in parallel. The reset switch is connected to the port A, first pin with the supply of 5v. The 8th & 19th pins are grounded. The two sensors IR1 & IR2 are connected to the port C ,1st & 2nd pins(11th & 12th pins). The input pins 1,2,3 &4 0f ULN2003A are connected to port C – 7,6,5 & 4th (18,17,16 & 15th pins) pins correspondingly. The buzzer is connected to the port B – 1st pin(21st pin). The LEDs indicating the traffic signals are connected to port B – 2nd & 3rd pins(22 & 23rd pins).

WORKING:

Initially the green signal glows, allowing the road users to cross the track. When train arrives between the transmitter & receiver of a sensor1 which is mounted on sides of the track few meters infront of the gate ,the sensor output goes low. As a result the PIC controller energises the stepper motor to rotate 90◦ forward which closes the gate. Simultaneously green signal turns OFF and red signal begins to glow. The buzzer beeps for three times indicating the closure of

the gate. When the train reaches the sensor2 mounted on the sides of the track a few meters behind the gate the sensor output goes low. The PIC waits until the sensor2 output goes high again. Then it energises the stepper motor to rotate 90◦ reverse. So the gate opens and the green signal begin to glow, switching OFF the red signal. Thus the circuit works.

Page 12: AUTOMATIC  RAILWAY  GATE   CONTROL

12

CHAPTER-5

HARDWARE DESCRIPTION

5a. PIC 16F873

PIN DIAGRAM:

Page 13: AUTOMATIC  RAILWAY  GATE   CONTROL

13

PIN DESCRIPTION:

Page 14: AUTOMATIC  RAILWAY  GATE   CONTROL

14

5b.INFRARED SENSORS

Infra-Red Proximity Sensor (I)USING AN IR LED AS A SENSORS

Overview

BASED ON A SIMPLE BASIC IDEA, THIS PROXIMITY SENSOR, IS EASY TO BUILD, EASY TO CALIBRATE AND STILL, IT PROVIDES A DETECTION RANGE OF 35 CM (RANGE CAN CHANGE DEPENDING ON THE AMBIENT LIGHT INTENSITY).

This sensor can be used for most indoor applications where no important ambient light is present. For simplicity, this sensor doesn't provide ambient light immunity, but a more complicated, ambient light ignoring sensor should be discussed in a coming article. However, this sensor can be used to measure the speed of object moving at a very high speed, like in industry or in tachometers. In such applications, ambient light ignoring sensor, which rely on sending 40 Khz pulsed signals cannot be used because there are time gaps between the pulses where the sensor is 'blind'...

The solution proposed doesn't contain any special components, like photo-diodes, photo-transistors, or IR receiver ICs, only a couple if IR leds, an

Op amp, a transistor and a couple of resistors. In need, as the title says, a standard IR led is used for the purpose of detection. Due to that fact, the

Page 15: AUTOMATIC  RAILWAY  GATE   CONTROL

15

circuit is extremely simple, and any novice electronics hobbyist can easily understand and build it.

Object Detection using IR light

It is the same principle in ALL Infra-Red proximity sensors. The basic idea is to send infra red light through IR-LEDs, which is then reflected by any object in front of the sensor.

Then all you have to do is to pick-up the reflected IR light. For detecting the reflected IR light, we are going to use a very original technique: we are going to use another IR-LED, to detect the IR light that was emitted from another led of the exact same type!This is an electrical property of Light Emitting Diodes (LEDs) which is the fact that a led Produce a voltage difference across its leads when it is subjected to light. As if it was a photo-cell, but with much lower output current. In other words, the voltage generated by the leds can't be - in any way - used to generate electrical power from light, It can barely be detected. that's why as you will notice in the

schematic, we are going to use a Op-Amp (operational Amplifier) to accurately detect very small voltage changes.

The electronic Circuit

Two different designs are proposed, each one of them is more suitable for different applications. The main difference between the 2 designs is the way infra-red (IR) light is sent on the object. The receiver part of the circuit is exactly the same in both designs.Note: Both the sender and the receiver are constructed on the same board. They are separated in the schematics for simplification.

Design 1: Low range, Always ON

Page 16: AUTOMATIC  RAILWAY  GATE   CONTROL

16

As the name implies, the sensor is always ON, meaning that the IR led is constantly emitting light. this design of the circuit is suitable for counting objects, or counting revolutions of a rotating object, that may be of the order of 15,000 rpm or much more. However this design is more power consuming and is not optimized for high ranges. in this design, range can be from 1 to 10 cm, depending on the ambient light conditions.

As you can see the schematic is divided into 2 parts the sender and the receiver.

The sender is composed of an IR LED (D2) in series with a 470 Ohm resistor, yielding a forward current of 7.5 mA.

The receiver part is more complicated, the 2 resistors R5 and R6 form a voltage divider which provides 2.5V at the anode of the IR LED (here, this led will be used as a sensor). When IR light falls on the LED (D1), the voltage drop increases, the cathode's voltage of D1 may go as low as 1.4V or more, depending on the light intensity. This voltage drop can be

detected using an Op-Amp (operational Amplifier LM358). You will have to adjust the variable resistor (POT.) R8 so the the voltage at the positive input of the Op-Amp (pin No. 5) would be somewhere near 1.6 Volt. if you understand the functioning of Op-Amps, you will notice that the output will go High when the volt at the cathode of D1 drops under 1.6. So the output will be High when IR light is detected, which is the purpose of the receiver.

In case you're not familiar with op-amps, here is shortly and in a very simplified manner, what you need

Page 17: AUTOMATIC  RAILWAY  GATE   CONTROL

17

to know to understand how this sensor functions: The op-amp has 2 input, the +ve input, and the -ve input. If the +ve input's voltage is higher than the -ve input's voltage, the output goes High (5v, given the supply voltage in the schematic), otherwise, if the +ve input's voltage is lower than the -ve input's voltage, then the output of the Op-Amp goes to Low (0V). It doesn't matter how big is the difference between the +ve and -ve inputs, even a 0.0001 volts difference will be detected, and the the output will swing to 0v or 5v according to which input has a higher voltage.

Some applications of the 'low range Always ON' Design: Notice how in both devices, the IR leds are encapsulated to protect them from ambient light. this kind of encapsulation was totally sufficient to overcome all noise due to ambient light for indoor applications.

Wheel EncoderThis is a simple wheel encoder based on the idea that white stripes will reflect IR light, while black ones will absorb it. this will result in a series of electrical pulses as the wheel is rotating, providing the microcontroller with precious information that can be used to calculate displacement, velocity or even acceleration. It is now clear that this kind of sensor has to be Always ON, to detect every single white stripe passing in front of it, to achieve accurate results.

Contact-Less tachometerThis is a tachometer, that counts the revolutions per minute of a rotating object, given that the object has a reflective stripe glued on it, that will pass in front of the IR sensor for each and every revolution, giving a pulse per revolution. Again a microcontroller will have to be used to 'understand' the data provided by the sensor and display it. Many commercial contact-less tachometers, that are sold for more than $200 rely on this simple idea![Build your own one for less than $20 in this article...]

Page 18: AUTOMATIC  RAILWAY  GATE   CONTROL

18

Design 2: High range, Pulsed IR

In this design, which is oriented to obstacle detection in robots, our primary target is to reach high ranges, from 25 to 35 cm, depending on ambient light conditions. The range of the sensor is extended by increasing the current flowing in the led. This is a delicate task, as we need to send pulses of IR instead of constant IR emission.The duty cycle of the pulses turning the LED ON and OFF have to be calculated with precision, so that the average current flowing into the LED never exceeds the LED's maximum DC current (or 10mA as a standard safe value).

The duty cycle is the ratio between the ON duration of the pulse and the total period. A low duty cycle will enable us to inject in the LED high instantaneous currents while shutting it OFF for enough time to cool down from the

Page 19: AUTOMATIC  RAILWAY  GATE   CONTROL

19

previous cycle.

Those 2 graphs shows the meaning of the duty cycle, and the mathematical relations between the ON time, the Total period, and the average current.

In the second graph, the average current in blue is exaggerated to be visible, but real calculations would yield a much smaller average current.

PULSED IR, DUTY CYCLE, AVERAGE AND INSTANTANEOUS CURRENT.

Now, hands on the circuit that will put all this theory into practice. The CTRL input in the figure, stands for Control, and this pin should be connected to the source of the low duty cycle pulses discussed above, whether it is a microcontroller or an LM555 timer that generates the pulses.

The calculations yielded that a 10 ohm resistor is series with the LED D2, would cause a current of approximately 250 mA to flow through the LED. A current this high, would destroy the LED if applied for a long period of time (some dozens of seconds), this is why we have to send low duty cycle pulses.

The first Op-amp will provide voltage buffer, to enable any kind of device to control the

Page 20: AUTOMATIC  RAILWAY  GATE   CONTROL

20

sensor, also, it will provide the 30mA base current required to drive the base of the transistor. The calculation of the the base resistor R3 depends on the type of transistor you use, thus on how much current you need on the base to drive the required collector current.

The receiver part of this schematic functions in the exact same way as in the first design, refer to the first, 'ALLWAYS ON' design for a detailed description.

Software based ambient light detection.

When the sensor is controlled by a microcontroller to generate the low duty cycle pulses, you can benefit from the High and Low pulses to be able to detect any false readings due to ambient light. This is done by recording 2 different outputs of the sensor, one of them during the ON pulse (the sensor is emitting infra red light) and the other during the OFF time. and compare the results.

Page 21: AUTOMATIC  RAILWAY  GATE   CONTROL

21

The Idea is enlightened by this graph, where in the first period, there is low ambient noise, so the microcontroller records a "1" during the on cycle, meaning that an object reflected the emitted IR Light, and then the microcontroller records a "0" meaning that during the OFF time, it didn't receive anything, which is logic because the emitter LED was OFF.

The following table show the possible outcomes of this method.

Output recorded during:Software based deduction

On pluse Off time

1 0 There is definitely an Obstacle in front of the sensor

1 1The sensor is saturated by ambient light, thus we can't

know if there is an obstacle

0 0There is definitely Nothing in front of the sensor, the

way is clear

0 1This reading is un logical, there is something wrong

with the sensor.

Page 22: AUTOMATIC  RAILWAY  GATE   CONTROL

22

Example C Code for 8051 microcontrollers

#include <REGX51.h> #include <math.h>

unsigned char ir; // to store the final resultbit ir1,ir2; // the 2 recording point required for our algorithm

delay(y){ // simple delay function

unsigned int i; for(i=0;i<y;i++){;}}

void main(){//P2.0 IR control pin going to the sensor//P2.1 IR output pin coming from the sensor

while(1){ P2_0 = 1; //send IR delay(20); ir1 = P2_1; P2_0 = 0; //stop IR delay(98); ir2 = P2_1;

if ((ir1 == 1)&(ir2 == 0)){ ir = 1; // Obstacle detected P2_3 = 1; // Pin 3 of PORT 2 will go HIGH turning ON a LED. if ((ir1 == 1)&(ir2 == 1)){ ir = 2; // Sensor is saturated by ambient light }else{ ir = 0; // The way is clear in front of the sensor. }}}

Page 23: AUTOMATIC  RAILWAY  GATE   CONTROL

23

Components positioning:

The correct positioning of the sender LED, the receiver LED with regard to each other and to the Op-Amp can also increase the performance of the sensor. First, we need to adjust the position of the sender LED with respect to the receiver LED, in such a way they are as near as possible to each others , while preventing any IR light to be picked up by the receiver LED before it hit and object and returns back. The easiest way to do that is to put the sender(s) LED(s) from one side of the PCB, and the receiver LED from the other side, as shown in the 3D model below.

This 3D model shows the position of the LEDs. The green plate is the PCB holding the electronic components of the sensor. you can notice that the receiver LED is positioned under the PCB, this way, there wont be ambient light falling directly on it, as ambient light usually comes from the top.

It is also clear that this way of positioning the LEDs prevent the emitted IR light to be detected before hitting an eventual obstacle.

Another important issue about components positioning, is the distance between the receiver LED and the Op-Amp. which should be as small as possible. Generally speaking, the length of wires or PCB tracks before an amplifier should be reduced, otherwise, the amplifier will amplify - along with the original signal - a lot of noise picked up form the electromagnetic waves traveling the surrounding.

Here is an example PCB where the distance between the LED and the Op-Amp is shown. Sure this distance is not as critical as you may think, it can be up to 35mm without causing serious problems, but trying to reduce this distance will Always give you better results.

Actually, when I design the PCB, I start by placing the receiver LED and the Op-Amp, as near to each others as possible, then continue the rest of the design.

Page 24: AUTOMATIC  RAILWAY  GATE   CONTROL

24

An example PCB construction

Here is an example construction of the PCB for the High Range, Pulsed IR proximity sensor. You can download here the project folder containing the schematic, the PCB design, and an example code for 8051 microcontroller to send the low duty cycle pulses.

In this design, the LM358 Op-Amp is mounded on the copper side, to save some space. The POT is the potentiometer used to adjust sensitivity.

As explained before, the sender and receiver LEDs are on both sides of the PCB.

Testing the High range Pulsed IR sensor

The last step, is to test the performance of the pulsed IR proximity sensor. To do this, I connected the sensor to a 89S52 microcontroller, loaded with a program to generate pulses with a duty cycle of approximately 1.6. at a frequency of 3Khz. LEDs are deigned to operate at very high frequencies, so you don't have to worry about the response time. To make sure your duty cycle calculations are correct, let the sensor running for a minute, and check with your fingers the temperature of the IR sender LED. If its not hot, then everything is alright. On the other hand, if the LED is getting hot, to an extent that you can feel it, there is probably something wrong, you should then try to decrease the duty cycle, or increase the series resistor, in order to decrease the average current flowing into the LED.

Then, you can start testing the range of the sensor, and experiment it in different ambient light conditions, but the potentiometer may have to be adjusted carefully, to cope with ambient light.

Page 25: AUTOMATIC  RAILWAY  GATE   CONTROL

25

In the example C code above, the final output of the sensor appears on the pin P2_3 of the microcontroller, as explained before.

Page 26: AUTOMATIC  RAILWAY  GATE   CONTROL

26

5b.STEPPER MOTOR

Description:

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 motor's

position can be controlled precisely, without any feedback mechanism (see open

loop control). Stepper motors are similar to switched reluctance motors (which are

very large stepping motors with a reduced pole count, and generally are closed-

loop commutated).

Fundamentals of Operation :

Stepper motors operate differently from normal DC motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a microcontroller. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth.

Page 27: AUTOMATIC  RAILWAY  GATE   CONTROL

27

When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet. So 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 those slight rotations is called a "step," with an integral number of steps making a full rotation. In that way, the motor can be turned by a precise angle. 7.5.3 Stepper motor characteristics

Stepper motors are constant power devices. As motor speed increases, torque

decreases. The torque curve may be extended by using current limiting drivers and

increasing the driving voltage. Steppers exhibit 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

torque. The effect can be mitigated by accelerating quickly through the problem

speed range, physically damping the system, or using a micro-stepping driver.

Motors with a greater number of phases also exhibit smoother operation than those

with fewer phases.

Open-loop versus closed-loop commutation :

Steppers are generally commutated open loop, i.e. the driver has no feedback on

where the rotor actually is. Stepper 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 sized but expensive

servomechanism system and an oversized 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

torque generation according to actual rotor position. This turns the stepper motor

into a high pole count brushless servo motor, with exceptional low speed torque

and position resolution.

Page 28: AUTOMATIC  RAILWAY  GATE   CONTROL

28

An advance on this technique 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:

There are three main types of stepper motors:

• Permanent Magnet Stepper

• Hybrid Synchronous Stepper

• Variable Reluctance Stepper

Two-phase stepper motors

There are two basic winding arrangements for the electromagnetic coils in a

two phase stepper motor: bipolar and unipolar.

Unipolar motors :

A unipolar stepper motor has logically two windings per phase, one for each direction of magnetic field. Since 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 common: giving three leads per phase and six leads for a typical two phase motor. Often, these two phase commons are internally joined, so the motor has only five leads.

Page 29: AUTOMATIC  RAILWAY  GATE   CONTROL

29

Unipolar stepper motor coils In the construction of unipolar stepper motor there are four coils. One 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. Specific color code may also be given. Like in my motor orange is first coil (L1), brown is second (L2), yellow is third (L3), black is fourth (L4) and red for common terminal.

By means of controlling a stepper motor operation we can

1. Increase or decrease the RPM (speed) of it2. Increase or decrease number of revolutions of it3. Change its direction means rotate it clockwise or anticlockwise

To vary the RPM of motor we have to vary the PRF (Pulse Repetition Frequency). Number of applied pulses will vary number of rotations and last to change direction we have to change pulse sequence.

So all these three things just depends on applied pulses. Now there are three different

modes to rotate this motor

1. Single coil excitation2. Double coil excitation3. half coil excitation

Unipolar stepper motors with six or eight wires may be driven using bipolar drivers by leaving the phase commons disconnected, and driving the two windings of each phase together [diagram needed]. It is also possible to use a bipolar driver to drive only one winding of each phase, leaving half of the windings unused [diagram needed].

Bipolar motor :

Page 30: AUTOMATIC  RAILWAY  GATE   CONTROL

30

Bipolar 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 H-bridge arrangement.

There are two leads per phase, none are common. Static friction effects using an H-

bridge have been observed with certain drive topologies Because windings are

better utilized, they are more powerful than a unipolar motor of the same weight.

8-lead stepper:

An 8 lead stepper is wound like a unipolar stepper, but the leads are not joined to

common internally to the motor. This kind of motor can be wired in several

configurations:

• Unipolar.

• Bipolar with series windings. This gives higher inductance but lower current per

winding.

• Bipolar with parallel windings. This requires higher current but can perform better

as the winding inductance is reduced.

• Bipolar with a single winding per phase. This method will run the motor on only half the available windings, which will reduce the available low speed torque but require less current.

Theory :

A step motor can be viewed as a synchronous AC motor with the number of poles (on both rotor and stator) increased, taking care that they have no common denominator. Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of poles (reluctance motor). Modern steppers are of hybrid design, having both permanent magnets and soft iron cores.

Page 31: AUTOMATIC  RAILWAY  GATE   CONTROL

31

To achieve full rated torque, the coils in a stepper motor must reach their full rated

current during each step.

Winding inductance and reverse EMF generated by a moving rotor tend to resist

changes in drive current, so that as the motor speeds up, less and less time is spent

at full current -- thus reducing motor torque. As speeds further increase, the current

will not reach the rated value, and eventually the motor will cease to produce

torque.

Pull-in torque :

This is the measure of the torque produced by a stepper motor when it is operated

without an acceleration state. At low speeds the stepper motor can synchronize

itself with an applied step frequency, and this Pull-In torque must overcome

friction and inertia.

Pull-out torque :

The stepper motor Pull-Out torque is measured by accelerating the motor to the

desired speed and then increasing the torque loading until the motor stalls or "pulls

Out of synchronism" with the step frequency. This measurement is taken across a

wide range of speeds and the results are used to generate the stepper motor's

dynamic performance curve. As noted below this curve is affected by drive

voltage, drive current and current switching techniques. It is normally

recommended to use a safety factor of between 50% and 100% when comparing

your desired torque output to the published "pull-Out" torque performance curve of

a step motor.

Detent torque :

Synchronous electric motors using permanent magnets have a remnant position holding torque (called detent torque, and sometimes included in the specifications)

Page 32: AUTOMATIC  RAILWAY  GATE   CONTROL

32

when not driven electrically. Soft iron reluctance cores do not exhibit this behavior.

Stepper motor ratings and specifications :

Stepper motors nameplates typically give only the winding current and occasionally the voltage and winding resistance. The rated voltage will produce the rated winding current at DC: but this is mostly a meaningless rating, as all modern drivers are current limiting and the drive voltages greatly exceed the motor rated voltage.

A stepper's low speed torque will vary directly with current. How quickly the

torque falls off at faster speeds depends on the winding inductance and the drive

circuitry it is attached to, especially the driving voltage.

Steppers should be sized according to published torque curve, which is specified

by the manufacturer at particular drive voltages and/or using their own drive

Page 33: AUTOMATIC  RAILWAY  GATE   CONTROL

33

circuitry. It is not guaranteed that you will achieve the same performance given

different drive circuitry, so the pair should be chosen with great care. Fig 7.5.6.0

RPM calculation:-

One can calculate the exact RPM at which motor will run. We know that motor needs 200 pulses to complete 1 revolution. Means if 200 pulses applied in 1 second motor will complete 1 revolution in 1 second. Now 1 rev. in 1 sec means 60 rev. in 1 minute. That will give us 60 RPM. Now 200 pulses in 1 sec means the PRF is 200 Hz. And delay will be 5 milli second (ms). Now let’s see it reverse.

* If delay is 10 ms then PRF will be 100 Hz.* So 100 pulses will be given in 1 sec* Motor will complete 1 revolution in 2 second* So the RPM will be 30.In same manner as you change delay the PRF will be changed and it will change RPM\

Applications

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

2. Industrial applications are in high speed pick and place equipment and multi-axis machine CNC machines often directly driving lead screws or ball screws.

3. In the field of lasers and optics they are frequently used in precision positioning equipment such as linear actuators, linear stages, rotation stages, goniometers, and mirror mounts.

4, Other uses are in packaging machinery, and positioning of valve pilot stages for fluid control systems.

5. Commercially, stepper motors are used in floppy disk drives, flatbed scanners, computer printers, plotters and many more devices.

Page 34: AUTOMATIC  RAILWAY  GATE   CONTROL

34

5C. INFRARED SENSORS

Introduction:

This infrared sensor also called as IR sensors, consists of two parts:

1. IR transmitter circuit

2. IR receiver unit

Page 35: AUTOMATIC  RAILWAY  GATE   CONTROL

35

5d.OTHERS

ULN 2003A

Relay drivers

Introduction:

IC, ULN2003A description:

• Pins, No. of:16 • Temperature, Operating Range:-20°C to +85°C

• Transistor Polarity:NPN • Transistors, No. of:7

• Case Style:DIP-16

• Temp, Op. Min:-20°C • Temp, Op. Max:85°C

• Base Number:2003

• Channels, No. of:7

• Current, Output Max:500mA • Device Marking:ULN2003A

• IC Generic Number:2003

• Input Type:TTL, CMOS 5V , Output Type: Open Collector

• Logic Function Number:2003 • Transistor Type: Power Darlington

• Voltage, Input Max:5V • Voltage, Output Max:50V

Page 36: AUTOMATIC  RAILWAY  GATE   CONTROL

36

PIN CONNECTIONS OF ULN2003:

The ULN2001A, ULN2002A, ULN2003 and ULN2004Aare high Voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mAand can withstand peak currents of 600mA.Suppressiondiodesare 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 DC motors; LED displays filament lamps, thermal print heads and high power buffers. The ULN2001A/2002A/2003A and 2004A are supplied in 16 pin plastic DIP packages with a copper lead frame to reduce thermal resistance. They are available also in small outline package (SO-16) as ULN2001D/2002D/2003D/2004D.

Page 37: AUTOMATIC  RAILWAY  GATE   CONTROL

37

POWER SUPPLY UNIT

Power supply unit consists of following units

i) Step down transformer ii) Rectifier unit iii) Input filteriv) Regulator unit v) Output filter

STEPDOWN TRANSFORMER :

The Step down Transformer is used to step down the main supply voltage from 230V AC to lower value. This 230 AC voltage cannot be used directly, thus it is stepped down. The Transformer consists of primary and secondary coils. To reduce or step down the voltage, the transformer is designed to contain less number of turns in its secondary core. The output from the secondary coil is also AC waveform. Thus the conversion from AC to DC is essential. This conversion is achieved by using the Rectifier Circuit/Unit.

RECTIFIER UNIT:

The Rectifier circuit is used to convert the AC voltage into its corresponding DC voltage. There are Half-Wave, Full-Wave and bridge Rectifiers available for this specific function. The most important and simple device used in Rectifier circuit is the diode. The simple function of the diode is to conduct when forward biased and not to conduct in reverse bias. The Forward Bias is achieved by connecting the diode’s positive with positive of the battery and negative with battery’s negative. The efficient circuit used is the Full wave Bridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from the obtained DC voltage are removed using other circuits available. The circuit used for removing the ripples is called Filter circuit.

Page 38: AUTOMATIC  RAILWAY  GATE   CONTROL

38

INPUT FILTER:

Capacitors are used as filter. The ripples from the DC voltage are removed and pure DC voltage is obtained. And also these capacitors are used to reduce the harmonics of the input voltage. The primary action performed by capacitor is charging and discharging. It charges in positive half cycle of the AC voltage and it will discharge in negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed before the regulator. Thus the output is free from ripples.

REGULATOR UNIT

Regulator regulates the output voltage to be always constant. The output voltage is maintained irrespective of the fluctuations in the input AC voltage. As and then the AC voltage changes, the DC voltage also changes. Thus to avoid this Regulators are used. Also when the internal resistance of the power supply is greater than 30 ohms, the output gets affected. Thus this can be successfully reduced here. The regulators are mainly classified for low voltage and for high voltage. Further they can also be classif

i) Positive regulator 1---> input pin 2---> ground pin 3---> output. It regulates the positive volt

ii) Negative regulator 1---> ground pin 2---> input pin 3---> output pin It regulates the negative voltage.

OUTPUT FILTER:

The Filter circuit is often fixed after the Regulator circuit. Capacitor is most often used as filter. The principle of the capacitor is to charge and discharge. It charges during the positive half cycle of the AC voltage and discharges during the negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed after the Regulator circuit to filter any of the possibly found ripples in the output received finally. Here we used 0.1µF capacitor. The output at this stage is 5V and is given to the Microcontroller

Page 39: AUTOMATIC  RAILWAY  GATE   CONTROL

39

CHAPTER-6

COMPONENT SPECIFICATIONS

S.NO COMPONENTS RANGE QUANTITY

1. PIC 16F73 28 pin 1

2. Stepper motor 1kg 1

3. Transformer 15-0-15

0-15-0

1

1

4. Crystal oscillator 4mhz 1

5. ULN2003A 16 pin 1

6. 28 pin base - 1

7. 16 pin base - 1

8. IR sensor pair 5mm 2

9. Buzzer - 1

10. LED Red

LED Green

-

-

2

2

11. Reset switch - 1

12. Train - 1

13. OP-amp IC741 1

14. Bridge rectifiers - 2

15. Regulator IC7805

IC7812

IC7912

1

1

1

Page 40: AUTOMATIC  RAILWAY  GATE   CONTROL

40

16. Capacitor 10µf

1000µf

22pf

3

3

2

17. Resistor 1kΩ

330Ω

10kΩ

1mΩ

2

3

15

2

18. Transistor BC547 5

19. GP board - 1

20. PC board - 1

21. Tripot - 2

Page 41: AUTOMATIC  RAILWAY  GATE   CONTROL

41

CHAPTER-7

APPLICATIONS

1. This project is developed in order to help the INDIAN RAILWAYS in making its present working system a better one, by eliminating some of the loopholes existing in it.

2. Based on the responses and reports obtained as a result of the significant development in the working system of INDIAN RAILWAYS, this project can be further extended to meet the demands according to situation.

3. This can be further implemented to have control room to regulate the working of the system. Thus becomes the user friendliness.

4. This circuit can be expanded and used in a station with any number of platforms as per the usage.

5. Additional modules can be added with out affecting the remaining modules. This allows the flexibility and easy maintenance of the developed system

6. A new approach for improving safety at Level crossings on Indian Railways has been suggested.

7. Each Level crossing should be assigned a hazard rating and the priority

of safety enhancement works be decided accordingly.

8. A regular assessment of safety performance should be done. This

approach should be able to bring down the rising trend in accidents at Level

Crossings.

Page 42: AUTOMATIC  RAILWAY  GATE   CONTROL

42

CHAPTER-8

DETAILED BUDGET

S.NO COMPONENTS COST(Rs)

1. PIC 16F73 180

2. Stepper motor 180

3. Transformer

4. Crystal oscillator

5. ULN2003A

6. 28 pin base

7. 16 pin base

8. IR sensor pair

9. Buzzer

10. LED Red,LED Green

11. Reset switch

12. Train

13. OP-amp

14. Bridge rectifiers

15. Regulator

16. Capacitors & Resistors

17. Transistors

18. GP board & PC board

19. Tripot

Page 43: AUTOMATIC  RAILWAY  GATE   CONTROL

43

CHAPTER-9

BIBLIOGRAPHY

SITES:

1.www.google.com

2.www.scribd.com

Page 44: AUTOMATIC  RAILWAY  GATE   CONTROL

44