This document describes a project to automatically control a railway gate using a microcontroller. The system uses a vibration sensor to detect when a train is approaching, which triggers an alarm and closes the gate using a stepper motor. An AT89C52 microcontroller is used to manage the control system and avoid accidents at unmanned railway crossings. The hardware components include the microcontroller, vibration sensor, stepper motor, motor driver, and buzzer. The software used includes Keil IDE and Proteus for circuit simulation. The project aims to provide accurate train detection and automatic gate operation for human safety without requiring human control of the gates.