Documente Academic
Documente Profesional
Documente Cultură
1.1 INTRODUCTION
There are many railway crossings which are unmanned due to lack of man
power needed to fulfill the demands. Hence many accidents occur at such crossings
since there is no one to take care of the functioning of the railway gate when a train
approaches the crossing. This project is a step towards improving the status of such
unmanned railway crossings. Here, the railway gate is closed automatically as train
approaches the crossing and automatically the gate is opened after the train has
crossed. Here the magnetic switches have been utilized to sense the train approach
and departure.
This project is designed using Microcontroller IC 8051,the program is written
and stored in the ROM of the 8051.when the Microcontroller is powered up, the
controller starts working as per the program stored in the IC. To sense the train and to
control the gates, the ports of Microcontroller are utilized. The main advantage of
using Microcontroller, the size of the circuit is minimized to greater extent, consumes
less power, reliable and has high accuracy in its operation.
The two magnetic sensors are placed 1/4th KM away from the railway gate
crossing on either side of the gate .When the train approaches and passes on the
magnetic sensor the gate buzzer produces sound for few seconds , which indicates to
the motor vehicles that gate is about to close and no one should cross the gate.
Similarly once the Train passes on the other sensor kept at other side of the gates will
be opened. The distance of placing sensors can be adjusted. This project is facilitated
with multi options such as anti collision system for trains and it sends indication to the
driver in the train as soon as the track is cut or removed.
The technical aspects of Microcontroller are discussed in detail in the forth
coming chapters.
1
E-Automation For Trains
2
E-Automation For Trains
IR LED
DRIVER BUZZER
IR Tx IR Rx CKT
3
E-Automation For Trains
Magnetic sensors:
When the magnet is passed on the magnetic switch, it makes the magnetic
switch gets shorted. Using this principle, we can detect the train.
The magnetic sensors are used at either side of the Railway gate in order to
detect the arrival and departure of train at the Railway gate. The sensors has to be
1/4 KM away from the Railway gate on either side, the above distance is not
mandatory, this can be adjusted as per the requirement. The two magnetic switches
are connected to the Microcontroller in order to provide triggering to the ports of
Microcontroller.
Program:
A Microcontroller program is written and stored in chip, whose function of the
program is to open and close the Railway gate on the arrival and departure of the
Train. The program is written such a way that ,before closing the gate the
Microcontroller provides the beeping sound for predetermined time indicating to the
vehicle passers that gate is going to be closed.
Microcontroller:
The program is stored in the flash ROM of Microcontroller, once the power is
made ON, the Microcontroller checks the signals from it ports to detect the train
coming. Depending on the train arrival the ports of microcontroller sends signals to
the microcontroller, the microcontroller enables the port to activate to produce sound
for say 10 seconds, then the gate will be closed. Once the train leaves the gate the gate
will be automatically closed.
Ports:
4
E-Automation For Trains
The ports can be programmed as an input port or output port .In this project
the input port is used to sense the arrival and departure of train, the output ports are
used to bias the driver circuit to produce the
sound from the Buzzer. Similarly another port is also connected to the driver IC in
order to drive the Stepper motor.
5
E-Automation For Trains
6
E-Automation For Trains
Power Supply:
A centre tapped fullwave regulated power supply of 9V is
constructed for the operation of IR Tx and IR Rx circuits. In order to get
9V a regulated IC 7809 is employed.
IR Generator and Modulator circuit:
The IR Tx and receiver are placed to detect the any train coming in
opposite direction or any obstacle and the driver gets the beeping sound
and the collision can be avoided. It is an oscillator circuit comprises of
Astable multivibrator circuit constructed with the IC 555 timer. The
output, of 555 timer is a square generator, this oscillations is fed to the
Modulator circuit, whose signal is strengthened and applied to the IR
LED.
IR LED:
It converts the oscillations in to IR rays, these IR rays can not seen
by the eyes and does not affect by sun light and atmosphere.
IR Reciver:
IR receiver is one which senses the IR Rays and converts into
electrical signals.
IR Sensing circuit:
This section provides the biasing to the signal booster circuit
section to smaller value, just like preamplifier in amplifiers.
This section provides the biasing to the signal booster circuit
section to smaller value, just like preamplifier in amplifiers.
IR Signal Booster:
IR signal booster is one which increases the signal strength and fed
to the driver circuit.
Driver circuit:
7
E-Automation For Trains
8
E-Automation For Trains
Fig2.1: Circuit of diagram of interfacing 8051 with stepper motor and Buzzer
VCC:
Pin 40 provides supply voltage to the chip. The voltage source is +5V
9
E-Automation For Trains
GND:
Pin 20 is the ground.
XTAL1 and XTAL2
The 8051 has an on-chip oscillator but requires an external clock to run it.
Most often a quartz crystal oscillator connected to inputs XTAL1(pin 19) and XTAL2
(pin 18). The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs
two capacitors of 30 pF value. One side of each capacitor is connected to the ground
as shown in Circuit diagram
RST
Pin 9 is the RESET pin. It is an input and is active high (normally low).
Upon applying a high pulse to this pin, the microcontroller will reset and terminate all
activities. This is often referred to as a power-on reset. Activating a power-on reset
will cause all values in the registers to be lost.
When the Microcontroller is powered up ,the Program stored in the ROM of
Microcontroller starts executing and microcontroller functions as per the Program. In
this project the Microcontroller keeps on checking the signals arriving at the input
port, if there is no signal from it no function is taken Place. If the train is arriving near
to Railway gate say at 1/4 KM the sensor senses that the Train is arriving and gives
Sound for 10sec indicating that Train is arriving and all the Vehicles should stop
passing across the Railway gate ,then the gates are closed automatically, similarly
once the Train leaves the gate the gates are opened automatically. The same process is
repeated for all the Trains.
10
E-Automation For Trains
IC = CD 4011
Q1 = BC 548 (NPN)
R1 = 3.3 KΩ
R2 = 1 KΩ
D1= IN 4007
Relay = 9V, SPDT
11
E-Automation For Trains
When the two tracks are connected to tracks, the inputs of U1A become LOW
and the o/p of NAND gate1 becomes high. The o/p of NAND gate1 is connected to
the to the i/p of the NAND gate of U1B, Now the i/p of NAND gates U1B becomes
High and the o/p of NAND gate U1B becomes LOW, the transistor Q1 does not
conduct and the buzzer is OFF.
Similarly, when the track is cut the inputs of UA1 becomes HIGH and the o/p
of NAND gate becomes LOW. The o/p of NAND gate is connected to the to the i/p
of the NAND gate U1B, Now the i/p of NAND gates U1B becomes LOW and the o/p
of NAND gate U1B becomes HIGH, the transistor Q1 conducts and the buzzer is off.
12
E-Automation For Trains
13
E-Automation For Trains
The IC Tx-2 ,is an low frequency generator, when the switch s1 is connected
to the relay of metal sensor of track cut the FM Tx becomes automatically ON AND
transmits the signal. In FM Tx IC in built oscillator in IC generates frequency at pin
no.9, the pin no.9 is fed to the base of the transistor Q1,the Q1 starts conducting as per
the input signal coming from the pin no9.due to conduction of transistor, the capacitor
starts charging and discharging through the inductor, so the oscillations are generated
at collector of Q1 ,the o/p of Q1 is fed to the is fed to the base of Q2,now the
transistor Q2 starts conducting as per the oscillations, due to change in base current,
the collector current varies and therefore the crystal generates high frequency, the
high frequency is fed the antenna, the antenna converts electrical signal into
electromagnetic signals and transmits into space.
The FM receiver is tuned to receive the frequency of about 49 MHz with the
help of the capacitor C2 and the inductance L1 shown in the circuit diagram. The
signal from the antenna is fed to the base of the Transistor which conducts as per the
input signal, simultaneously the charging and discharging of the capacitor takes place
and this signal frequency is demodulated with the of receiver IC i.e. low frequency
signal is passed to the transistor T2 which amplifies the signal, the function of T3 is
also same as T2, this transistor increases the signal ,the amplified signal operates the
relay. The output of FM Rx is connected to the 8051in order to display the opposite
information
14
E-Automation For Trains
VCC
15
E-Automation For Trains
16
E-Automation For Trains
17
E-Automation For Trains
18
E-Automation For Trains
The advantages of using IR circuits is, these circuits are unaffected by sunlight
and other artificial lights, range of the this circuit is about 5 meters with out any
lenses. Range can be extended further by using lenses or reflectors with sensors.
19
E-Automation For Trains
20
E-Automation For Trains
2. Rectifier
3. Filter and
4. Regulator
TRANSFORMER
It is an electrical device which transfers the power from one
winding to the other winding with isolation. All the electronic gadgets
works for less voltage (normally 3V to 12V).So an step down transformer
is used, whose function is to step down the AC voltage from 230V to
required voltage depending on the need. In this project 12V-0-12V is used.
RECTIFIER CIRCUIT
It employs diodes, which converts AC voltage into DC voltage. The
output of rectifier circuit is not a pure DC. It also consists of some AC
components, which is called ripples. In order to remove these AC
components, filter circuits are employed. So the output of rectifier circuit
is fed to the filter circuit (capacitor).
FILTER CIRCUIT
Filter circuit employee’s electrolytic capacitors in-order to remove
the AC components. As we know the capacitor does not allow DC
components to pass through it because it offers high reactance to the DC
component .And offers less reactance to the AC component so all AC
components will be bypasses through the capacitors to ground.
REGULATOR
Regulator is an electronic circuit whose function is to keep output
always constant though the input is varied. In this project the three
terminal IC regulators of 7809 & 7805 is used for providing output DC
voltages. Eg 7809, the number 78 represents the positive regulator IC and
09 represents the output voltage i.e output is 9V
21
E-Automation For Trains
22
E-Automation For Trains
applications. However, since the vast majority of developers use the 40-
pin DIP package chip, we will concentrate on that.
Examining Figure 5.1, note that of the 40 pins, a total of 32 pins are
set aside for the four ports P0, P1, P2, and P3, where each port takes 8
pins. The rest of the pins are designated as V CC , GND, XTAL1, XTAL2,
XTAL1, XTAL2, RST, and EA) are used by all members of the 8051 and
8031 families.
In other words, they must be connected in order for the system to
work, regardless of whether the microcontroller is of the 8051 family.
The other two pins, PSEN and ALE, are used mainly in 8031-based
systems. We first describe the function of each pin. Ports are discussed
separately.
23
E-Automation For Trains
24
E-Automation For Trains
B 0000
PSW 0000
SP 0007
DPTR 0000
25
E-Automation For Trains
location 0000. This means that we must place the first line of
source code in ROM location 0 because that is where the CPU
wakes up and expects to find the first instruction. Figure 4-3 shows
two ways of connecting the RST pin to the power-on reset circuitry.
In order for the RESET input to be effective, it must have a
minimum duration of 2 machine cycles. In other words, the high
pulse must be high for a minimum of 2 machine cycles before it is
allowed to go low.
EA
The 8051 family members, such as the 8751, 89C51, or
DS5000, all come with on-chip ROM to store programs. In such
cases, the EA pin is connected to V CC . For family members such
26
E-Automation For Trains
ALE
ALE (address latch enable) is an output pin and is active
high. When connecting an 8031 to external memory, port 0
provides both address and data. In other words, the 8031
multiplexes address and data through port 0 to save pins. The ALE
pin is used for demultiplexing the address and data by connecting to
the G pin of the 74LS373 chip.
I/O port pins and their functions
The four ports P0, P1, P2, and P3 each use 8 pins, making
them 8-bit ports. All the ports upon RESET are configured as
output, ready to be used as output ports. To use any of these ports
as an input port, it must be programmed, as we will explain
throughout this section. First, we describe each port.
Port 0
Port 0 occupies a total of 8 pins (pins 32-39). It can be used
for input or output. To use the pins of port 0 as both input and
output ports, each pin must be connected externally to a 10K ohm
pull-up resistor. This is due to the fact that P0 is an open drain,
unlike P1, P2, and P3, as we will soon see. In any system using the
8751, 89C51, or DS5000 chips, we normally connect P0 to pull-up
resistors. See Figure 4-4. In this way we take advantage of port 0
for both input and output. With external pull-up resistors connected
upon reset, port 0 is configured as an output port. For example, the
following code will continuously send out to port 0 the alternating
values 55H and AAH.
MOV A, # 55H
BACK: MOV P0, A
ACALL DELAY
CPL A
SJMP BACK
27
E-Automation For Trains
Port 0 as input
With resistors connected to port 0, in order to make it an
input, the port must be programmed by writing 1 to all the bits. In
the following code, port 0 is configured first as an input port by
writing 1s to it, and then data is received from that port and sent to
P1.
MOV A, # OFFH ; A = FF hex
MOV P0, A ; make P0 an input port
; by writing all 1s to it
BACK : MOV A, P0 ; get data from P0
MOV P1, A ; send it to port 1
SJMP BACK ; keep doing it
28
E-Automation For Trains
Port 1
Port 1 occupies a total of 8 pins (pins 1 through 8). It can be
used as input or output. In contrast to port 0, this port does not
need any pull-up resistors since it already has pull-up resistors
internally. Upon reset, port 1 is configured as an output port. For
example, the following code will continuously send out to port 1 the
alternating values 55H and AAH.
MOV A, # 55H
BACK : MOV P1, A
ACALL DELAY
CPL A
SJMP BACK
Port 1 as input
To make port 1 an input port, it must programmed as such by
writing 1 to all its bits. In the following code, port 1 is configured
first as an input port by writing 1s to it, then data is received from
that port and saved in R7, R6, and R5.
MOV A, # 0FFH ; A=FF hex
MOV P1, A ; make P1 an input port
; by writing all 1s to it
MOV A, P1 ; get data from P1
MOV R7, A ; save it in reg R7
ACALL DEALY ; wait
MOV A, P1 ; get another data from P1
MOV R6, A ; save it in reg R6
ACALL DELAY ; wait
MOV A, P1 ; get another data from p1
MOV R5, A ; save it in reg R5
29
E-Automation For Trains
Port 2
Port 2 occupies a total of 8 pins (pins 21 through 28). It can be
used as input or output. Just like P1, port 2 does not need any pull-up
resistors since it already has pull-up resistors internally. Upon reset, port
2 is configured as an output port. For example, the following code will
send out continuously to port 2 the alternating values 55H and AAH. That
is, all the bits of P2 toggle continuously.
MOV A, # 55H
BACK : MOV P2, A
ACALL DELAY
CPL A
SJMP BACK
Port 2 as input
To make port 2 an input, it must programmed as such by
writing 1 to all its bits. In the following code, port 2 is configured
first as an input port by writing 1s to it. Then data is received from
that port and is sent to P1 continuously.
MOV A, # 0FFH ; A=FF hex
MOV P2, A ; make P2 an input port by
; writing all 1s to it
BACK : MOV A, P2 ; get data from P2
MOV P1, A ; send it to Port 1
SJMP BACK ; keep doing that
30
E-Automation For Trains
31
E-Automation For Trains
Low power versions of the 555 are made, such as the ICM7555, but these should only
be used when specified (to increase battery life) because their maximum output
current of about 20mA (with a 9V supply) is too low for many standard 555 circuits.
The ICM7555 has the same pin arrangement as a standard 555.
32
E-Automation For Trains
The circuit symbol for a 555 (and 556) is a box with the pins arranged to suit the
circuit diagram: for example 555 pin 8 at the top for the +Vs supply, 555 pin 3 output
on the right. Usually just the pin numbers are used and they are not labelled with their
function.
The 555 and 556 can be used with a supply voltage (Vs) in the range 4.5 to 15V (18V
absolute maximum).
Standard 555 and 556 ICs create a significant 'glitch' on the supply when their output
changes state. This is rarely a problem in simple circuits with no other ICs, but in
more complex circuits a smoothing capacitor (eg 100µF) should be connected across
the +Vs and 0V supply near the 555 or 556.
The input and output pin functions are described briefly below and there are fuller
explanations covering the various circuits:
• Astable - producing a square wave
• Monostable - producing a single pulse when triggered
• Bistable - a simple memory which can be set and reset
• Buffer - an inverting buffer (Schmitt trigger)
is slightly less than +vcc/3, the comparator “A2” output changes to high and
33
E-Automation For Trains
The reference voltage for the two comparators is obtained from an internal
voltage divider consisting of three equal resistors R of 5Kohm each. The
threshold comparator A1 is referenced at +2/3 Vcc and the trigger comparator A2
is referenced at +1/3Vcc.. The output of threshold and the trigger comparator are
GENERAL CHARACTERISTICS:
1. PIN 1 (Ground)
34
E-Automation For Trains
2. PIN 2 (Trigger): An external trigger plus is applied to this pin. The output of the
timer depends on the amplitude of the trigger pulse. If the trigger voltage is less than
+1/3Vcc,the timer output is high.
3. PIN 3 (output): The output of timer is taken from Q output of SR flip-flop. A load
is connected to this terminal in two ways.
i) The load can be connected between pin 3 and pin 1 (ground). The current
through the ground load is zero, when the output is zero. This is called as normally
off load.
ii) The load can be connected between pin 3 and pin-8 (supply voltage +v cc)
and the load is called as ‘normally on’. When the output is low, the load current
flows through the load into the output terminal and it is called ‘sink current’. On the
other hand, when the output is high, the current through the load is zero.
However, when the output is high, the output terminal supplies current to the
normally off load. This current is called the ‘source current’.
4. PIN 4 (Reset): The 555 timer can be reset by applying a negative pulse to this pin.
When the reset function is not used, it will be connected to +Vcc..
5. PIN 5 (Control): An external dc voltage may be applied to this pin to change the
threshold and trigger voltage level. By varying the control voltage, it is possible to
vary the pulse width of the timer output. If no external dc voltage is used, the control
pin is at +2/3 Vcc and this pin is bypassed to the ground to eliminate the noise.
threshold voltage (the reference voltage of comparator A1) is +2/3 Vcc.When the
voltage at threshold pin is above +2/3 Vcc. When the voltage at threshold pin is
above +2/3 Vcc,the output of comparator A1 goes high, which changes the timer
output to low.
35
E-Automation For Trains
8. PIN 8 (Vcc): A supply voltage of +5v to +18v is applied to this pin w.r.t. ground
(pin 1).
Transformer 12V-0-12V
Diodes D1, D2=IN 4001
Capacitors C1=1000uf, C2, C3, C4=0.1uf,
IC Regulator IC’s 7809 and & 7805
IC1=8051
IC2, IC3=ULN 2803
C1=10uf,C2, C3=33pf
R1=10k ohms R2=1k ohms
LCD
Crystal oscillator 11.0592 MHz
Connectors
IC = CD 4011
Q1 = BC 548 (NPN)
R1 = 3.3 KΩ
R2 = 1 KΩ
D1= IN 4007
36
E-Automation For Trains
Relay = 9V
Resistors:
R1-2.7K, R2-33K, R3-100K, R4-22K, R5-22K, R6-1.5K, R7-1.5K,
R8-2.7K, R9-1M, R10-10K, R11-2.7K, R12-1.5K, R13-4.7K,
Capacitors:
C1-100pf, C2-Trimmer, C3-100pf, C4-0.1 f, C5-0.02 f, C6-0.01 f,
C7-0.002f, C8-0.02f, C10-0.02f.
Inductors:
L1=10mH, L2=output transformer
37
E-Automation For Trains
Transistors:
T1=BF 194, T2=BC 558, T3=8050.
D1=D2=LED
6.6 IR TRANSMITTER
Resistors:
R1 = 150K
R2 = 15K
R3 = 41
R4 = 470
R5 = 4K
Capacitors:
C1 = O.1 µF
C2 = 0.1 µF
C3 = 100µF/25V
Transistors:
T1= BD 140
IR LED
6.7 IR RECIEVER
Resistors:
R1 = 1 K, R2 = 47 K, R3 = 470 K, R4 = 2.7 K, R5 = 2.2K, R6 = 1 K
R7 = 100 K, R8 = 130, R9 = 4.7 K, R10 = 4.7 K, R11= 22 K, R12 = 680
Capacitors:
C1 =104 µF, C2 = 104 µF, C3 = 10 µF
C4 = 100 µF, C5 = 100 µF
Transistors:
T1 = BC 547, T2 = BC 547, T3 = BC 557
T4 = BC 459, T5 = BC 459
7.1 TRANSISTORS
Transistors amplify current, for example they can be used to
amplify the small output current from a logic IC so that it can operate a
lamp, relay or other high current device. In many circuits a resistor is used
to convert the changing current to a changing voltage, so the transistor is
being used to amplify voltage.
40
E-Automation For Trains
7.2 RELAY
A relay is an electrically operated switch. Current flowing through
the coil of the relay creates a magnetic field which attracts a lever and
41
E-Automation For Trains
changes the switch contacts. The coil current can be on or off so relays
have two switch positions and most have double throw (changeover)
switch contacts as shown in the diagram.
Relays allow one circuit to switch a second circuit which can be
completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits, the link is
magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a
12V relay, but it can be as much as 100mA for relays designed to operate
from lower voltages. Most ICs (chips) cannot provide this current and a
transistor is usually used to amplify the small IC current to the larger
value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
Relays are usuallly SPDT or DPDT but they can have many more sets of
switch contacts, for example relays with 4 sets of changeover contacts are
readily available. For further information about switch contacts and the
terms used to describe them please see the page on switches.
Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the plastic
case of the relay.
The supplier's catalogue should show you the relay's connections. The coil
will be obvious and it may be connected either way round. Relay coils
produce brief high voltage 'spikes' when they are switched off and this can
destroy transistors and ICs in the circuit. To prevent damage you must
connect a protection diode across the relay coil.
The animated picture shows a working relay with its coil and switch
contacts. You can see a lever on the left being attracted by magnetism
when the coil is switched on. This lever moves the switch contacts. There
is one set of contacts (SPDT) in the foreground and another behind them,
making the relay DPDT.
42
E-Automation For Trains
7.3 CAPACITOR
Function
Capacitors store electric charge. They are used with resistors in
timing circuits because it takes time for a capacitor to fill with charge.
They are used to smooth varying DC supplies by acting as a reservoir of
charge. They are also used in filter circuits because capacitors easily pass
AC (changing) signals but they block DC (constant) signals.
Capacitance
This is a measure of a capacitor's ability to store charge. A large
capacitance means that more charge can be stored. Capacitance is
measured in farads, symbol F. However 1F is very large, so prefixes are
used to show the smaller values.
Three prefixes (multipliers) are used, µ (micro), n (nano) and p (pico):
• µ means 10 -6 (millionth), so 1000000µF = 1F
43
E-Automation For Trains
Circuit symbol:
Electrolytic Capacitors
Electrolytic capacitors are polarised and they must be connected the
correct way round, at least one of their leads will be marked + or -. They
are not damaged by heat when soldering.
There are two designs of electrolytic capacitors; axial where the leads are
attached to each end (220µF in picture) and radial where both leads are at
the same end (10µF in picture). Radial capacitors tend to be a little
smaller and they stand upright on the circuit board.
It is easy to find the value of electrolytic capacitors because they are
clearly printed with their capacitance and voltage rating. The voltage
rating can be quite low (6V for example) and it should always be checked
when selecting an electrolytic capacitor. If the project parts list does not
specify a voltage, choose a capacitor with a rating which is greater than
the project's power supply voltage. 25V is a sensible minimum for most
battery circuits.
44
E-Automation For Trains
Small value capacitors are unpolarised and may be connected either way
round. They are not damaged by heat when soldering, except for one
unusual type (polystyrene). They have high voltage ratings of at least 50V,
usually 250V or so. It can be difficult to find the values of these small
capacitors because there are many types of them and several different
labelling systems!
Many small value capacitors have their value printed but
without a multiplier, so you need to use experience to work
out what the multiplier should be! For example 0.1 means
0.1µF = 100nF.
Sometimes the multiplier is used in place of the decimal
point:
For example: 4n7 means 4.7nF.
45
E-Automation For Trains
• the 3rd number is the number of zeros to give the capacitance in pF.
• Ignore any letters - they just indicate tolerance and voltage rating.
For example: 102 means 1000pF = 1nF (not 102pF!)
For example: 472J means 4700pF = 4.7nF (J means 5% tolerance).
Function
LEDs emit light when an electric current passes through them.
Testing an LED
Never connect an LED directly to a battery or power
supply!
It will be destroyed almost instantly because too much
current will pass through and burn it out.
46
E-Automation For Trains
LEDs must have a resistor in series to limit the current to a safe value, for
quick testing purposes a 1k resistor is suitable for most LEDs if your
supply voltage is 12V or less. Remember to connect the LED the correct
way round!
For an accurate value please see calculating an LED resistor value below.
Colours of LEDs
LEDs are available in red, orange, amber, yellow, green, blue and white.
Blue and white LEDs are much more expensive than the other colours.
R = (V S - V L ) /
47
E-Automation For Trains
I
V S = supply voltage
V L = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)
Make sure the LED current you choose is less than the maximum permitted
and convert the current to amps (A) so the calculation will give the
resistor value in ohms ( ).
To convert mA to A divide the current in mA by 1000 because 1mA =
0.001A.
If the calculated value is not available choose the nearest standard resistor
value which is greater, so that the current will be a little less than you
chose. In fact you may wish to choose a greater resistor value to reduce
the current (to increase battery life for example) but this will make the
LED less bright.
For example
If the supply voltage V S = 9V, and you have a red LED (V L = 2V),
requiring a current I = 20mA = 0.020A,
R = (9V - 2V) / 0.02A = 350 , so choose 390 (the nearest standard value
which is greater).
7.5 DIODES
Example:
Circuit symbol:
48
E-Automation For Trains
Function
Diodes allow electricity to flow in only one direction. The arrow of the
circuit symbol shows the direction in which the current can flow. Diodes
are the electrical version of a valve and early diodes were actually called
valves.
Reverse Voltage
When a reverse voltage is applied a perfect diode does not conduct, but all
real diodes leak a very tiny current of a few µA or less. This can be
ignored in most circuits because it will be very much smaller than the
current flowing in the forward direction. However, all diodes have a
maximum reverse voltage (usually 50V or more) and if this is exceeded
the diode will fail and pass a large current in the reverse direction, this is
called breakdown.
Ordinary diodes can be split into two types: Signal diodes which pass
small currents of 100mA or less and Rectifier diodes which can pass large
currents. In addition there are LEDs (which have their own page) and
Zener diodes (at the bottom of this page).
49
E-Automation For Trains
Maximum
Maximum
Diode Reverse
Current
Voltage
1N4001 1A 50V
1N4002 1A 100V
1N4007 1A 1000V
1N5401 3A 100V
51
1N5408 3A 1000V
E-Automation For Trains
The Resistor
Colour Code
Colour Number
Black 0
Brown 1
Red 2
Orange 3
Resistor values - the resistor colour code Yellow 4
Resistance is measured in ohms, the symbol for ohm is Green 5
an omega . Blue 6
1 is quite small so resistor values are often given in k Violet 7
and M .
Grey 8
1 k = 1000 1 M = 1000000 .
White 9
Resistor values are normally shown using coloured
bands.
Each colour represents a number as shown in the table.
Most resistors have 4 bands:
52
E-Automation For Trains
This resistor has red (2), violet (7), yellow (4 zeros) and gold bands.
So its value is 270000 = 270 k .
On circuit diagrams the is usually omitted and the value is written 270K.
oscillations which are used to replace the LC tank circuit and can be seen
in many different types of crystal substances with the most important of
these for electronic circuits being the quartz minerals because of their
greater mechanical strength.
The quartz crystal used in Crystal Oscillators is a very small, thin piece or
wafer of cut quartz with the two parallel surfaces metallized to make the
electrical connections. The physical size and thickness of a piece of quartz
crystal is tightly controlled since it affects the final frequency of
oscillations and is called the crystals "characteristic frequency". Then
once cut and shaped the crystal can not be used at any other frequency.
The crystals characteristic or resonant frequency is inversely proportional
to its physical thickness between the two metallized surfaces. A
mechanically vibrating crystal can be represented by an equivalent
electrical circuit consisting of low Resistance, large Inductance and small
Capacitance as shown below.
Quartz Crystal
54
E-Automation For Trains
of the crystal also determines how it will behave as some crystals will
vibrate at more than one frequency. Also, if the crystal is not of a parallel
or uniform thickness it have two or more resonant frequencies having both
a fundamental frequency and harmonics such as second or third harmonics.
However, usually the fundamental frequency is more stronger or
pronounced than the others and this is the one used. The equivalent circuit
above has three reactive components and there are two resonant
frequencies, the lowest is a series type frequency and the highest a parallel
type resonant frequency.
We have seen in the previous tutorials, that an amplifier circuit will
oscillate if it has a loop gain greater or equal to 1 and it has positive
feedback.
55
E-Automation For Trains
To drive any output devices like Relay or Buzzer we need the driver circuit to
provide the required output voltage for their working. Here the output section
consists of two sections one speaker with amplifier for alarm purpose and another is
for relay.
Driver circuits to activate the +12 volts relay mechanism. For alarm purpose
we are using a special IC to generate the police siren sound and then it will be
amplified through an audio amplifier.
To activate the AC line, we must introduce a relay in the circuit, as we need to
switch ON/OFF. The power supply to the light etc. For this purpose the output from
the 555 would not have either sufficient voltage or current to operate relay directly.
So we are employing a relay mechanism. The above two NPN transistor with same
resistance network energies the relay mechanism. The above two NPN transistor BC
547 are connected in the form at Darlington pair mode.When a high signal is received
from 555 point, the relay will get energise to switch ON/O
56
E-Automation For Trains
The most common stepper motors have four stator windings that are paired
with a center-tapped common as shown in below figure.
Notice that while a conventional motor shaft runs freely, the stepper motor
shaft moves in a fixed repeatable increment which allows one to move it to a precise
position.
The stator poles are determined by the current sent through the wire coils. As
the direction of the current is changed, the polarity is also changed causing the reverse
motion of the rotor.
57
E-Automation For Trains
58
E-Automation For Trains
1 VSS …… Ground
6 E I/O Enable
59
E-Automation For Trains
E, enable
The enable pin is used by the LCD to latch information
presented to its data pins. When data is supplied to data pins, a
high-to-low pulse must be applied to this pin in order for the LCD
to latch in the data present at the data pins. This pulse must be a
minimum of 450 ns wide.
61
E-Automation For Trains
back1:mov c,p1.0
jnc clk
sjmp back1
63
E-Automation For Trains
mov a,#11h
64
E-Automation For Trains
MOV P1,#0FFH
UPP: SETB P1.0, A1
SJMP UPP
65
E-Automation For Trains
MOV A, # ‘T’ ;
ACALL DATA _ DISPLAY
MOV A, # ‘A ’ ;
ACALL DATA _ DISPLAY
MOV A, # ‘H’ ;
ACALL DATA _ DISPLAY
MOV A, # ‘E’ ;
ACALL DATA _ DISPLAY
MOV A, # ‘D’ ;
SJMP UPP
66
E-Automation For Trains
DATA_DISPLAY:
ACALL READY ; is LCD ready?
MOV P0, A ; issue data
CLR P2. 0 ; RS=1 for data
CLR P2. 1 ; R/W=0 to write to LCD
SETB P2. 2 ; E=1 for H-toL puls
READY:
SETB P0.7 ; make P1.7 input port
CLR P2.0 ; RS=0 access command reg
SETB P2.1 ; R/W=1 read command reg
; read command reg and check
busy flag
67
E-Automation For Trains
10.1 ADVANTAGES
10.2 APPLICATIONS
68
E-Automation For Trains
CONCLUSION
The Project “E-AUTOMATION FOR TRAINS” has been successfully designed and
tested.
It has been developed by integrating fetures of all the hardware components
used.Presence of every module has been reasoned out and placed carefully thus
contributing to the best working of the unit.
69
E-Automation For Trains
REFERENCES
1. www.project.com
2. www.atmel.com
3. www.wikipedia.com
4. www.national.com
70
E-Automation For Trains
BIBILIOGRAPHY
2. Radio Engineering
-- G. K. Mithal.
3. Principles of Electronics
-- V. K. Mehta.
6. Analog Circuits
-- D. V. Kamat & Sudha Kamat.
71