Beruflich Dokumente
Kultur Dokumente
CHAPTER 1
INTRODUCTION
1.1 Introduction
By the presently existing system once the train leaves the station, the
stationmaster informs the gatekeeper about the arrival of the train through the
telephone. Once the gatekeeper receives the information, he closes the gate
depending on the timing at which the train arrives. Hence, if the train is late due
to certain reasons, then gate remain closed for a long time causing traffic near
the gates.
By employing the automatic railway gate control at the level crossing the
arrival of the train is detected by the sensor placed near to the gate. Hence, the
time for which it is closed is less compared to the manually operated gates and
also reduces the human labour. This type of gates can be employed in an
unmanned level crossing where the chances of accidents are higher and reliable
operation is required. Since, the operation is automatic; error due to manual
operation is prevented.
Automatic railway gate control is highly economical microcontroller based
arrangement, designed for use in almost all the unmanned level crossings in the
country.
1.2 Aim of the project
The main aim of this project is to operate and control the unmanned
railway gate in the proper manner in order to avoid the accidents in the
unmanned railway crossing. In a country like ours where there are many
unmanned railway crossings, accidents are increasing day by day. These train
accidents are due to the absence of human power in the railway. In order to
Dept of EIE
Page 1
Dept of EIE
Page 2
CHAPTER 2
BLOCKDIAGRAM AND DESCRIPTION
2.1 Block Diagram
In this chapter the block diagram of the project and design aspect of
independent modules are considered. Block diagram is shown in fig: 2.1
230V ac. This should be given to step down transformer to reduce the
230V ac voltage to lower value. i.e., 9V to 12V ac this value depends on the
Dept of EIE
Page 3
Dept of EIE
Page 4
CHAPTER 3
COMPONENTS OF THE PROJECT
3.1 REGULATED POWER SUPPLY
3.1.1 Introduction
Power supply is a supply of electrical power. A device or system that
supplies electrical or other types of energy to an output load or group of loads is
called a power supply unit or PSU.
A power supply may include a power distribution system as well as
primary or secondary sources of energy such as
Dept of EIE
Page 5
Fig 3.2 Circuit diagram of Regulated Power Supply with Led connection
The components used in regulated power supply are
230V AC MAINS
TRANSFORMER
BRIDGE RECTIFIER(DIODES)
CAPACITOR
RESISTOR
as follows:
Transformation The process of transforming energy from one device to
another is called transformation. For transforming energy we use transformers.
Dept of EIE
Page 6
Page 7
For example, if the secondary has half the primary turns; the
secondary will have half the primary voltage. Another example is if the primary
has 5000 turns and the secondary has 500 turns, then the turns ratio is 10:1.
There step up and step down transformers.
Step Up transformer
In case of step up transformer, primary windings are every less compared to
secondary winding. Because of having more turns secondary winding accepts
more energy, and it releases more voltage at the output side.
Step down transformer
Incase of step down transformer, Primary winding induces more flux than
the secondary winding, and secondary winding is having less number of turns
because of that it accepts less number of flux, and releases less amount of
voltage.
Regulation
The process of converting a varying voltage to a constant regulated
voltage is called as regulation. For the process of regulation we use voltage
regulators.
3.1.4 Voltage Regulator
A voltage regulator (also called a regulator) with only three
terminals appears to be a simple device, but it is in fact a very complex
integrated circuit. It converts a varying input voltage into a constant regulated
Dept of EIE
Page 8
Dept of EIE
Page 9
3.1.6 Capacitors
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
Dept of EIE
Page 10
Working
The structure of the LED light is completely different than that of the
light bulb. Amazingly, the LED has a simple and strong structure. The lightemitting semiconductor material is what determines the LED's color. The LED
is based on the semiconductor diode.
Dept of EIE
Page 11
Dept of EIE
Page 12
High-efficiency
No UV Rays
Visual signal application where the light goes more or less directly from the
Generate light for measuring and interacting with processes that do not
opening and
Dept of EIE
Page 13
AT89S52
is
low-power,
high-performance
CMOS
8-bit
Page 14
Supply voltage
GND
Ground.
Port 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high-impedance inputs. Port 0 can also be configured to be the multiplexed
low-order address/data bus during accesses to external program and data memory.
In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during
Flash programming and outputs the code bytes during program verification.
External pull-ups are required during program verification.
Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs,
Port 1 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger
input (P1.1/T2EX), respectively, as shown in the follow-ing table. Port 1 also
receives the low-order address bytes during Flash programming and verification.
Dept of EIE
Page 15
Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that use
16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3: It is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3
pins that are externally being pulled low will source current (IIL) because of the
pull-ups. Port 3 receives some control signals for Flash programming and
verification. Port 3 also serves the functions of various special features of the
AT89S52, as shown in the following table.
Dept of EIE
Page 16
RST: Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used
to disable this feature. In the default state of bit DISRTO, the RESET HIGH out
feature is enabled.
ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low
byte of the address during accesses to external memory. This pin is also the
program pulse input (PROG) during Flash programming. In normal operation,
ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used
for external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is
active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in
external execution mode.
PSEN: Program Store Enable (PSEN) is the read strobe to external program
memory. When the AT89S52 is executing code from external program memory,
Dept of EIE
Page 17
Dept of EIE
Page 18
Dept of EIE
Page 19
Dept of EIE
Page 20
Dept of EIE
Page 21
Page 22
Dept of EIE
Page 23
Page 24
Dept of EIE
Page 25
Dept of EIE
Page 26
Page 27
Dept of EIE
Page 28
Dept of EIE
Page 29
Dept of EIE
Page 30
Page 31
Dept of EIE
Page 32
CHAPTER 4
SOFTWARE DESCRIPTION
This project is implemented using following softwares:
Dept of EIE
Page 33
Dept of EIE
Page 34
Dept of EIE
Page 35
3. Copy the example to the Right into the new window. This file will toggle
Ports 1 and 2 with a delay.
4. Click on File menu and select Save As
5. Name the file Toggle.a51
Dept of EIE
Page 36
Dept of EIE
Page 37
Dept of EIE
Page 38
PC and Board
UART-0 (CN3).
Supply power into board; in this case, we can see red LED1 is in status ON.
Run Program Flash Magic, it will display result as shown in Figure 1.1
Dept of EIE
Page 39
Press ISP LOAD Switch (S1) and RESET Switch (S2) on Board ARM7
LPC2148 Development Board to reset MCU to run in Boot Loader
following the processes;
Press RESET Switch (S2) while ISP LOAD Switch (S1) is being held.
Remove RESET Switch (S2) but ISP LOAD Switch (S1) is being held.
Page 40
PC and Board
UART-0 (CN3).
Supply power into board; in this case, we can see red LED1 is in status ON.
Set jumper BR4 (INT1) in ON state.
Dept of EIE
Page 41
Start setting the initial values into program as desired, so we configure values
into program as follow sections.
Step-1 Communication
Dept of EIE
Page 42
internal
Now here tick mark the Erase all Flash option. This is the most crucial thing
because wrong selection in this step can be resulting into lost of boot loader in
your chip. Nothing to worry if you lost your boot loader because you can again
load it but to load boot loader you must program you chip through universal
Dept of EIE
Page 43
This is very simple and you need to set up a path of your Hex file which is to be
loaded on chip.
Step-4 Options
Set Option to be Verify after programming.
In this always keep Verify after programming option enable by tick mark. You
can use another features as well according to your need.
Step-5 Start
Click Start, Program Flash Magic will start downloading data into
MCU instantly. In this case, we can see the status operation at Status Bar and
we must wait for the operation until it is completed. When the operation of
program is complete, press RESET Switch (S2) on Board and MCU will start
running follow the downloaded program instantly.
Dept of EIE
Page 44
CHAPTER 5
5.1 Advantages
1. Automatic opening and closing of railway gate.
2. Automatic sensing of arrival and departure of train.
3. Efficient and low cost design.
4. Low power consumption.
5.2 Disadvantages
Improper installation of load cells leads to wrong operation of the gate.
5.3 Applications
This system can be used in real time to control any gate openings and
door opening systems.
5.4 Conclusion
Integrating features of all the hardware components used have been
developed in it. Presence of every module has been reasoned out and placed
carefully, thus contributing to the best working of the unit. Secondly, using
highly advanced ICs with the help of growing technology, the project has been
successfully implemented. Thus the project has been successfully designed and
tested.
Dept of EIE
Page 45
Dept of EIE
Page 46
Appendix A
Program code for automatic railway gate control system using load cell
#include <reg51.h>
#include <stdlib.h>
#include <lcd.h>
#include <adc.h>
#define adc_databus P1
Sbit M1 = P2^2;
Sbit M2 = P2^3;
Void delay_ms (unsigned int dly);
Void write_cmd (char c);
Void write_string (char*s);
Void write data (char t);
Void Return Home (void);
Void init_lcd (void);
Void init_ports (void);
Void delay_ms (unsigned int dly);
Void delay_us (unsigned int us_count);
void ADC_Init();
Unsigned char ADC_StartConversion (char channel);
Dept of EIE
Page 47
Page 48
Page 49
Page 50
Dept of EIE
Page 51
Circuit Diagram
In this chapter, schematic diagram and interfacing of 8051 microcontroller
with each module is considered.
Dept of EIE
Page 52