We have filed our fourth Indian Patent title “A method for axle counting, direction detection and classification of railway vehicle” The invention discloses a real time-based method for counting axles of railway vehicles. The system includes an FBG sensor, Optoelectronic instrument, data processing unit (DPU), Ethernet switch, Wi-Fi access point and 4G/LTE cellular gateway. The method comprises a sensor displaced at sensing point on the rail, senses the strain in FBG sensors in terms of Bragg wavelength, data processing unit (DPU) processes the sensors datasets, and sets the threshold value of the sensor to detect the number of axles of the train. The solution of counting vehicle axles is achieved by Fiber Bragg grating sensors. Therefore, the method overcomes the existing problems and provides real-time counting, a highly stable, non-interference method with false peaks detection at the window boundaries of sensor data. The method is also detecting the direction of railway vehicles and classifies between engine and coach.