A sensor for measuring a concentration of a respiratory gas component is disclosed herein. The sensor comprises at least one radiation source configured to emit radiation and at least one radiation sensing detector configured to receive radiation and provide a signal indicative of the concentration of the gas component. The sensor further comprises an electronics board configured to receive and process the signal to determine the concentration, and an energy storage device configured to supply energy to the radiation source. The electronics board is configured to 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. A gas analyzer and method for measuring a concentration of a respiratory gas component are also provided.