This document describes the design of an automatic doorlock control system for railways in Indonesia using ultrasonic sensors. It aims to create a prototype using an Arduino board, servo motors, ultrasonic sensors and other components to automatically stop trains and lock the doors at railroad crossings for safety. The system is tested using two prototype methods - the first uses lights and sounds to indicate a train's presence, while the second adds an LCD display to show messages. Testing of the prototypes was concluded to provide a reference for fully automating railroad crossings to reduce accidents from human errors.