TTP224 4-Channel Touch Sensor to Turn AC/DC Loads with Relay
The TTP224 capacitive touch module is a versatile component that allows users to control AC and DC loads (like light, fan, motor) through touch inputs. In this tutorial, we will demonstrate how to connect the TTP224 to an Arduino to operate a relay, which can switch your lights or other devices on and off with just a touch. By the end of this guide, you will have a fully functional touch-sensitive control system for your electrical devices. For a visual walkthrough, be sure to check out the video (in video at 00:00).
Hardware Explained
The main components used in this project include the TTP224 capacitive touch module, an Arduino board, and a relay module. The TTP224 module detects touch through capacitive sensing, meaning it can register a touch by measuring changes in capacitance when a finger is placed near its pads. This module has four outputs that correspond to four different touch inputs, allowing you to control multiple devices. The relay module acts as a switch that can control high voltage AC loads safely. The relay used in this tutorial is LOW-Level triggered meaning when signal at the input of relay module is LOW,the relay turns ON and when signal is HIGH, the relay turns OFF. When the relay is activated, it connects the common terminal to the normally open terminal, allowing current to flow to the connected device. The relay is controlled by the Arduino, which reads the outputs from the TTP224 and activates the relay accordingly.Datasheet Details
| Manufacturer | Vishay |
|---|---|
| Part number | TTP224 |
| Logic/IO voltage | 2.2 – 5.5 V |
| Output current (per channel) | 10 mA (max) |
| Input logic thresholds | 0.3 V (low), 0.7 V (high) |
| Package | 16-pin DIP |
| Notes / variants | Four touch channels |
- Ensure the module is powered within 2.2 – 5.5 V for proper operation.
- Monitor the output current to avoid exceeding 10 mA per channel.
- Use decoupling capacitors near the module to filter power supply noise.
- Keep wiring short to reduce interference and improve signal quality.
- Use pull-down resistors on the input pins if not using Arduino for control.
Wiring Instructions

Code Examples & Walkthrough
The Arduino code begins by setting up the output pins for the relay and the input pins for the touch sensors. The code initializes the serial communication for debugging as well.void setup() {
Serial.begin(9600);
pinMode(10, OUTPUT); // LED for button 1
pinMode(11, OUTPUT); // LED for button 2
pinMode(12, OUTPUT); // LED for button 3
pinMode(13, OUTPUT); // LED for button 4
pinMode(2, INPUT); // Button 1 input pin 2
pinMode(3, INPUT); // Button 2 input pin 3
pinMode(4, INPUT); // Button 3 input pin 4
pinMode(5, INPUT); // Button 4 input pin 5
}
This setup function configures the pins for the touch sensors and relay outputs. It initializes the serial monitor to track button presses.
The loop function continually checks the state of each touch sensor. When a button is pressed, it turns on the corresponding relay output and prints a message to the serial monitor.
void loop() {
if(digitalRead(2)){
Serial.println("Button 1 Touched ");
digitalWrite(10, LOW); // Turn the LED ON
} else {
digitalWrite(10, HIGH); // Turn OFF the LED
}
// Similar checks for buttons 2, 3, and 4...
}
This loop reads the state of each button and activates the corresponding relay pin. If button 1 is pressed, the message "Button 1 Touched" is printed, and the relay connected to pin 10 is activated.
Finally, to modify how long the relay stays activated, you can easily change the delay value in the code. This allows for more flexibility in how you control your devices.
Demonstration / What to Expect
When powered on, the system will allow you to control the connected load by touching the respective pads on the TTP224. For instance, touching pad one will turn on the relay connected to pin 10, which can power your light 💡. If you release the touch, the light 💡 will turn off (in video at 03:00). Be cautious about the wiring; ensure the relay is connected correctly to prevent any short circuits or damage to your devices. If the relay does not activate as expected, check all connections and verify that the Arduino code matches the intended pin configuration.Video Timestamps
- 00:00 - Introduction
- 01:30 - Hardware Setup
- 03:00 - Code Overview
- 04:30 - Demonstration

20-TTP224 4-Channel Capacitive Touch Arduino with Relay Code
Sprache: C++
Kopiert!
Ressourcen & Referenzen
Noch keine Ressourcen vorhanden.
Dateien📁
Datenblatt (pdf)
-
TTP224 datasheet by Taiwan Semiconductor (TONTEK)
application/pdf0.29 MB