A semiconductor device for measuring IR radiation originating from outside the semiconductor device, comprising: - a semiconductor substrate with a cap hermetically sealed to said substrate to enclose at least one cavity, - at least one sensor pixel arranged in the cavity, comprising a first absorber arranged for receiving said IR radiation, and adapted for generating a sensor output signal indicative of the incoming IR radiation, - at least one reference pixel arranged in the cavity, comprising a second absorber, and a heater for increasing temperature of the second absorber by applying a power to that heater, wherein the reference pixel is shielded from said IR radiation, and adapted for generating a reference output signal indicative of the applied power to the heater, characterized in that the semiconductor device comprises a controller adapted for: - measuring a responsivity of the semiconductor device by: applying a power to the heater of the reference pixel, while not heating the sensor pixel, measuring a first output signal of the unheated sensor pixel or of an unheated additional reference pixel and a first reference output signal of the heated reference pixel, obtaining the responsivity by making the difference between the first output signal and the first reference output signal and by dividing it by the applied power to the heater, - applying a period of cooling down of the reference pixel until the temperature of the reference pixel is substantially the same as the temperature of the sensor pixel, - generating the output signal indicative of the IR radiation, by subtracting a predefined offset value of the device from a difference between a sensor output signal of the sensor pixel and a reference output signal of the reference pixel measured when the temperature of the sensor pixel is substantially equal to the temperature of the reference pixel, and by dividing the result of the subtraction by a sensitivity wherein the sensitivity corresponds with the latest measured responsivity or a combination of the measured responsivities multiplied with a predefined coupling efficiency. - a semiconductor substrate with a cap hermetically sealed to said substrate to enclose at least one cavity, - at least one sensor pixel arranged in the cavity, comprising a first absorber arranged for receiving said IR radiation, and adapted for generating a sensor output signal indicative of the incoming IR radiation, - at least one reference pixel arranged in the cavity, comprising a second absorber, and a heater for increasing temperature of the second absorber by applying a power to that heater, wherein the reference pixel is shielded from said IR radiation, and adapted for generating a reference output signal indicative of the applied power to the heater, - measuring a responsivity of the semiconductor device by: applying a power to the heater of the reference pixel, while not heating the sensor pixel, measuring a first output signal of the unheated sensor pixel or of an unheated additional reference pixel and a first reference output signal of the heated reference pixel, obtaining the responsivity by making the difference between the first output signal and the first reference output signal and by dividing it by the applied power to the heater, applying a power to the heater of the reference pixel, while not heating the sensor pixel, measuring a first output signal of the unheated sensor pixel or of an unheated additional reference pixel and a first reference output signal of the heated reference pixel, obtaining the responsivity by making the difference between the first output signal and the first reference output signal and by dividing it by the applied power to the heater, - applying a period of cooling down of the reference pixel until the temperature of the reference pixel is substantially the same as the temperature of the sensor pixel, - generating the output signal indicative of the IR radiation, by subtracting a predefined offset value of the device from a difference between a sensor output signal of the sensor pixel and a reference output signal of the reference pixel measured when the temperature of the sensor pixel is substantially equal to the temperature of the reference pixel, and by dividing the result of the subtraction by a sensitivity wherein the sensitivity corresponds with the latest measured responsivity or a combination of the measured responsivities multiplied with a predefined coupling efficiency.