A sensor for measuring a concentration of a respiratory gas component is disclosed herein. The sensor includes at least one radiation source (13, 19) for emitting radiation and at least one radiation sensing detector (14, 20) for receiving radiation and for providing a signal indicative of the concentration of the gas component. The sensor also includes an electronics board (26) for receiving and processing the signal to determine the concentration, and an energy storage device (22) for supplying energy to the radiation source. The electronics board can choose from among at least two different modes, one being an operation mode allowing sufficient energy supply to the radiation source, and another being a rest mode allowing reduced energy supply compared to the operation mode to limit radiation for saving energy within the breathing cycle. Also a gas analyzer and method for measuring a concentration of a respiratory gas component is provided.