Skip to content

Touch Sensor

Updated: 6/28/2025 Words: 0 words Reading time: 0 minutes

Touch sensors are used to detect and respond to physical touch or pressure. They are commonly used in various electronic devices and systems to allow users to interact with them in an intuitive and user-friendly way. Touch sensors have become fundamental components of modern technology, widely used in smartphones, tablets, laptops, kiosks, and many other applications.

Preparation

Hardware

HardwareDescriptionImage
Creative Box PlatformMy Image
Touch SensorTaobao Purchase LinkMy Image
Dupont WiresTaobao Purchase Link, please select male-to-female type

Software

SoftwareLinkDescription
Test ApplicationLinkOfficial frontend application, can be loaded and used directly through the console.

Connection

My Image
Connection
Connect touch sensor power VCC to platform 3.3V power supply.
Connect touch sensor GND to platform GND ground.
Connect touch sensor SIG signal line to any pin on the platform, the diagram shows platform pin 12.

Usage

Open the Creative Box console and load the API Test application. Enter the application and send the two JSON requests below in sequence. When a finger touches the touch sensor, the platform's green LED lights up; when the finger leaves the touch sensor, the green LED turns off.

Creative Box ConsoleLoad ApplicationSend First Request, When Finger Touches Touch Sensor, Light Up Green LEDSend Second Request, When Finger Leaves Touch Sensor, Turn Off Green LED
  • When a finger touches the touch sensor, the touch sensor's SIG signal line changes from low level to high level. The JSON request below tells the platform to turn on the green LED when a rising edge is detected on the signal line.
json
{
  "event":"pinstate",
  "pin": 12,
  "trigger": "rising",
  "debounce": 50,
  "actions": [["gpio", "led", "output",0]]
}
  • When a finger leaves the touch sensor, the touch sensor's SIG signal line changes from high level to low level. The JSON request below tells the platform to turn off the green LED when a falling edge is detected on the signal line.
json
{
  "event":"pinstate",
  "pin": 12,
  "trigger": "falling",
  "debounce": 50,
  "actions": [["gpio", "led", "output",1]]
}

Principles

My Image

Touch sensors work by detecting physical contact on their surface. When a user touches the sensor's surface, it responds by sending signals to connected electronic devices or systems. These signals can be used to perform specific functions, such as selecting items on a screen, moving a cursor, or executing commands.

Touch sensors mainly have the following types:

  • Capacitive Touch Sensors: Use human body capacitance to detect touch. When a conductive object (such as a finger) touches the screen, it changes the capacitance at that point, generating an electrical signal.
  • Resistive Touch Sensors: Consist of two separated layers with an insulating gap between them. When the top layer is pressed, it contacts the bottom layer, producing current.
My Image

Capacitive Touch Sensors

Capacitive touch sensors detect touch by detecting capacitance changes. They are more responsive, robust, durable, and lower cost than resistive ones, making them very popular.

In capacitive touch sensors, the capacitance measurement circuit continuously measures capacitance CS. If any conductive object (such as our finger) touches the sensor, the capacitance increases. The capacitance measurement circuit then converts the detected capacitance change into a signal.

My Image

Resistive Touch Sensors

Resistive touch sensors work by sensing pressure applied to the surface. They can sense pressure from non-conductive materials, such as pens, sticks, or gloved fingers, so they have wide application scenarios.

Resistive touch sensors consist of two conductive layers with a very small distance between them. When the top and bottom layers make contact, they produce a potential difference. The circuit diagram below shows the basic working principle of resistive touch sensors. External pressure forms a closed circuit, producing current changes.

My Image

Applications

  • Mobile Devices: Smartphones, tablets, and smartwatches.
  • Computers: Laptops, desktop computer monitors, and all-in-one computers.
  • Kiosks: Public information terminals and self-service kiosks.
  • Retail and Hospitality: Point of sale (POS) systems and digital signage.
  • Industrial Control Panels: Used in manufacturing and automation.
  • Automotive: Touchscreens in vehicle infotainment systems.