This study introduces a self-powered and self-sensing vehicle speed detection sensor, representing a significant advancement in transportation. The system employs mechanical components like a slider crank, bevel gears, and one-way bearings for unidirectional rotation, converting translational motion into electrical energy upon the impact of vehicle tyres on road studs. The electrical power generation module, including a DC generator, rectifier, and battery circuit, captures and stores this energy. In addition to energy harvesting, the system integrates a deep learning model using Long Short-Term Memory (LSTM) networks to precisely calculate vehicle speed from the displacement signals of the road studs. Displacement data from an SR-04 sensor is processed and fed into the LSTM network, achieving a classification accuracy of 99.45% for vehicle speeds of 5, 10, 15, and 20 km/h. A mathematical model and MATLAB Simscape simulations were developed, followed by experimental validation using a Mechanical Testing and Sensing System (MTS) under laboratory conditions. Lab-scale testing, a maximum output power of 3.72W and an efficiency of 62.7% were recorded at 8 Hz. Field tests were performed at various vehicle speeds. A peak voltage output of 10V was recorded for a single phase of a three-phase DC generator at 15 km/h. The displacement sensor beneath the road stud was used to record the relative time signal between adjacent peaks to calculate vehicle speed. The sensor is sustainable in energy and easily installable without infrastructure changes, enhances transportation efficiency, and is useful for traffic management, road safety, and smart transportation networks.