Stop using clunky buttons for your Arduino projects. Instead, why not use the TTP223 capacitive touch sensor. The sensor detects your finger just like your phone screen. But the best part? It works through plastic, glass, and wood. In this tutorial, I will cover everything you need to know about the TTP223 capacitive touch sensor module.
⏱️ Video Elements -------------------------- 00:00 - Introduction & Demo 01:07 - Module Breakdown & Hardware Specs 02:24 - Operating Voltage 02:56 - Understanding Jumper Pads A & B (Toggle vs Momentary) 04:15 - Microcontroller Integration (Arduino / ESP32) Code + Wiring 04:52 - Troubleshooting Tips (Ghost Touches & Power Noise)
⚡ Quick Tech Specs ------------------------------- • Operating Voltage: 2.0V – 5.5V (3.3V recommended for MCU compatibility) • Idle Current: ~1.5µA (ideal for battery projects) • Logic Output: High / Low configurable via Jumpers A & B
📌 Jumper Settings Quick Reference: -------------------------------------------------------- • A Open, B Open: Active HIGH, Momentary (Default) • A Soldered, B Open: Active LOW, Momentary • A Open, B Soldered: Initially LOW, Toggle / Self-Locking • A Soldered, B Soldered: Initially HIGH, Toggle / Self-Locking
⚡ Thanks --------------- Thanks again for checking my post. I hope it helps you. If you want to support me subscribe to my YouTube Channel: https://www.youtube.com/user/tarantula3
Stop using clunky physical buttons for your Arduino projects.
Instead, why not use the TTP223 Capacitive Touch Sensor.
The sensor detects your finger, just like your phone's screen.
But the best part? It works through plastic, glass, and wood.
Capacitive Touch is a technology that detects touch by sensing changes in electric capacitance
on a surface. Like when your finger, which conducts electricity, touches a screen or button
and alters its electric field.
It is the tech behind most smartphone screens and touch buttons, including the TTP223 module.
This is the bottom of the module, which carries the primary TTP223 IC.
Both module and chip bear the same name, TTP223.
Then we have the three pins, VCC, Output, and Ground.
These two solder joints, labeled A and B, can be used to switch between
four different modes, which I will explain in a moment.
You can adjust the sensitivity of the module either by changing the size of the touchpad
or by changing the thickness of the layer covering it.
Or by adding an external capacitor.
A capacitor placed between the sense pin and ground reduces the sensitivity.
A smaller capacitance value means higher sensitivity.
The adjustable range is typically between 0 to 50 picofarad.
This LED indicator lights up when the touch sensor is activated.
This onboard LED gives a visual indication that the sensor pad has detected your touch.
The front of the module has the circular or rectangular copper area,
often with a fingerprint-like icon, which is the sensing surface you touch to activate the sensor.
For battery-operated builds, power consumption is a key.
At 3 volts, this module consumes a tiny 1.5 microamps while waiting for a touch.
When a finger approaches, it instantly ramps up to fast response mode,
giving you seamless control without chewing through your battery.
The operating voltage is between 2 volts and 5.5 volts.
While the chip can technically run down to 2 volts,
the output signal strength weakens as the supply voltage drops.
If you power the module with 5 volts, the output high will be roughly around 4 volts.
If you are connecting this to a 3.3-volt microcontroller,
the output high stays close to 2.5 volts.
It is safer to power the module with 3.3 volts,
so it doesn't exceed the microcontroller's input limits.
The jumpers on the TTP223 module control two independent behaviors.
Jumper A sets the output logic level, and Jumper B sets the switching behavior.
So, let's connect the module to a breadboard and let's check out the four operational modes.
When both A and B are not soldered, the output becomes high upon touch
and returns to low when released.
This is the factory default state of a brand new module.
So, it behaves like a momentary touch-to-on switch whose initial state is low.
In other words, it acts like a traditional push-button switch.
When only Jumper A is soldered, the output goes low when touched and stays high when released.
So, it behaves like a momentary touch-to-off switch whose initial state is high.
When only Jumper B is soldered, the module acts like a self-locking switch
or toggle switch that starts with an initial low state.
One touch turns it on, the next turns it off, holding the state until you touch it again.
When both A and B are soldered, the module still acts like a self-locking switch or toggle switch.
However, this time it starts with an initial high state.
Same as before, one touch turns it on, the next turn turns it off,
holding the state until you touch it again.
This module can either be wired to a standalone circuit,
as demonstrated in all other earlier examples,
or can be connected to a microcontroller of your choice.
As you can see, touching the pad triggers an interrupt,
which fades the LEDs on and another tap fades them off.
In the code, instead of constantly checking the sensor in a loop, I have used an interrupt.
When you touch the touchpad, it instantly triggers the onTouch function
and hence the system reacts with zero lag.
The attachInterrupt function listens for a signal on GPIO5,
connected to the TTP223 touch module.
Now, let's cover the four most common TTP223 issues.
Capacitive touch sensors are extremely sensitive to power line noises.
If you are powering it from a cheap USB adapter,
place a 100nF ceramic capacitor directly across the sensor's power pins.
If you are mounting the sensor behind a thick acrylic or wood and it won't trigger,
locate the capacitor pad on the board.
Reducing its value to 0pF increases the touch sensitivity.
If the sensor is stuck on ON or OFF,
please check for accidental solder bridges on A and B jumper pads.
Always make sure your microcontroller and sensors share a common ground line
or the signal pin won't register properly.
So, now you can build an invisible switch directly under your 3D prints or furniture
and surprise your friends.
Boom! Magic!
Subscribe and don't miss out any upcoming video using the touch sensor.