Modelling a mechanical spring for a bike
Activate the Add Curve: Curve Extra Objects addon in the user preferences if you haven't yet.

Then just add a new 3D object with Shift + A Add > Curve > Curve Spirals > Logarithmic or Archemedian in you prefer.

Adjust the desired height and number of turns as required.

Adjust curve bevel factor from the Properties Window > Object Data (Curve) as desired and set the Fill option to Full.



You can then manually add the "flat" end loops manually by joining in a bezier curve circle object afterwards in Edit Mode.