TTP223B Touch Sensor With Arduino
by Rachana Jain in Circuits > Arduino
244 Views, 1 Favorites, 0 Comments
TTP223B Touch Sensor With Arduino

Capacitive touch sensors have gained popularity in modern electronics due to their compact size, low power consumption, and ability to replace mechanical buttons. One such commonly used module is the TTP223B Capacitive Touch Sensor, which offers a simple way to integrate touch-based input into Arduino projects. In this article, we will walk through how to interface the TTP223B touch sensor with an Arduino Uno. We’ll cover everything from its working principle and pinout to wiring and Arduino code.
Supplies
Arduino Uno
TTP223B Touch Sensor Module
1 × Red LED
1 × 100Ω resistor
Breadboard and jumper wires
What Is the TTP223B Capacitive Touch Sensor?
The TTP223B is a 1-channel capacitive touch sensor module built around the TTP223-BA6 touch-sensing IC. It is designed to detect human touch through capacitive sensing, offering a digital output that changes state when a touch is detected.
This module is commonly used in place of traditional buttons in various touch-sensitive applications such as smart lamps, DIY electronics, and embedded systems.
Key Features of TTP223B
- Operates on 2.0V to 5.5V DC
- Low power consumption (typically 1.5µA at 3V)
- Stable touch detection for human body input
- Can operate in Direct or Toggle mode
- Output type can be set to Active HIGH or Active LOW
- Auto calibration functionality
- Can replace traditional mechanical switches
- Adjustable sensitivity using an external capacitor (0~50pF)
- Mounting holes for easy installation
Working Principle of TTP223B
The TTP223B works using the principle of capacitive sensing. Every object has a certain capacitance, and the human body is no exception. When a conductive object like a finger comes close to the sensor pad, it alters the capacitance.
Here's a step-by-step breakdown of how it works:
- Capacitive electrodes on the module detect changes when a finger is near or in contact with the sensor.
- This change in capacitance is detected by the internal oscillator circuit.
- The oscillator signals are processed by the IC’s control logic circuit.
- When a valid touch is detected, the output driver toggles or sets the digital output pin (Q pin) accordingly.
All of this is handled by the TTP223-BA6 IC present on the module.
TTP223 IC Pinout

VDD: Power supply pin (2.0V to 5.5V DC)
VSS (GND): Ground pin
I (Sensor Input): Touch sensing input connected internally to the touch pad
Q (Signal Output): Digital output pin: HIGH when touched, LOW when untouched (in default mode)
TOG: Toggles between direct or toggle output mode
AHLB: Sets output type as Active HIGH or LOW
TTP223B Touch Sensor Module Pinout

VCC: Power supply input (connect to 2V–5.5V, usually 5V from Arduino)
GND: Ground connection
SIG: Digital output (connects to Arduino digital pin)
Interfacing TTP223B With Arduino

In the circuit diagram, a TTP223B capacitive touch sensor is interfaced with an Arduino UNO board.
The sensor is powered by the 5V and GND pins of the Arduino, supplying the necessary operating voltage. The Signal pin of the TTP223B is connected to digital pin 2 of the Arduino, allowing it to detect touch events.
Additionally, a red LED is connected to digital pin 4 of the Arduino through a 100-ohm resistor. When the sensor detects a touch, the Arduino receives a HIGH signal on pin 2, turns ON the LED connected to pin 4, and prints the message "Touch Detected" on the Serial Monitor of the Arduino IDE.
Code
Upload the following code to your Arduino:
Output
)
The TTP223B capacitive touch sensor is a simple yet powerful module for adding touch functionality to your Arduino projects. With minimal wiring and straightforward programming, it is ideal for hobbyists and prototyping interactive projects like touch-controlled lamps, switches, or appliances.
If you want to learn more details checkout: Interfacing TTP223B Touch Sensor with Arduino