This project aims to develop an automatic railway gate control system using sensors and microcontrollers to prevent accidents. The system uses IR sensors to detect approaching trains and automatically opens and closes railway gates. An Arduino board controls DC motors connected to the gates using an L293D motor driver chip. When a train is detected, the gate closes to stop road traffic and prevent collisions at unmanned level crossings. The automatic system eliminates human errors and provides reliable operation without requiring constant human monitoring.