This document describes an automatic railway gate control system that uses a microcontroller and magnetic sensors to open and close railway gates automatically. The system uses a transformer, rectifier, and regulator to power the microcontroller circuitry. Magnetic sensors detect approaching trains and send signals to the microcontroller. The microcontroller then controls a motor driver to open and close the gate as needed. This automatic system aims to reduce accidents, maintenance costs, and human errors compared to manual railway gate systems.