# PCB “Touch” Button

Is it possible to use a PCB pad as a button? I think of using it to switch on a curcuit that is only supposed to be enabled, when the user holds it in its hands.

As inspiration, I used the pads that are being used on soft touch buttons on keyboards or in calculators:

I know that the human body has a quite high resistance, so what would be an appropriate circuit to detect the touch input? Bare hardware only. I don't want to use any microcontroller here.

• You mean a capacitive touch sensor? – PlasmaHH Jan 23 '17 at 10:25
• @PlasmaHH This might be another possibility, but I though of something like amplifying the current that flows when bridging the above pad with your finger, unsing it to operate a mosfet or something – mxcd Jan 23 '17 at 10:38
• Depending on the power requirements of your design, capacitive sensing might be too power hungry. You can get away with the 50Hz (probably). If you touch the gate of a mos, you turn the mos on. Also, you usually break it, so it must be somehow protected, but it is a good starting point. – Vladimir Cravero Jan 23 '17 at 10:40

For reliability reasons I wouldn't go for an open-gate design and rely on the 50Hz noise. It probably might work, but your idea of using interleaved fingers should work quite well.

The resistance of dry skin is somewhere between 1k and 100k, so you could think of an NMOS transistor (find one with ESD protection) and a large pull down of e.g. 1M ohm. Then you can use the finger as a pull-up resistor to turn on the mosfet.

simulate this circuit – Schematic created using CircuitLab

You could also use a bipolar (or darlington) transistor, they are less vulnerable to ESD defects, but cannot supply a large current at the output if needed so you would need to buffer the output.

A capacitive sensor would be an alternative solution, but requires a more complicated circuit.

• I would consider adding a 10k resistor between the cathode of D1 and the junction between R1 and the right-hand side of the sensor to limit the instantaneous current into the gate of M1 from a static discharge and help D1 do its work by generally slowing fast edges down. If you find this circuit particularly noise-prone, a 100pF or so capacitor across R1 may help that - you'll have to build it and try it out! – stefandz Jan 23 '17 at 12:13
• Good point, I'll add it to the circuit diagram – Douwe66 Jan 23 '17 at 12:14

It is possible to use resistive connection pads like you show, but capacitive pads are generally better. Resistive pads leave a direct connection to the circuit open to the outside. They are therefore susceptible to damage from static discharge and noise.

Capacitive pads are a better method, although they require a bit more firmware to sense, at least if you want to do it well. Note that to get even rudimentary noise immunity, resistive pads require firmware too. Just connecting two pads to something sensitive, like the gate of a FET, is a bad idea. You won't be able to cancel common mode and other ambient noise.

Here is the layout of a small board I did recently just to research capacitive buttons:

The cap pads are small disks 150 mils (3.8 mm) in diameter and otherwise surrounded by ground on the top layer. The microcontroller is a PIC 16LF1786. It and all the other parts that aren't for directly interfacing with the user are mounted on the bottom of this two-layer board.

The PIC continually scans the pads. When it detects a change in the pressed/released sense of a pad, it sends a message over the serial port, updates the lights at top right, and emits a beep on a press.

For testing, I can have the PIC regularly send its internal values for the pressedness of each pad. Here is a plot of all five raw sense values, in addition to the overall something-is-pressed digital state as I pressed each pad in succession with my finger:

As you can see, the noise immunity is exceptional. Even the weakest signal was well over 300, while noise was ±2 or so.

The magenta trace labeled "Pressed" shows the OR of the individual button pressed states. Its levels show the press and release thresholds. There is much extra signal that is not used in this case. These particular thresholds were tweaked to be able to tolerate a few layers of paper above the buttons.

Of course there is some clever handling of the button lines and processing, even if I say so myself, but clearly the results are achievable with quite a modest microcontroller.

I am using this in a real product where the same micro is also managing a character display. That's a basic user interface subsystem I plan to re-use in several future products. It interfaces to the main system controller over a serial port. The main controller sends commands for writing to the display, and receives asynchronous messages whenever the state of a button changes.

• What are the units of the Y axis in your plot? Are pads simply connected to the pins, or are there other components involved? – Dmitry Grigoryev Jan 23 '17 at 15:07
• @Dmitry: The Y axis shows the internal "how much the button is being touched" measure. It is derived from raw A/D values, but there are multiple A/D readings envolved, and there is significant processing on those readings. There was no attempt to keep them in particular units, since these values are relative to each other and arbitrarily entered thresholds. Very roughly they are in units of about 800 uV differential between reading. 350 means about 280 mV, but again, it's not really that simple. – Olin Lathrop Jan 23 '17 at 15:34
• So you're driving the pads high and low, and measure some sort of charge/discharge rate using ADC? – Dmitry Grigoryev Jan 23 '17 at 15:42
• @Dmitry: I'm driving the something else high and low, then measuring the step change in the pads. Nothing is time-based other then allowing enough settling time to take readings. – Olin Lathrop Jan 23 '17 at 16:00