This document describes an automatic system for detecting cracks and fires in trains using Internet of Things (IoT) technology. Infrared sensors are placed on trains to detect any cracks in the railway tracks. If a crack is found, its location is determined using a GPS module and sent via GSM module to the authorities. Fire detection sensors are also installed in trains to detect fires and activate sprinklers. The system aims to provide quick emergency response, reduce human workload, and prevent accidents by automatically monitoring track conditions and responding to issues in real-time.