A method of operating a gas sensor for determining a concentration of a predetermined gas in a measurement volume, the gas sensor comprising - a light source and - a detector arranged to receive light that has passed through the measurement volume, the method comprising the steps of: during a first measurement period, using the detector to make a first measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said first measurement is carried out with the light source at a first intensity; comparing said first measurement to a predetermined threshold value (506, 606, 706); if said threshold (506, 606, 706) is crossed, during a second measurement period using the detector to make a second measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said second measurement is carried out with the light source at a second intensity which is higher than the first intensity and calculating the concentration (502, 602, 702) of said gas in said measurement volume using the first and the second measurement; characterised by the gas sensor comprises a temperature sensor; and the method comprises at least one of the steps of increasing the source intensity by increasing an emitting surface area of the light source between said first and second measurement periods wherein the surface area is controlled so as to obtain the same working temperature and thus spectrum or increasing the source intensity by increasing the temperature of the light source and filtering the emitted light so that the spectrum received at the detector is comparable or calibrating the detector differently for the two different temperatures. the gas sensor comprising - a light source and - a detector arranged to receive light that has passed through the measurement volume, - a light source and - a detector arranged to receive light that has passed through the measurement volume, the method comprising the steps of: during a first measurement period, using the detector to make a first measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said first measurement is carried out with the light source at a first intensity; comparing said first measurement to a predetermined threshold value (506, 606, 706); if said threshold (506, 606, 706) is crossed, during a second measurement period using the detector to make a second measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said second measurement is carried out with the light source at a second intensity which is higher than the first intensity and calculating the concentration (502, 602, 702) of said gas in said measurement volume using the first and the second measurement; characterised by the gas sensor comprises a temperature sensor; and the method comprises at least one of the steps of increasing the source intensity by increasing an emitting surface area of the light source between said first and second measurement periods wherein the surface area is controlled so as to obtain the same working temperature and thus spectrum or increasing the source intensity by increasing the temperature of the light source and filtering the emitted light so that the spectrum received at the detector is comparable or calibrating the detector differently for the two different temperatures. during a first measurement period, using the detector to make a first measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said first measurement is carried out with the light source at a first intensity; comparing said first measurement to a predetermined threshold value (506, 606, 706); if said threshold (506, 606, 706) is crossed, during a second measurement period using the detector to make a second measurement of an amount of light received in at least one wavelength band which is absorbed by the gas; wherein said second measurement is carried out with the light source at a second intensity which is higher than the first intensity and calculating the concentration (502, 602, 702) of said gas in said measurement volume using the first and the second measurement; characterised by the gas sensor comprises a temperature sensor; and the method comprises at least one of the steps of increasing the source intensity by increasing an emitting surface area of the light source between said first and second measurement periods wherein the surface area is controlled so as to obtain the same working temperature and thus spectrum or increasing the source intensity by increasing the temperature of the light source and filtering the emitted light so that the spectrum received at the detector is comparable or calibrating the detector differently for the two different temperatures.