In this world people uses various types of transportation system to travel from one place to another place. Mostly they give importance to public transportation for safer journey. At the same time the transport departments check out the safety measures implemented in them. The proposed system is suitable for railways transportation to identify the cracks in the railway tracks earlier and prevent the accidents. In this paper to use crack detection sensor, this will be placed in the train engine. By this, if some crack is detected on the track the train starts to slow and stop at respective point automatically and exact place of crack would be given to control room. Secondly the next cause of accidents is prevented from two trains opposite in same track by using the same sensors fitted in the engine, if the sensor senses the same signal from opposite train then it automatically applies the brake and stops the train at certain distance. The derailment causes several loses in railway accidents. The proposed system introduces Bluetooth based technology, to prevent the trains accident. The Bluetooth device is installed at each front end of the locomotive. If the train starts to derail, automatically signal is breaked and an alert is given to engine driver and on the other emergency brake is applied automatically. The main aim of the work is to avoid the train accidents without manual power.