This document discusses the development of an automatic railway gate control system using four infrared (IR) sensors and a microcontroller, specifically the Arduino Uno, to prevent accidents at unmanned level crossings. The system detects the arrival and departure of trains, automatically closing the gate with warning signals and opening it once the train has passed, thereby enhancing safety and reducing human error. The design includes hardware implementation with servo motors and LED indicators, and is programmed in C++ for efficient operation.