This invention relates to a measuring head which comprises an intake, an outlet, a mouthpiece and an electrically controlled proportional valve. The intake may be connected to a pressurized gas reservoir. The outlet releases exhaled gas and excess gas into the ambient. A mouthpiece provides gas to a subject and accepts exhaled gas from the subject. The electrically controlled, proportional valve is pneumatically connected between said intake and said mouthpiece for controlling the gas flow from said intake to said mouthpiece and said outlet. The invention further relates to a method for controlling a gas flow from the intake to the outlet.