How to Build a Touch Sensor Circuit with a NAND Gate Chip

Touch sensor

We've already shown how to build a touch sensor with a transistor in a previous project. Now, in this one, we will show how to build a touch sensor circuit using a 4011 NAND gate chip.

A touch sensor circuit is a circuit which is activated when a user touches it.

Touch sensors are implemented into many electronic products, the most obvious example being a touch lamp, where the lamp turns on when a person touches the base of it.

In this circuit, we won't do anything too fancy but we will build make a touch sensor with a NAND gate chip and leave out a jumper wire, which when touched will turn on our LED.

Components Needed

  • 4011 Quad NAND Gate Chip
  • 10MΩ Resistor
  • LED
  • 330Ω Resistor
  • Jumper wires

The 4011 quad NAND gate chip can be obtained very cheaply from a number of online retailers for just a few cents. One place it can be obtained from is Tayda Electronics at the following link: Tayda Electronics- 4011 Quad 2-Input NAND Gate IC. However, it is a very popular chip and many electronics parts suppliers have them.

The pinout of the 4011 is shown below, so that you can see how to connect it in the circuit.

4011 NAND gate pinout

Each NAND gate has input pins and 1 output pin.

The following chart shows NAND gate logic, which shows what output a NAND gate chip will produce for a set of given inputs.

NAND Gate Logic
Inputs Output
0 0 1
0 1 1
1 0 1
1 1 0

This means that if one of the inputs are a 0, the NAND gate will output a logic HIGH at its output, which means the output will be drawn up to VCC and the load will be powered. If both inputs feeding into the NAND gate are a 1, only then will the NAND gate output a logic LOW at its output, which means the output will be drawn down to GND, and the load will not be powered.

In our circuit, we will use both of these cases.

The other components we need are the LED and the 330Ω resistor in series to limit current to the LED so that it doesn't burn out.

NAND Gate Circuit Using a 4011

The schematic diagram of the NAND gate circuit using a 4011 is shown below.

Touch sensor circuit with NAND gate chip

Below is the breadboard schematic version of the above circuit so that you can see the exact wiring of the circuit to the 4011 chip.

Touch sensor circuit with NAND gate chip breadboard schematic

First and foremost, we must give power to the 4011 NAND gate chip. We will feed it 5V of power, so we give +5V to pin 14 and we connect pin 7 to GND. This establishes power to the chip.

How this circuit works is very basic.

Both inputs of the NAND gate are tied together, so they will always share the same logic value. As you can see both inputs are connected to VCC, which is 5V, through a 10MΩ resistor which serves as a pull-up resistor, so the inputs into the NAND gate are at a logic level of HIGH (or 1). According to NAND gate logic, 2 HIGHs at the input produce an output of LOW (or 0). So with this setup, the output will be LOW and will not turn on the load, which in this circuit is an LED.

However, when we touch the touch wire, we are essentially acting as a resistor, creating a voltage divider circuit. Our body resistance can range anywhere from 100KΩ when dry to anywhere to about 1KΩ when wet. Either way, our body's resistance is much lower than the 10MΩ resistor. So it only a small amount of the 5V falls across our body. Doing the math, the voltage that falls across our body would be V= (5V)(100KΩ)/(100KΩ +10MΩ)≈ 0.05V, which is essentially 0 volts. The NAND gate reads this as a logic 0. (0.05V is way under half of the power supply voltage, which is 5V). So the logic level now at the inputs of the NAND gate changes to LOW (or 0). According to NAND gate logic, 2 LOWs at the input produce a HIGH logic level at the output, so the LED now powers on.

This is a very basic circuit exploiting the principles of NAND gate logic to build a touch sensor.

To see how this circuit works in real life, see the video below.

Related Resources

How to Build a Touch Sensor Circuit with a Voltage Comparator Chip

HTML Comment Box is loading comments...