A sensor for measuring a concentration of at least one respiratory gas component in a breathing gas, which concentration is varying during a breathing cycle having an inspiration phase, an expiration phase and a phase between the inspiration and expiration, said sensor comprising: at least one radiation source (13, 19) for emitting radiation; at least one radiation sensing detector (14, 20) for receiving radiation and for providing a signal indicative of the concentration of the at least one respiratory gas component; an electronics board for receiving and processing the signal from said at least one radiation sensing detector to determine the concentration of the at least one respiratory gas component; and an energy storage device for supplying energy to said at least one radiation source, characterized in that said electronics board is configured to choose from among at least two different modes of energy supply to said at least one radiation source, one of the modes being an operation mode configured to allow sufficient energy supply to said at least one radiation source needed for subsequent concentration determination within at least one phase of the breathing cycle, and another of the modes being a rest mode configured to allow reduced energy supply to said at least one radiation source compared to said operation mode to limit radiation for saving energy of said energy storage device within the breathing cycle, wherein the electronics board is configured to turn on the radiation source by choosing the operation mode when a derivative of a concentration of the at least one respiratory gas component returns back to zero or close to zero after a positive peak, and the electronics board is configured to turn the radiation source into the rest mode when the derivative is less than zero. at least one radiation source (13, 19) for emitting radiation; at least one radiation sensing detector (14, 20) for receiving radiation and for providing a signal indicative of the concentration of the at least one respiratory gas component; an electronics board for receiving and processing the signal from said at least one radiation sensing detector to determine the concentration of the at least one respiratory gas component; and an energy storage device for supplying energy to said at least one radiation source, characterized in that said electronics board is configured to choose from among at least two different modes of energy supply to said at least one radiation source, one of the modes being an operation mode configured to allow sufficient energy supply to said at least one radiation source needed for subsequent concentration determination within at least one phase of the breathing cycle, and another of the modes being a rest mode configured to allow reduced energy supply to said at least one radiation source compared to said operation mode to limit radiation for saving energy of said energy storage device within the breathing cycle, wherein the electronics board is configured to turn on the radiation source by choosing the operation mode when a derivative of a concentration of the at least one respiratory gas component returns back to zero or close to zero after a positive peak, and the electronics board is configured to turn the radiation source into the rest mode when the derivative is less than zero.