The document proposes an automatic system for controlling railway gates at crossings and detecting cracks in railway tracks using sensors to improve safety. The system uses IR sensors, a microcontroller, GPS, GSM modules and internet of things technology to automatically open and close gates based on train arrival and detect the location of any cracks without human intervention. If a crack is detected, the location coordinates are sent via GSM to a website for operators to take further action.