It is presented a method for obtaining data for an Electrocardiogram, ECG, using a portable sensor device comprising two electrodes. The method comprising the steps of: receiving a trigger to obtain measurements for the ECG; setting at least one switch in a conducting state to close a connection between the two electrodes; setting the at least one switch in a blocking state to conductively separate the two electrodes; and capturing measurements for the ECG using the at least two electrodes.