MOTOROBIT — EVERYTHING FOR TECHNOLOGY LOVERS, ALL IN ONE PLACE!
MORE THAN 30,000 PRODUCTS – AN EXTENSIVE PRODUCT RANGE
YOUR PARTNER IN ELECTRONIC COMPONENT SUPPLY
EXPAND YOUR CREATIVITY BEYOND LIMITS WITH MOTOROBIT
{{ t.categories }} ({{ live_data.categories.length }})
{{ t.brands }} ({{ live_data.brands.length }})
{{ t.products }} ({{ live_data.products.length }})
{{ t.see_all }}
Menu
If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!
If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!If you cannot find a specific electronic or automation spare part on our website or in the market, please contact us — quantity does not matter!
TTP223B Touch Sensor Usage
Publish Time: 07.07.2025
Reading Time: 2 Minute
TTP223B Touch Sensor Usage

How to Use the TTP223B Capacitive Touch Sensor with Arduino?

TTP223B is a compact capacitive sensor module that provides touch input instead of physical buttons. It is often preferred in Arduino projects due to its low power consumption, easy connection, and stable operation.

Why Choose TTP223B?

  • Operates at 2.0V–5.5V, making it ideal for battery-powered systems.
  • By using solder pads on the module, you can switch between momentary or toggle modes.
  • Provides stable and self-calibrated capacitive sensing without the need for external components.

TTP223B Touch Sensor

Working Principle

The TTP223B detects changes in capacitance when touched and converts this into a digital signal.

  • In default mode: Outputs HIGH (5V) when touched, and LOW (0V) when not touched.
  • In toggle mode: Each touch inverts the output state (e.g., ON → OFF).

Pinout

PinFunction
VCC2.0–5.5V DC power (typically connected to Arduino 5V)
GNDGround
SIG / IODigital output pin (goes HIGH when touched)

Required Components

Arduino Wiring Diagram

  • VCC → Arduino 5V
  • GND → Arduino GND
  • SIG → Arduino Digital Pin 2
  • LED (optional) → Arduino Digital Pin 4 (via 100Ω resistor)

When the sensor is touched, the LED lights up and the message "Touch detected!" appears in the Serial Monitor.

Wiring Diagram

Example Code:


/*
Interfacing TTP223B Touch Sensor with Arduino
by www.PlaywithCircuit.com
*/

// Define pin numbers
const int touchPin = 2;  // Touch sensor pin
const int ledPin = 4;    // LED pin

void setup() {
  Serial.begin(9600); // Start serial communication
  pinMode(touchPin, INPUT);   // Set touchPin as input
  pinMode(ledPin, OUTPUT);    // Set ledPin as output
}

void loop() {
  int touchState = digitalRead(touchPin); // Read touch sensor state

  if (touchState == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on LED
    Serial.println("Touch detected!");
    while (digitalRead(touchPin) == HIGH); // Wait until released
  } else {
    digitalWrite(ledPin, LOW); // Turn off LED
  }
}

Applications

  • Touch-controlled lamps or buttons
  • Controlling buzzers, relays, or LEDs
  • User interface in IoT projects
  • Alternative to mechanical buttons for durability and long lifespan

Advantages

  • Low-cost and widely available
  • Works without external resistors or capacitors
  • Sensitivity can be adjusted by adding an external capacitor (0–50pF)
  • Integrates easily with other modules like relays, motor drivers, buzzers, etc.

Source: https://playwithcircuit.com/how-to-interface-ttp223b-touch-sensor-with-arduino/

Share
T-Soft | Premium