Automatic Unmanned Railway Gate Control System

1.     AIM:
The aim of this project is to Automate unmanned railway gate using 8051 microcontroller.

2.     ABSTRACT:
The aim of this project is to Automate unmanned railway gate using microcontrollers. The objective of this project is to manage the control system of railway gate using the microcontroller. When train arrives at the sensing point alarm is triggered at the railway crossing point so that the people get intimation that gate is going to be closed. Then the control system activates and closes the gate on either side of the track. Once the train crosses the other end control system automatically lifts the gate. For mechanical operation of the gates stepper motors are employed. Here we are using embedded controller built around the 8051 family (AT89C52) for the control according to the data pattern produced at the input port of the micro controller, the appropriate selected action will be taken. The software program is written, by using the KEIL micro vision environment. The program written is then converted in HEX code after simulation and burned on to microcontroller using FLASH micro vision.  

3.     APPROACH: 
Present project is designed using 8051 microcontroller to avoid railway accidents happening at unattended railway gates, if implemented in spirit. This project utilizes two powerful IR transmitters and two receivers; one pair of transmitter and receiver is fixed at upside (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 of the Indian railway. We have considered 5 seconds for this project. Sensors are fixed at 1km on both sides of the gate. We call the sensor along the train direction as ‘foreside sensor’ and the other as ‘after side sensor’. When foreside receiver gets activated, the gate motor is turned on in one direction and the gate is closed and stays closed until the train crosses the gate and reaches aft side sensors. When aft side receiver gets activated motor turns in opposite direction and gate opens and motor stops. Buzzer will immediately sound at the fore side receiver activation and gate will close after 5 seconds, so giving time to drivers to clear gate area in order to avoid trapping between the gates and stop sound after the train has crossed.



4.     COMPONENTS:

1.      8051 microcontroller
2.      IR Transmitter
3.      IR Receiver
4.      Stepper Motor Circuit

Ø IR CIRCUITS
This circuit has two stages: a transmitter unit and a receiver unit. The transmitter unit consists of an infrared LED and its associated circuitry.
Ø IR TRANSMITTER
The IR LED emitting infrared light is put on in the transmitting unit. To generate IR signal, 555 IC based astable multivibrator is used. Infrared LED is driven through transistor BC 548. IC 555 is used to construct an astable multivibrator which has two quasi-stable states. It generates a square wave of frequency 38 kHz and amplitude 5 Volts. It is required to switch ‘ON’ the IR LED.
Ø IR RECEIVER
The receiver unit consists of a sensor and its associated circuitry.  In receiver section, the first part is a sensor, which detects IR pulses transmitted by IR-LED. Whenever a train crosses the sensor, the output of IR sensor momentarily transits through a low state. As a result the monostable is triggered and a short pulse is applied to the port pin of the 8051 microcontroller. On receiving a pulse from the sensor circuit, the controller activates the circuitry required for closing and opening of the gates and for track switching.
Ø STEP MOTOR
Step motors convert electrical energy into precise mechanical motion. These motors rotate a specific incremental distance per each step. The number of steps executed controls the degree of rotation of the motor’s shaft. This characteristic makes step motors excellent for positioning applications.
Step motors can be very accurately controlled in terms of how far and how fast they will rotate. The number of steps the motor executes is equal to the number of pulse commands it is given. A step motor will rotate a distance and at a rate that is proportional to the number and frequency of its pulse commands.

5.     CODE:
org 000h
mov p1,#00h
mov p0,#00h
mov p2,#0ffh
mov p3,#0ffh
main :
               lcall checkswitch1
               lcall checkswitch2
               sjmp main
checkswitch1:
off:      
                       mov a,p2
                       xrl a,#0ffh
                       cjne a,#01h, off
                       lcall switchon
                       ret
switchon:
                       mov a,#01h
                       mov p0,a
                       mov a,#66h
                       mov p1,a
                       lcall delay
                       mov p0,#00h
                       ret
checkswitch2:
off2:                            
                       mov a,p3
                       anl a,#0ffh
                       cjne a,#0feh, off2
                       lcall switch2on
                       ret
switch2on:
                       mov p0,#01h
                       mov p1,#09h
                       lcall delay
               mov p0,#00h
                       ret
delay:
                       mov r1,#013h
go:                              
                       mov r2,#30h
go2:                            
               djnz r2,go2  
               djnz r1,go
                       ret
end



6.     RESULT:

The code is implemented in Keil software and hardware is implemented in Proteus
software. Following snapshots are taken from Proteus software.

Ø Before Sensor 1 Crossing:
The Railway Gate is opened as no disturbance in Sensor 1 and Sensor 2


Ø After Signal 1 Crossing:
The Railway Gate is closed as train passes through the Sensor 1.


Ø After Signal 2 Crossing:

Again Railway Gate is opened as train passes through the Sensor 2.

Continue Reading

Multiple Choice Questions (MCQs) Checking


1.  Abstract:
This project is done for such a program where answers of the questions are fixed. Admin can change the answers but after setting the answer project will work for those answers. Program is done in HDL.
2.  Logic Diagram:
3.  Equivalent ASM Chart:
4.  State Diagram:
5.  Excitation Table:
6.  Verilog Code:
entity project is
port (
clk: in STD_LOGIC;
x: in STD_LOGIC;
y: out STD_LOGIC;
z: out STD_LOGIC);
end project;
architecture project_arch of project is

SYMBOLIC ENCODED state machine: Sreg0
type Sreg0_type is (
S1, S2, S3, S4, S5, S6, S7, S8, S9
);
attribute enum_encoding of Sreg0_type: type is ... -- enum_encoding attribute is not supported for symbolic encoding
signal Sreg0: Sreg0_type;

begin
----------------------------------------------------------------------
Machine: Sreg0
----------------------------------------------------------------------
Sreg0_machine: process (clk)
begin
if clk'event and clk = '1' then
Set default values for outputs, signals and variables
...
case Sreg0 is
when S1 =>
if x!=4'b1000 then
Sreg0 <= S3;
elsif x==4'b1000 then
Sreg0 <= S2;
end if;
when S2 =>
if x!=4'b1001 then
Sreg0 <= S5;
elsif x==4'b1001 then
Sreg0 <= S4;
end if;
when S3 =>
if x!=4'b1001 then
Sreg0 <= S5;
elsif x==4'b1001 then
Sreg0 <= S4;
end if;
when S4 =>
if x!=4'b1010 then
Sreg0 <= S7;
elsif x==4'b1010 then
Sreg0 <= S6;
end if;
when S5 =>
if x==4'b1010 then
Sreg0 <= S6;
elsif x!=4'b1010 then
Sreg0 <= S7;
end if;
when S6 =>
if x!=4'b0110 then
Sreg0 <= S9;
elsif x==4'b0110 then
Sreg0 <= S8;
end if;
when S7 =>
if x!=4'b0110 then
Sreg0 <= S9;
elsif x==4'b0110 then
Sreg0 <= S8;
end if;
when S8 =>
if x!=4'b1111 then
Sreg0 <= S1;
elsif x==4'b1111 then
Sreg0 <= S1;
end if;
when S9 =>
if x!=4'b1111 then
Sreg0 <= S1;
elsif x==4'b1111 then
Sreg0 <= S1;
end if;
--vhdl_cover_off
when others =>
null;
--vhdl_cover_on
end case;
end if;
end process;
end project_arch;

7.  Snap Shot of State Diagram:



Continue Reading

Pulse Code Modulation (PCM) and Demodulation

1. ABSTRACT:
Pulse Position Modulation (PPM) is a form of signal modulation in which M message bits are encoded by transmitting a single pulse in one of 2*2*2*2...... (M times) or (2 to the power M) possible time shifts. This is repeated every T seconds, such that the transmitted bit rate is M/T bits per second. It is primarily useful for optical communication systems, where there tends to be little or no multipath interference.
2. BLOCK DIAGRAM:



3. CONCEPT:
Message Signal (Sine Wave) with low frequency is passed through Carrier Signal (Sawtooth Wave) with high frequency (Fc>2Fm) and then do Pulse Width Modulation (PWM) of the message signal. To demodulate PPM signal use Phase Looked Loop (PLL) and Low Pass Filter (LPF) as shown in block diagram. 

4. SNAP-SHOTS:
Ø Message Signal:
Frequency=100Hz

Ø Carrier Signal:
Frequency=500Hz

Ø PWM Output:

Ø PPM Output:


Ø Demodulated Message Signal:

Continue Reading

OPTO-THERMO CONTROL RELAY SWITCH

1.  ABSTRACT:
Ø The circuit shows the working of opto-control switch, where LDR is used as a switch to open and close the circuit.
Ø 555 timer IC is used as a comparator.
Ø The product of RC is used to produce the delay in the IC and affects pulse propagation through it.
2.  COMPONENTS:
Ø Resistors (1k,47k,10k)
Ø Capacitors (2*.01uF, 1*4.7uF)
Ø IC LM555
Ø LDR (500 ohms)
Ø Speaker (8 ohms)
Ø Battery 9V

3.  CIRCUIT DIAGRAM:



Ø In P-Spice:
4.  OUTPUT RESPONSE:
Ø When Light is not falling on LDR:
·        Voltage:-
·       Current:-

Ø When Light is falling on LDR:
·       Voltage:-

·       Current:-

5.  APPLICATIONS:
Ø Used in parking system. When the car comes near the gate of garage, the parking lamp glows and the gate opens as the light falls on the LDR and the current passes through the circuit.
Ø Security alarm 





Continue Reading