A method includes, in a living organ (28) in which an ambient pressure varies as a function of time, sensing the ambient pressure using a pressure sensor (36, 90, 174), which has a capacitance that varies in response to the ambient pressure, so as to produce a time-varying waveform. A calibration voltage, which modifies the capacitance and thus the time-varying waveform, is applied to the pressure sensor. The time-varying waveform is processed so as to isolate and measure a contribution of the calibration voltage to the waveform. A dependence of the capacitance on the ambient pressure is calibrated using the measured contribution of the calibration voltage.