Device for measuring the concentration of gases in exhaled air and measurement procedure used, such device comprising a first air inlet (1), a second air inlet (3) with a nitric oxide filter (4), a pump (5), a nitric oxide sensor (6), a first valve (8) located downstream from the first air inlet (1) and upstream from the sensor (6), a second valve (9) located downstream from the second air inlet (3) and upstream from the sensor (6), a third valve (10) located downstream from the sensor (6) in a first fluid line that conducts air to a first air outlet (12), and a fourth valve (11) located downstream from the sensor (6) in a second fluid line that conducts air to a second air outlet (13), wherein the pump (5) is located in the second fluid line.