automatic railway gate control using microcontroller

Post on 15-Apr-2017

656 Views

Category:

Technology

45 Downloads

Preview:

Click to see full reader

TRANSCRIPT

05/03/2023 1

AUTOMATIC RAILWAY GATE CONTROL USING MICROCONTROLLER

PRESENTED BYPUKESHWAR HARMUKHVARSHA SAHU M.Sc. 4th SEM.

05/03/2023 2

CONTENTS Introduction Aim of project Block diagram Working IR sensor DC motor Microcontroller Tools Embedded C Advantages Disadvantages Conclusion Reference

05/03/2023 3

INTRODUCTION In the rapidly flourishing country like ours, accidents at rail road crossing are increasing day by day.

The train accidents cause severe damage to life and property.

This project deals with one of the efficient method to avoid train accidents.

05/03/2023 4

The main aim of this project is to automize the unmanned railway gate.

The gate is closed automatically whenever the train comes and is opened after the train leaves the railway-road crossing

AIM OF THIS PROJECT:-

05/03/2023 5

1. VOLTAGE REGULATOR(7805)2. RESISTORS ( 100 KΩ, 300KΩ,470Ω ) 3. CAPACITOR (22PF,104PF ) 4. CRYSTAL OSCILLATOR(12MHZ)

5. MICROCONTROLLER ( AVR ATMEGA8 ) 6. DC MOTOR 7. 0BSTACLE DETECTOR 8. TRANSISTOR

COMPONENTS USED:-

05/03/2023 6

AUTOMATIC RAILWAY GATE CONTROL USING MICROCONTROLLER:-

05/03/2023 7

BLOCK DIAGRAM:-

05/03/2023 8

We used 2 sensors in our project sensor 1and sensor 2. The sensor consists at IR LED and photodiode. In our project we also used 2 DC motor (DC motor 1 and DC motor 2). The DC motor rotates forward and reverse direction. The IR LED emitted IR range light when this light incidence to coming train the obstacle occurs its reflected back then photodiode detects the light signal then according to detectors the light signal converts to electrical signal i.e. the voltage becomes high its high voltage fed to the microcontroller specified pin. Then the system executed and DC motor 1 rotates in forward and the DC motor 2 rotates reverse direction. Then the railway gate closes. When the train passed out from our project place the photodiode doesn’t receive any signal then the voltage becomes low and DC motor 1 rotate reverse and DC motor 2 rotates forward and the railway gate open.

WORKING:-

05/03/2023 9

CIRCUIT DIAGRAM

Fig. circuit diagram

05/03/2023 10

IR SENSORThis circuit has two stages: a transmitter unit and a receiver unit. (1) IR TRANSMITTER:The IR LED emitting infrared light is placed in the transmitting unit generate IR signal.(2) IR RECEIVER:The receiver unit consists of a sensor, which detects IR pulses transmitted by IR- LED.

OBSTACLE DETECTOR

Obstacle detector build is a combination of IR LED and PHOTODIODE with interfacing of OPM

05/03/2023 11

05/03/2023 12

CIRCUIT DIAGRAM OF IR SENSOR:-

Fig. circuit of IR sensor

05/03/2023 13

A direct current (DC) motor is a fairly simple electric motor that uses electricity and a magnetic field to produce torque, which causes it to turn.

This DC or direct current motor works on the principal, when a current carrying conductor is placed in a magnetic field, it experiences a torque and has a tendency to move.

DC MOTER

05/03/2023 14

H-BRIDGE MOTER DRIVER CIRCUIT:-

05/03/2023 15

AVR ATMEGA8 MICRO-CONTROLLERATmega8 is a 8-bit microcontroller based on the AVR RISC architecture

MEMORY SEGMENTS8K Bytes of Flash program memory.

512 Bytes non volatile EEPROM (Electrically Erasable Programmable Read Only Memory).

1K Byte Internal RAM (Random Access Memory).

05/03/2023 16

PIN DIAGRAM OF AVR ATMEGA8 MICROCONTROLLER

05/03/2023 17

Three ports i.e. Port B, Port C, Port D Three registers associated with every port DDRx – Data Direction Register PINx – Port input PORTx- Port output

‘x’ is subscript and could be either of PORT B, C, D

PORTS

05/03/2023 18

Port B is an 8-bit bi-directional I/O port.

