Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Touch Shield : Examples, Pinouts, and Specs

Image of Touch Shield Design with Touch Shield in Cirkit Designer

Introduction

The Touch Shield is an electronic component designed to add touch-sensitive input to projects. It typically features a capacitive touch sensor, which can detect finger presence and location on a surface. This shield is often used with microcontroller platforms like the Arduino UNO to create interactive devices, such as touch interfaces, control panels, or even simple games.

Common applications include:

Explore Projects Built with Touch Shield

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Sensor Shield with I2C LCD and Bluetooth Interface: A project utilizing Touch Shield  in a practical application
Arduino Sensor Shield with I2C LCD and Bluetooth Interface

This circuit features an Arduino Sensor Shield v5.0 interfaced with an I2C LCD Display and an HC-05 Bluetooth Module. The LCD Display is connected for power, ground, and I2C communication, allowing it to display data or messages. The HC-05 Bluetooth Module is wired for serial communication with the Arduino Sensor Shield, enabling wireless data exchange with other Bluetooth-enabled devices.

Open Project in Cirkit Designer
Image of Arduino Sensor Shield-Based Smart Distance and Tilt Detection System with Ultrasonic and IR Sensors: A project utilizing Touch Shield  in a practical application
Arduino Sensor Shield-Based Smart Distance and Tilt Detection System with Ultrasonic and IR Sensors

This circuit integrates various sensors and actuators with an Arduino Sensor Shield to create an interactive system. It uses an ultrasonic sensor for distance measurement, an IR sensor for object detection, a tilt sensor for orientation detection, and an 8x8 LED matrix for visual feedback. Additionally, it controls a servo motor and a buzzer, responding to sensor inputs and user interactions.

Open Project in Cirkit Designer
Image of Capacitive Touch and Ultrasonic Sensor Interface with Adafruit Feather nRF52840 Sense: A project utilizing Touch Shield  in a practical application
Capacitive Touch and Ultrasonic Sensor Interface with Adafruit Feather nRF52840 Sense

This circuit features an Adafruit Feather nRF52840 Sense microcontroller connected to an ultrasonic sensor for distance measurement and an Adafruit AT42QT1010 capacitive touch sensor for touch input. The ultrasonic sensor's Trigger and Echo pins are interfaced with the microcontroller's digital pins D6 and D9, respectively, to send and receive ultrasonic signals. Additionally, a pressure-sensitive conductive sheet (Velostat) is connected in series with a 10k Ohm resistor to the microcontroller's analog pin A0, likely forming a pressure sensor.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Description Notes
1 VCC Connect to 3.3V or 5V
2 GND Connect to ground
3 SCL (I2C) / SCK (SPI) Serial clock line
4 SDA (I2C) / MOSI (SPI) Serial data line
5 RESET Reset pin, active low
6 INT Interrupt pin
7 MISO (SPI only) Master In Slave Out (SPI mode)
8 CS (SPI only) Chip Select (SPI mode)

Usage Instructions

Integrating with a Circuit

  1. Power Connections: Connect the VCC pin to the 5V output on the Arduino and the GND pin to one of the Arduino's ground pins.
  2. Data Connections: For I2C, connect SCL to A5 and SDA to A4 on the Arduino UNO. For SPI, connect SCK to pin 13, MOSI to pin 11, MISO to pin 12, and CS to a digital pin (e.g., pin 10).
  3. Interrupts (Optional): The INT pin can be connected to a digital pin on the Arduino to allow the touch shield to notify the microcontroller of touch events.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <TouchScreen.h> // Include the touch screen library

// Touch screen pins
#define YP A3  // must be an analog pin
#define XM A2  // must be an analog pin
#define YM 9   // can be a digital pin
#define XP 8   // can be a digital pin

// Touch screen calibration values
#define TS_MINX 150
#define TS_MINY 120
#define TS_MAXX 920
#define TS_MAXY 940

// Create a touch screen object
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Check for a touch
  TSPoint p = ts.getPoint();
  
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);
  
  if (p.z > ts.pressureThreshhold) {
     // Scale from touch coordinates to screen coordinates
     p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
     p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
     Serial.print("X = "); Serial.print(p.x);
     Serial.print("\tY = "); Serial.print(p.y);
     Serial.println();
  }
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can I use the touch shield with a 3.3V system? A: Yes, but ensure that the touch shield is compatible with 3.3V logic levels.

Q: How do I clean the touch surface? A: Use a soft, slightly damp cloth. Avoid harsh chemicals and do not apply excessive force.

Q: What should I do if the touch shield is unresponsive? A: Reset the microcontroller and the touch shield. If the issue persists, check for any visible damage to the shield or its connections.