TTP223B Capacitive Touch Sensor with Arduino
License: Apache License, Version 2.0
Capacitive touch sensing provides a convenient alternative to conventional mechanical switches in embedded and electronic systems. Instead of requiring a physical button to be pressed, a capacitive sensor detects a change in the electrical characteristics of its sensing electrode when a conductive object, such as a human finger, approaches or touches it.
The TTP223B is a compact, single-channel capacitive touch sensor module based on the TTP223-BA6 touch-sensing IC. It provides a digital output that can be connected directly to a microcontroller, making it useful for touch-controlled interfaces, electronic switches, control panels, and Arduino-based prototypes.
This article explains the operating principle of the TTP223B, its main electrical characteristics, the TTP223-BA6 IC configuration, operating modes, module hardware, and how the sensor can be interfaced with an Arduino Uno.
What Is a TTP223B Capacitive Touch Sensor?
The TTP223B is a one-channel capacitive touch sensor module built around the TTP223-BA6 IC. The IC detects changes in capacitance at its sensing input and converts the detected touch condition into a digital output signal.
The module operates from 2.0 V to 5.5 V DC, allowing it to be used with a range of microcontroller supply voltages. The module provides a digital signal output that changes state when a touch is detected. In addition, an onboard LED provides a visual indication of the module's operating condition.
The TTP223B is therefore different from a conventional push button at the electrical interface level. A mechanical switch directly opens or closes an electrical path, whereas the TTP223B uses capacitive sensing circuitry to determine whether a touch event has occurred and then generates a corresponding logic-level output.
Capacitive touch controllers are commonly used for human-machine interfaces because the sensing element can be implemented without a conventional mechanical actuator. DigiKey's capacitive-touch resources similarly describe these devices as interfaces between capacitance-based sensing elements and microcontrollers or other digital systems.
How Capacitive Touch Sensing Works
The operating principle of the TTP223B is based on capacitance.
A sensing electrode forms part of a capacitive system. When no finger is present, the electrode has a particular electrical response. When a human finger approaches or touches the electrode, the effective capacitance changes because the human body is electrically conductive.
The TTP223-BA6 monitors this change through its internal sensing circuitry. The sensor input is connected to the sensing electrode, and the IC evaluates changes in the sensing signal to determine whether a valid touch has occurred.
This approach is fundamentally different from resistive touch sensing. A resistive system responds to a change in resistance produced by physical contact, whereas a capacitive system detects changes associated with capacitance. Capacitive sensing is widely used for touch and proximity interfaces because it can provide a contactless or low-mechanical-wear user interface.
In the TTP223B, the sensing, detection, control logic, and output processing are handled by the TTP223-BA6 IC. The microcontroller therefore does not need to calculate capacitance itself. It only needs to read the resulting digital output.
TTP223B Operating Voltage and Power Characteristics
The TTP223B module operates from 2.0 V to 5.5 V DC. This allows it to be used with common development platforms such as Arduino boards while also supporting lower-voltage embedded systems.
The TTP223B is designed for low-power operation. The original module specifications indicate a typical current of approximately 1.5 µA at VDD = 3 V in low-power mode, with a maximum specified value of approximately 3.0 µA under that condition.
For battery-powered systems, low operating current can be particularly useful because the touch interface does not need to continuously consume significant power simply to provide a user input.
TTP223-BA6 IC Pin Functions
The TTP223-BA6 provides the sensing and control functions used by the module.
The Q pin is the digital output of the IC. This signal represents the result of the touch detection process and is routed to the signal output of the TTP223B module.
The VSS pin is the IC ground connection and should be connected to the circuit ground.
The I pin is the sensor input. It is connected to the capacitive sensing electrode and is responsible for detecting changes in the capacitance of the sensing system.
The AHLB pin controls the output polarity. When AHLB is LOW, the output is configured as active HIGH. When AHLB is pulled HIGH, the output becomes active LOW.
The VDD pin provides the supply voltage to the IC and supports the 2.0 V to 5.5 V operating range.
The TOG pin controls the output mode. With TOG LOW, the IC operates in direct mode. With TOG HIGH, it operates in toggle mode.
Understanding these two configuration inputs, AHLB and TOG, is important when integrating the TTP223B into a larger embedded design because they determine how the sensor output behaves.
Direct Mode
In direct mode, the output follows the touch condition.
For the active-HIGH configuration, the output is normally LOW. When the sensor detects a valid touch, the output changes to HIGH. When the touch is removed, the output returns to its inactive state.
This behavior is useful when the microcontroller needs to know whether the sensing surface is currently being touched.
For example, an Arduino can read the TTP223B signal pin as a digital input and use the resulting logic state to control an LED, relay, motor driver, buzzer, or another subsystem.
Toggle Mode
The TTP223B can also operate in toggle mode.
In this configuration, each detected touch changes the output state. If the output starts LOW, the first touch changes it to HIGH. The next valid touch changes it back to LOW.
This makes the TTP223B behave more like an electronic ON/OFF switch.
Toggle operation can be useful for applications where the user needs to turn a function on with one touch and turn it off with another, without having to continuously hold a finger on the sensing surface.
The TTP223-BA6 supports four combinations of TOG and AHLB configurations, allowing the designer to select direct or toggle operation and active-HIGH or active-LOW output behavior.
TTP223B Module Pinout
The commonly used TTP223B module exposes three primary connections: VDD, Signal, and GND.
VDD is the positive supply connection. It can be connected to a suitable supply within the module's 2.0 V to 5.5 V operating range.
Signal is the digital output. In the default active-HIGH configuration, this output becomes HIGH when a touch is detected.
GND is the circuit ground and should be connected to the ground of the microcontroller or power supply.
The three-wire interface makes the TTP223B particularly simple to integrate into a microcontroller-based prototype because no communication bus or external software library is required for basic touch detection.
Hardware Configuration of the TTP223B
The TTP223B module contains the TTP223-BA6 IC together with the supporting circuitry required for capacitive touch detection.
The conductive sensing area on the PCB functions as the touch electrode. When a finger approaches or touches this area, the capacitance of the sensing system changes. The TTP223-BA6 detects the change and updates its digital output.
The module also includes a power indicator LED. When power is applied to the module, the power LED turns on.
Because the sensing electrode is part of the capacitive system, the physical construction around the sensor can influence its behavior. The sensor's sensitivity can be adjusted using an external capacitor, with the original TTP223B documentation specifying an adjustable range of 0 to 50 pF.
This type of sensitivity adjustment can be useful when adapting the sensor to different mechanical or enclosure configurations.
Internal Configuration of the TTP223B V1.0 Module
The TTP223B V1.0 module provides an example of how the TTP223-BA6 configuration pins can be set using passive components.
In this version of the module, the TOG pin and AHLB pin are pulled toward ground through a 1 kΩ resistor. This configures the device for direct operation with an active-HIGH output.
The IC's signal output is connected to the module's signal pin. The ground connection is routed to the IC's VSS pin, while the supply is connected to VDD.
The sensing input is connected to the electrode, with the associated capacitor connected to ground. The configuration components around the TOG and AHLB pins determine the output behavior of the module.
The module also includes an indicator LED connected to the supply through a 1 kΩ resistor.
This internal arrangement illustrates an important point when working with sensor modules: the external module may already contain configuration resistors and other components that determine the default operating mode of the underlying IC.
Interfacing the TTP223B with Arduino Uno
The TTP223B can be connected to an Arduino Uno using a simple digital-input configuration.
The module's VDD pin can be connected to the Arduino's 5 V supply, and GND is connected to Arduino GND. The signal output is connected to an Arduino digital input, such as digital pin 2.
For an output demonstration, an external LED can be connected to Arduino digital pin 4 through a 100 Ω resistor.
The resulting signal path is straightforward:
Finger → Capacitive sensing electrode → TTP223-BA6 → Signal output → Arduino digital input → LED or other output
The Arduino does not perform the touch-sensing calculation. The TTP223B handles the capacitive detection and provides a logic-level signal that the Arduino can read.
Arduino Interface Concept
From the Arduino's perspective, the TTP223B behaves like a digital input device.
The microcontroller monitors the signal pin. When the TTP223B is configured for active-HIGH operation and a touch is detected, the Arduino reads a HIGH logic state.
The firmware can then use this event to perform an action. For example, it can switch an LED, activate an actuator, send a message through a serial interface, or initiate another process.
This approach is useful because it separates the sensing function from the application logic. The TTP223B handles the capacitive sensing, while the Arduino firmware determines what should happen after a touch event.
Touch Detection and Embedded-System Design
When using a capacitive sensor in an embedded design, the sensing electrode should be considered part of the electrical system rather than simply a physical button.
The electrode, surrounding PCB area, enclosure material, wiring, and nearby conductive objects can affect the capacitance seen by the sensing circuit.
For this reason, the mechanical implementation can be important when moving from a breadboard prototype to a finished product.
Capacitive-touch systems are commonly used for human interfaces because they can provide a low-profile interface without relying on mechanical switch contacts. However, designers still need to consider sensitivity, environmental conditions, electrode construction, and calibration when implementing a touch interface in a production system.
Applications of the TTP223B
The TTP223B can be used wherever a simple touch-operated digital input is required.
Typical applications include touch-controlled lighting, electronic switches, user-interface controls, home-automation prototypes, touch-sensitive control panels, Arduino projects, interactive electronics, and relay-control applications.
It can also be used as an alternative to a conventional push button in applications where a mechanical actuator is undesirable.
For more complex touch interfaces, designers can use multi-channel capacitive touch controllers. The TTP223B is more suitable when a single digital touch input is sufficient.
Advantages of Using a Dedicated Touch IC
One advantage of using a dedicated touch-sensing IC such as the TTP223-BA6 is that the microcontroller does not have to implement the complete capacitive sensing mechanism.
The sensor IC performs the touch detection and generates a digital result. This reduces the amount of sensing-related processing that needs to be handled by the application microcontroller.
For a simple embedded interface, this results in a straightforward hardware architecture: the touch IC provides the input signal and the microcontroller handles the application response.
This approach can also make prototyping easier because the TTP223B module already integrates the sensing electrode and supporting circuitry.
Practical Considerations
The TTP223B is simple to interface, but the sensing environment should still be considered during hardware development.
The sensing electrode should have a suitable physical arrangement, and nearby conductive objects can influence capacitive behavior. Enclosures and overlays can also change the effective sensing characteristics.
If the sensor is used in a custom PCB rather than as a ready-made module, the electrode geometry, PCB layout, grounding, external capacitance, and surrounding components should be evaluated during the design process.
For applications requiring multiple touch keys, gesture detection, proximity sensing, or a communication interface such as I²C, a more advanced capacitive-touch controller may be more appropriate.
Conclusion
The TTP223B provides a simple way to add capacitive touch input to an Arduino or other microcontroller-based system.
Its TTP223-BA6 IC detects changes in capacitance at the sensing electrode and converts those changes into a digital output. The device supports direct and toggle operating modes, as well as active-HIGH and active-LOW output configurations.
For a basic Arduino interface, only power, ground, and the digital Signal output are required. This makes the TTP223B useful for prototyping touch-controlled switches, indicators, automation interfaces, and other embedded applications.

