TTP223B Capacitive Touch Sensor Interfacing
with Arduino, Node MCU, ESP32
How Capacitive Touch Sensors Work
It’s called capacitive because the technology is based on capacitive coupling that detects anything that is conductive or has a dielectric different from air. In this case, the human body (your fingers) is being used as an electrical charge conductor.
The way it locates where your finger is on the screen is the change of local electrostatic field when your finger touches the glass of the capacitive surface. An image processing controller continuously monitors the electrostatic field (or the movement of each tiny capacitor) to find where exactly the finger touched the screen. Figure 1 shows a helpful diagram from TCI.ed on how it tracks the electrostatic field.
Figure 1: How the image processing controller evaluates touchpoints. (Source: TCI.de)
The advantages of using capacitive touchscreens include a brighter and sharper image due to the glass layer, highly touch sensitive, and supportive of multi-touch functions. This makes it great for smartphones and why you see it on iPhones, Samsung Galaxy, and HTC phones. Some disadvantages on using this touchscreen over a resistive one is that it is dependent on the conductivity of the human body, so a person can’t wear gloves (unless it has a conductive material on it). It’s also more expensive, and glass is prone to breaking more often.
The Touch Sensor is sensitive to touch, pressure as well as force. The Touch Sensor works similar to that of a simple switch.
When there is contact or a touch on the surface of the Touch Sensor. It acts like a closed switch and allows the current to flow through it. When the contact is released it acts similar to the opened switch and hence there is no flow of current as shown in the picture.
Working Of Different Touch Sensors
Below is the working of the two types of sensors are explained in detail.
Capacitive Touch Sensor
The Capacitive touch sensors are very popular since they are more robust, durable, and user friendly. Moreover, it is also cost-effective when compared to resistive touch sensors.
The capacitive sensor is made just similar to the normal capacitor. There are two conductors separated from the insulator. This value is monitored by circuit. When we touch with finger the capacitance value will change and this change in capacitance will convert it into a signal.
Touch sensor is an electronic device that allows you to detect any touch or proximity from a human user without needing any physical buttons or switches, which makes your project more user-friendly. A capacitive touch sensor is an electronic sensor that allows you to detect touch or proximity by measuring changes in the capacitance (which is the ability of any object to store an electrical charge). So when any conductive object (like a human finger) comes into close proximity to the sensor, the capacitance of the sensor will change. The advantage of touch are:
They are able to withstand wear and tear better, making them more durable.
They are more responsive and accurate, as they can detect even light touches.
They can support multi-touch and gestures.
They are less influenced by humidity and temperature.
TTP223B Capacitive Touch Sensor Interfacing with Arduino:
TTP223B Capacitive Touch Sensor has three pins. VCC & GND Pins of the sensor are connected to 5 volts DC and ground pin of Arduino. SIG or Signal Pin of the Sensor is connected to any digital Pin say Pin 7 of Arduino. When Pin 7 is active it will drive Pin 9 high. The Red LED and Buzzer is connected to Pin 3 and Pin 4 of Arduino. Both will turn on whenever the Pin 9 goes high indicating that the capacitive sensor is activated. Green LED connected Pin 2 of the Arduino will turn on whenever the Arduino is switched on to indicate power on.
TTP223B Capacitive Touch Sensor Interfacing with Node MCU:
TTP223B Capacitive Touch Sensor has three pins. VCC & GND Pins of the sensor are connected to 3.3 volts DC and ground pin of Node MCU. SIG or Signal Pin of the Sensor is connected to any digital Pin say Pin GPIO7 of Node MCU. When Pin GPIO7 is active it will drive Pin GPIO9 high. The Red LED and Buzzer is connected to Pin GPIO3 and Pin GPIO4 of Node MCU. Both will turn on whenever the Pin GPIO9 goes high indicating that the capacitive sensor is activated. Green LED connected Pin GPIO2 of the Arduino will turn on whenever the Node MCU is switched on to indicate power on.
TTP223B Capacitive Touch Sensor Interfacing with ESP32:
TTP223B Capacitive Touch Sensor has three pins. VCC & GND Pins of the sensor are connected to 3.3 volts DC and ground pin of ESP32. SIG or Signal Pin of the Sensor is connected to any digital Pin say Pin GPIO7 of ESP32. When Pin GPIO7 is active it will drive Pin GPIO9 high. The Red LED and Buzzer is connected to Pin GPIO3 and Pin GPIO4 of ESP32. Both will turn on whenever the Pin GPIO9 goes high indicating that the capacitive sensor is activated. Green LED connected Pin GPIO2 of the ESP32 will turn on whenever the ESP32 is switched on to indicate power on.