A self-actuated cylinder comprising a cylinder housing comprising electro-magnetic force generating means to generate electro-magnetic forces, and a piston within the cylinder housing, wherein the electro-magnetic forces act directly on the piston to displace the piston within the cylinder housing. The self-actuated cylinder can be used as an oscillation spirometer to determine air flow, an input impedance or Forced Oscillation pulmonary mechanics.