Fork me on GitHub

Project Notes

#794 CD4011 Touch Switch

Testing a common CD4011 touch switch circuit with separate on and off pads.

Build

Here’s a quick demo..

clip

Notes

This is a common touch switch circuit based on two NAND gates from a CD4011.

I’ve made touch pads from a small piece of copper-clad circuit board, with pins for plugging into a breadboard.

The two gates are connected in a ring and are bistable. When power is applied, the gates will race to see which is initialised as “on”, the other being “off” (a small 100pF capacitor to ground on one of the touch inputs can be used to force a consistent startup state).

Touching a pad will pull the corresponding input low, flipping the output state.

I my environment, the input pull-up resistors (R1, R2) need to be quite stiff to work. I had success with 10MΩ, but with 1MΩ or lower, the touch switch did not work.

If the fingertips are too dry, the switch may also not work (or require a long press to activate). Slightly dampening one’s fingers can improve operation.

Since the output of a CD4011 is not capable of sinking or sourcing a high current, you can buffer the output of the gate with the third gate in the chip and wire it as an inverter.

Circuit Design

Designed with Fritzing: see TouchSwitch.fzz.

bb

schematic

Testing on a breadboard:

bb_build

Credits and References

Reference Circuit #1

The following circuit is featured in many sources, such as:

Although having the same construction as the circuit I’ve used, in most cases they specify R1=R2=10kΩ. In my environment and operating conditions, this does not work.

circuit1

Reference Circuit #2

As published on:

A similar circuit, but with higher value pull-ups and a transistor-switched output. The example shows driving a relay.

circuit2

About LEAP#794 Digital LogicCMOS/TTLCD4011

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader