NOVELTY - The method involves generating a set of pulses of light by passing a set of pulses of current through an LED (8). The current is measured through the LED at each pulse during a set of times. A compensated signal indicative of concentration of analyte gas is generated in a gas sample receiving chamber (4) that takes into an account of a photosensor output signal and the set of measurements of the current through the LED, where the LED and a photodiode (12) have an output signal sensitive to an amount of light received by a photosensor.    USE - Method for operating an optical absorption gas sensor for detecting an analyte gas. Uses include but are not limited to gaseous carbon dioxide, carbon monoxide, methane and water vapor.    ADVANTAGE - The method enables measuring shape of a light pulse during taking measurements into account when determining a compensated signal, thus avoiding a requirement for complex electronics to precisely control the shape of each pulse, and hence reducing cost and power consumption associated with complex pulse shaping circuits. The method enables adjusting LED current and offset dynamically, thus reducing analog to digital converter (ADC) noise effects. The method enables carrying out an entire measurement in less than 10 milli seconds, including taking temperature measurement, measuring LED and photodiode current during fifty light pulses and processing resulting data, where the measurements are carried out quickly. The method enables repeating and averaging measurement procedure to provide a rapid result, where each repetition increases a total power output. The method enables a circuit that is energy-efficient for driving LEDs employing a resistor in series with the LED or an active current source. The LEDs are provided and connected in series or parallel, and the current through the LEDs is measured, thus increasing a range of light output over which the current is a roughly linear function of light output or sufficiently sensitive to light output to enable light output to be estimated with reasonable accuracy. The method enables a resistor that is placed in series with an inductor and a potential difference across that series resistor to measure the current through the inductor, thus enabling a micro controller to regulate the pulses that are generated to ensure that the current in the inductor does not exceed a threshold.    DETAILED DESCRIPTION - The LED is an infra-red LED. The photosensor output signal is current through the photodiode. An INDEPENDENT CLAIM is also included for an optical absorption gas sensor comprising a gas sample receiving chamber.    DESCRIPTION OF DRAWING(S) - The drawing shows a schematic view of an optical absorption gas sensor.    Optical absorption gas sensor (1)    Gas sample receiving chamber (4)    LED (8)    Pulse measurement circuit (10)    Photodiode (12)