An automatic railway gate control system using an Arduino UNO and IR sensors is proposed in this study. The manually operated rail gates can be converted into automatic control of railway gates using different types of sensors. These are mostly needed where the track passes over a city, neighborhood, or redundant gateways of the passage regions. The gates are currently manually operated by gatekeepers according to the existing system, depending on signals obtained from the control centre. Accidents are most likely to occur in such cases, causing severe loss of human lives and property near rail crossing zones. The programmed railway gate regulator tracks the movement of the train and detects obstacles, thereby notifying the server motor to open or close the gate automatically. This study also suggests the effective use of real-time information on the train positions. The main objective of this study is to safeguard efficiency, quality, time management, public safety and automation.