November 11, 2007 Simple Touch Sensor

There are various touch sensors in different method, such as resistive (conductive film), optical (infrared), acoustic (SAW), capacitive and etc. This project is an experiment of capacitive touch sensor. This kind of touch sensor is well known as pointing device used in portable PCs.

Principle of capacitive touch sensor The capacitive touch sensor detects changes of capacitance at the electrode occured by closing a conductive object such as a finger. There are several sensing method for the capatitance. For this project, integration method that used in capacitance meter is applied. The changes of capacitance Cx is pretty small, around 1pF to 10pF, but it will able to be detected with ease because 20fF count resolution is acheved at the capacitance meter. Also the objects to be detected must be grounded to create the Cx circuit, according to the principle. However it works well even if the human body is isolated from the ground. It can be thought as the following reason. The conductive object with a degree of surface area has a self-capacitance. In the concrete, C = 4πε 0 r, where at ball shape, ε 0 is vacuum permittivity, r is radius. The human body has approx. 100pF in self-capacitance according to the human model for ESD test. This is large enough compared to Cx. Therefore the human body can be thought as a grounded conductor even if not grounded. Ofcourse a ground wire or a self-capacitance equivalent to the human body is required to the equipment, too. However it is coupled with earth or human body via various stray-capacitance and creates the Cx circuit.

Hardware The detector electrode (touch area) is a 10mm square copper plate put on the PCB and covered with an insulation overlay (Kapton tape). An ATtiny2313 with 1M ohms pull-up resister is used for the detector circuit. The integration time at normal state is determined by value of pull-up register and stray capacitance on the port and electrode. When touch the electrode with a finger, the integration time increases and can be detected the touch. The actual integration time becomes several μs to several ten μs.

Software First, calibrate each point (get reference time due to Cs), and then start scanning in constant period. When the integration time increased and exceeded a threshold, it is judged `detected'. A hysteresis is required to the threshold, or output will not be stable at half touch. The measureing time for each point is equal to the integration time so that it can be done very fast. The capacitance meter is measuring the integration time in resolution of one clock (100ns) with analog comparator and input capture function. However this function is not that available on all I/O pins. To implement a touch sensor on any I/O pin, the integration time is measured by software polling and the resolution becomes 3 clock (375ns). The number of time count was around 80 at normal state and it was sufficient for touch swith.