A smart card comprising a touch-based user interface and an electronic device in said touch-based user interface, the electronic device comprising a first capacitor, a second capacitor, a third capacitor, and an analog-to-digital converter, wherein the electronic device is configured to receive a supply voltage through a voltage input and to detect a touch event by measuring a change of the capacitance on the first capacitor, and wherein: the first capacitor and the second capacitor are switchably coupled to each other through a first controllable switch; the first capacitor is switchably coupled to an input of the analog-to-digital converter through the first controllable switch; the second capacitor is coupled to the input of the analog-to-digital converter; the third capacitor is coupled to the first capacitor; the third capacitor is switchably coupled to the second capacitor through the first controllable switch; the third capacitor is switchably coupled to the input of the analog-to-digital converter through the first controllable switch; the third capacitor is implemented as a printed circuit board capacitor made from neighboring tracks; the voltage input and the first capacitor are switchably coupled to each other through a second controllable switch and a third controllable switch; the first capacitor is switchably coupled to ground through a fourth controllable switch; wherein the electronic device is configured to: close the first controllable switch, second controllable switch and third controllable switch such that the third capacitor and the second capacitor are charged to the supply voltage while the first capacitor is discharged; open the second controllable switch and third controllable switch such that charging the third capacitor and the second capacitor and discharging the first capacitor are stopped; close the fourth controllable switch such that charge sharing among the first capacitor and the second capacitor occurs; open the first controllable switch such that an input voltage for the analog-to-digital converter is held on the second capacitor, wherein the analog-to-digital converter is configured to convert said input voltage into a digital representation. the first capacitor and the second capacitor are switchably coupled to each other through a first controllable switch; the first capacitor is switchably coupled to an input of the analog-to-digital converter through the first controllable switch; the second capacitor is coupled to the input of the analog-to-digital converter; the third capacitor is coupled to the first capacitor; the third capacitor is switchably coupled to the second capacitor through the first controllable switch; the third capacitor is switchably coupled to the input of the analog-to-digital converter through the first controllable switch; the third capacitor is implemented as a printed circuit board capacitor made from neighboring tracks; the voltage input and the first capacitor are switchably coupled to each other through a second controllable switch and a third controllable switch; the first capacitor is switchably coupled to ground through a fourth controllable switch; wherein the electronic device is configured to: close the first controllable switch, second controllable switch and third controllable switch such that the third capacitor and the second capacitor are charged to the supply voltage while the first capacitor is discharged; open the second controllable switch and third controllable switch such that charging the third capacitor and the second capacitor and discharging the first capacitor are stopped; close the fourth controllable switch such that charge sharing among the first capacitor and the second capacitor occurs; open the first controllable switch such that an input voltage for the analog-to-digital converter is held on the second capacitor, wherein the analog-to-digital converter is configured to convert said input voltage into a digital representation. close the first controllable switch, second controllable switch and third controllable switch such that the third capacitor and the second capacitor are charged to the supply voltage while the first capacitor is discharged; open the second controllable switch and third controllable switch such that charging the third capacitor and the second capacitor and discharging the first capacitor are stopped; close the fourth controllable switch such that charge sharing among the first capacitor and the second capacitor occurs; open the first controllable switch such that an input voltage for the analog-to-digital converter is held on the second capacitor, wherein the analog-to-digital converter is configured to convert said input voltage into a digital representation.