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