A sensor comprising a plurality of sensor units arranged in a one or two dimensional matrix, each sensor unit comprising: • a charge storage element, • a first measurement element for producing at first times a first measurement current comprising desired components and undesired components A and B and at second times a third measurement current consisting of the undesired components A and B; • a second measurement element for producing at said first and second times respectively a second measurement current and a fourth measurement current, each comprising the undesired component A, • a first circuitry part connected between said charge storage element and said first and second measurement elements, said first circuitry part being configured to periodically apply a charging current to said charge storage element for charging said charge storage element over a predefined number of periods, said charging current being the first measurement current minus the second measurement current, said first circuitry part comprising first switching elements, • a second circuitry part connected between said charge storage element and said first and second measurement elements, said second circuitry part being configured to periodically apply a discharging current to the charge storage element for discharging said charge storage element over said predefined number of periods, said discharging current being the third measurement current minus the fourth measurement current, said second circuitry part comprising second switching elements, • said first and second switching elements being switchable between a conducting state and a non-conducting state, • a third circuitry part connected between said charge storage element and an output of said sensor, said third circuitry part comprising a third switching element switchable between a conducting and a non-conducting state, said third switching element being arranged for conducting charge stored on the charge storage element to said output, said third circuitry part being designed for periodically conducting said charge after said predefined number of periods, • control circuitry for applying voltages to said first and second switching elements according to a predetermined periodical timing scheme, such that in each period of said timing scheme said first and second switching elements are switched to the conducting state for a given time and that the undesired components A and B are eliminated from the charge stored on said charge storage element as a result of the charging and discharging currents. • a charge storage element, • a first measurement element for producing at first times a first measurement current comprising desired components and undesired components A and B and at second times a third measurement current consisting of the undesired components A and B; • a second measurement element for producing at said first and second times respectively a second measurement current and a fourth measurement current, each comprising the undesired component A, • a first circuitry part connected between said charge storage element and said first and second measurement elements, said first circuitry part being configured to periodically apply a charging current to said charge storage element for charging said charge storage element over a predefined number of periods, said charging current being the first measurement current minus the second measurement current, said first circuitry part comprising first switching elements, • a second circuitry part connected between said charge storage element and said first and second measurement elements, said second circuitry part being configured to periodically apply a discharging current to the charge storage element for discharging said charge storage element over said predefined number of periods, said discharging current being the third measurement current minus the fourth measurement current, said second circuitry part comprising second switching elements, • said first and second switching elements being switchable between a conducting state and a non-conducting state, • a third circuitry part connected between said charge storage element and an output of said sensor, said third circuitry part comprising a third switching element switchable between a conducting and a non-conducting state, said third switching element being arranged for conducting charge stored on the charge storage element to said output, said third circuitry part being designed for periodically conducting said charge after said predefined number of periods, • control circuitry for applying voltages to said first and second switching elements according to a predetermined periodical timing scheme, such that in each period of said timing scheme said first and second switching elements are switched to the conducting state for a given time and that the undesired components A and B are eliminated from the charge stored on said charge storage element as a result of the charging and discharging currents.