Flexible piezoelectric materials can convert mechanical energy into electrical energy to power micro/nano electronic devices. In recent years, research into piezoelectric technologies has revealed that molybdenum disulfide (MoS
2) can improve the piezoelectric properties of composite materials. In this research the fabrication of a PAN/MoS
2 flexible composite nanofiber film piezoelectric sensor via electrospinning is presented. The influence of MoS
2 nanosheet content on the piezoelectric performance of the PAN/MoS
2 composite nanofiber films is systematically investigated, and the morphology and structure of the composite nanofiber films are characterized. The results show that MoS
2 is uniformly distributed in the composite nanofiber films, and the zigzag conformation of the PAN molecular is enhanced by adding MoS
2. As the MoS
2 doping content increases, the performance of the PAN/MoS
2 composite nanofiber film sensor shows a first-increasing-and-then-decreasing trend, and ultimately reaching a maximum value when the MoS
2 weight content is 3.0%. When the MoS
2 doping content increases from 0% to 3.0%, the open-circuit output voltage of the PAN/MoS
2 composite nanofiber film sensor increases from 1.92 V to 4.64 V, and the short-circuit output current increases from 1.03 μA to 2.69 μA. At 3.0% MoS
2 doping, the maximum output power of the PAN/MoS
2 composite nanofiber film sensor reaches 3.46 μW, with an internal resistance of approximately 10 MΩ. The output voltage of the composite nanofiber film sensor increases with the applied external force increasing. At a frequency of 10 Hz, when external forces of 2 N, 3 N, 4 N, 5 N, and 6 N are applied, the sensor output voltages are 2 V, 3.4 V, 5.9 V, 8.7 V, and 10.3 V, respectively. Compared with pure PAN film, the PAN/MoS
2 composite nanofiber film has a piezoelectric constant
d33 increases by 4.86 times. The PAN/MoS
2 composite nanofiber film sensor can efficiently charge commercial capacitors, and the discharging of capacitors can successfully power a green LED. Additionally, it can monitor in real-time, under passive conditions, the bending state of the knee and the forward movement of the bicycle wheel during cycling. After 10000 impact cycles, the PAN/MoS
2 composite nanofiber film sensor shows stable voltage output with no obvious fluctuations, demonstrating excellent stability. All in all, the PAN/MoS
2 flexible composite nanofiber film sensor exhibits outstanding flexibility, low cost, and self-powered capabilities, showing promising potential for applications in wearable/portable electronics, smart devices, and intelligent robotics.