Can be used either as a input port or as output port (direction must be specified in programming).

Port B (PB7..PB0)

Port C (PC6..PC0)

Port C is an 7-bit bi-directional I/O port

Can be used either as a input port or as output port (direction must be specified in programming).

05/03/2023 19

Port D is an 8-bit bi-directional I/O port

Can be used either as a input port or as output port ( direction must be specified in coding).

Port D (PD7..PD0)

05/03/2023 20

REGISTER DESCRIPTION OF I/O PORTS

05/03/2023 21

05/03/2023 22

05/03/2023 23

Examples :- To make all pins of port A as input pins :

DDRA = 0b00000000;

To make all pins of port A as output pins DDRA = 0b11111111;

To make lower nibble of port B as output and higher nibble as input DDRB = 0b00001111

05/03/2023 24

TOOLS Compiler : WinAVR/AVR Studio/CodeVision AVR. The programmer hardware.

Bread board, wires, power supply, crystal, etc.

05/03/2023 25

Embedded C is a nothing but a subset of c language is compatible with certain microcontrollers.

some features are added some header files like <avr/io.h>,<until/delay.h> scanf() and printf() are removed as the inputs are scanned from the sensors and output are given to the ports. control structure remain the same like if statement ,for loop, do while etc.

EMBEDED C

05/03/2023 26

*//headers #include<avr/io.h //header file for AVR i/o #include<until/delay.h> //header file for delay *// main program * int main() * while(1) code………..] *return(0);

Structure of a c program for an embedded system :-

05/03/2023 27

PROGRAMMING FOR AUTOMATIC RAILWAY GATE CONTROL PROJECT:- #include<avr/io.h> void main() DDRC=0b0000000; //set PORTC as input port DDRB=0b00011110; //PB1, PB2, PB3, PB4 as output port int ls=1, rs=1; // define & initialize ls, rs integer as 1 to

// acquire the left sensor status in ls an right sensor // status in rs

while(1) // create infinite loop

ls=(PINC&0b0000010); //acquire only left sensor status connected at PC1 rs=(PINC&0b0000100); // acquire only right sensor status connected at PC2

05/03/2023 28

if((ls==0b0000010)&(rs==0b0000100)) //check sensor status for both sensor ON PORTB=0b00010010; //close gate if((ls==0b0000000)&(rs==0b0000000)) //check sensor status for both sensor OFF PORTB=0b00001100; //open gate if((ls==0b0000000)&(rs==0b0000100)) PORTB=0b00010010; //close gate if((ls==0b0000010)&(rs==0b0000000)) PORTB=0b00010010; //close gate

05/03/2023 29

ADVANTAGESPrevention of accidents inside the gate.

Reliable machine, which operates the railway gate even without gatekeeper which makes it useful for operation at unmanned crossings.

Power supply for the motor operation and signal lights is required.

Battery which is charged by means of a solar cell can be used in remote areas where the power supply can’t be expected.

05/03/2023 30

DISADVANTAGESTo establish the entire network it is quite a costly task. Since these are the issues of the government cost doesn’t matter a lot.

The Arduino board is a delicate device so it has to be handled carefully.

05/03/2023 31

Avoids manual errors and provides ultimate safety to road users. Gatekeeper not necessary and automatic operation of the gate through the motor. The mechanism works on a simple principle.

CONCLUSION

05/03/2023 32

1. VOLTAGE REGULATOR(7805)2. RESISTORS ( 100 KΩ, 300KΩ,470Ω ) =5rs3. CAPACITOR (22PF,104PF ) =5rs 4. CRYSTAL OSCILLATOR(12MHZ) =6rs

5. MICROCONTROLLER ( AVR ATMEGA8 ) =75rs6. DC MOTOR =40rs7. 0BSTACLE DETECTOR =40rs 8. TRANSISTOR =8rs

PROJECT COST :- COST OF USED COMPONENT

=10rs

=189rs

INCLUDE OTHER COMPONENTS TOTAL COST IS 900rs

05/03/2023 33

REFERENCES:-www.kanda.com › Atmel AVR 89S and PLD › AVR Microcontrollers www.dnatechindia.com/IRSENSOR.com www.discovercircuits.com/DCmotor/.htm www.atmel.com/devices/ATMEGA8.aspx www.roboedutechindia.com

05/03/2023 34

top related