Product Introduction #
Touch sensor is a kind of capacitive touch switch module, which can detect and respond to human touch. It has a built-in touch detection IC (TTP223B), which is able to convert the user’s touch action into electrical signals for interactive interaction with the device. The touch sensor outputs a low level when we touch a specific location with our finger, and switches to output a high level when there is no touch.
Widely used in touch screen mobile phones, tablet computers, smart watches, smart home, etc.
Parameter Specification #
Parameters | Value/Description |
Operating voltage | 3.3~5V |
Operating temperature | -10°C~+60°C |
Default output level | High level |
Output signal | Digital signal |
Size | 3.16cm*2.38cm |
Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.
Touch Sensor | ESP32 |
VCC | 5V |
GND | GND |
Sign | Pin 32 |
Sample Code #
void setup() {
pinMode(32,INPUT);//Set pin 32 to input mode
Serial.begin(115200);//Set baud rate to 115200
}
void loop() {
Serial.println(digitalRead(32));//Read the state of pin 32 and print it to the serial monitor
delay(1000);
}
Note: If you are using an Arduino board, then change the pin in the program to PIN7, set the baud rate to 9600, and then connect the hardware pin to PIN7 and upload the program.
Test Results #
After uploading the code to the controller board, open the serial port monitor of the Arduino IDE, set the baud rate to 115200, and switch to the scroll mode. When our finger touches a specific position of the touch sensor, the sensor indicator turns on and the serial port monitor displays “0”, and when the finger does not touch, the sensor indicator turns off and the serial port monitor displays “1”.
Related Resources #
Get One Now #
B2B Business: info@acebott.com
Official Website: Capacitive Touch Sensor