Disclosed is a method of calibrating an apparatus comprising at least one sensor for detecting one or more analytes of interest in a sample, the method comprising measuring a first set of responses of the at least one sensor to at least one first calibration solution having a known composition of the one or more analytes of interest measuring a second response of the at least one sensor to a second calibration solution having an approximately known composition of the one or more analytes of interest determining the composition of the second calibration solution from the difference between the first set of responses and the second response and periodically calibrating the at least one sensor with the second calibration solution using said determined composition. An apparatus and computer program product for executing this method are also disclosed.