# Adafruit TSC2046 SPI Resistive Touch Screen Controller

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/123/045/medium800/sensors_5767-06.jpg?1690396477)

Getting touchy performance with your screen's touch screen? Resistive touch screens are incredibly popular as overlays to TFT and LCD displays. Only problem is they require a bunch of analog pins and you have to keep polling them since the overlays themselves are basically just big potentiometers. If your microcontroller doesn't have analog inputs, or maybe you want just a way more elegant controller, the TSC2046 is a nice way to solve that problem.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/046/medium800/sensors_5767-05.jpg?1690396503)

This breakout board features the TSC2046, which has an easy-to-use SPI interface available. There is also an interrupt pin that you can use to indicate when a touch has been detected to your microcontroller or microcomputer. It can be powered from 3-5V, so it's safe to use with 3V or 5V logic. It's a nicely designed chip and has very stable precise readings. We found it's also a lot faster than trying to do all the readings on an Arduino.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/047/medium800/sensors_5767-03.jpg?1690396531)

For the screens that have 1mm pitch FPC cables, you can plug the cable right into the connector. The majority of medium/large touchscreens have that kind of connector. If you have another kind of touch screen, the four X/Y contacts are available on 0.1" pitch breakouts so you can hand-solder or wire them.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/048/medium800/sensors_5767-04.jpg?1690396557)

[Getting started is super easy with our simple TSC2046 Arduino library](https://github.com/adafruit/Adafruit_TSC2046). Plug any 1mm-pitch 4-wire resistive touchscreen to the on-board FPC connector, then use the library example to read touch points with X, Y and Z (pressure) results returned instantaneously. There's an IRQ pin that will drop low when a touch is detected, you can use that to reduce the SPI polling.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/049/medium800/sensors_5767-00.jpg?1690396600)

We also break out the Busy pin, that lets you know when the chip is still reading, and the Vref pin if you want to read or change the default 2.5V reference voltage. There's also two extra ADC pins you can read, Aux (0V - VRef) and VBat (0V - 2\*VRef).

# Adafruit TSC2046 SPI Resistive Touch Screen Controller

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/123/051/medium800/sensors_double.jpg?1690396917)

## Power Pins

- **Vin** - This is the power pin. It can be powered from 3-5V, so it's safe to use with 3V or 5V logic. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 3V microcontroller like a Feather RP2040, use 3V, or for a 5V microcontroller like Arduino, use 5V.
- **GND** - This is common ground for power and logic.

## Input Pins

- **FPC Connector** - FPC socket for a 1mm-pitch 4-wire resistive touchscreen located at the top of the board. This reads the X/Y contacts directly from a 4-wire FPC cable.
- **Y-, X-, Y+, X+** - These are the X/Y contacts available on 0.1" pitch breakouts. If you have another kind of touch screen that does not have a 1mm pitch FPC cable then you can solder directly to these points.

## SPI Pins

- **MOSI** - This is the SPI MOSI ( **M** icrocontroller **O** ut / **S** erial **I** n) pin. It is used to send data from the microcontroller to the TSC2046.
- **MISO** - This is the SPI MISO ( **M** icrocontroller **I** n / **S** erial **O** ut) pin. It's used for sending data from the TSC2046 to the microcontroller.
- **SCK** - This is the SPI clock input pin.
- **CS** - This is the Chip Select pin.
- **BUSY** - This is the SPI Busy pin. It lets you know when the TSC2046 is still reading.

## Interrupt Pin

- **IRQ** &nbsp;- This is the interrupt output pin. It will drop low when a touch is detected. You can use this to reduce the SPI polling.

## ADC Pins

- **Vbat** - The **Vbat** pin can be used to measure some other voltage external to the touchscreen. You can measure voltages (inclusively) between 0V - 2\*VRef.
- **AUX** - The **AUX** pin can be used to measure some other voltage external to the touchscreen. Unlike **Vbat** , however, the maximum voltage this pin can measure is 0V - VRef.

## VRef Pin

- **VRef** - The **VRef** pin can be used to override the "reference voltage" that the TSC2046 uses to measure other voltages. The TSC2046 has an internal reference voltage of 2.5V that by default is used when measuring temperature, **Vbat** , and **AUX** voltages. Connecting a 5V supply to the **VRef** pin instead will allow you to use that as the reference voltage, which will increase the accuracy of voltage reads for temperature, **Vbat** , and **AUX** ; and will also increase the range of voltage reads for **AUX**.

However, if you connect to the **VRef** pin, you must connect **VRef** to _ **the same voltage you connected Vin to**._

Warning: 

# Adafruit TSC2046 SPI Resistive Touch Screen Controller

## Arduino

Using the TSC2046 with Arduino involves wiring up the controller to your Arduino-compatible microcontroller, installing the [Adafruit TSC2046](https://github.com/adafruit/Adafruit_TSC2046) library and running the provided example code.

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the TSC2046 VIN.

Here is an Adafruit Metro wired up to the TSC2046:

- **Board 5V** to **breakout Vin (red wire)**
- **Board GND** to **breakout GND (black wire)**
- **Board pin 13** to **breakout SCK (blue wire)**
- **Board pin 12** to **breakout MISO (green wire)**
- **Board pin 11** to **breakout MOSI (yellow wire)**
- **Board pin 10** to **breakout CS (purple wire)**

![sensors_arduino_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/123/136/medium640/sensors_arduino_bb.jpg?1690559569)

## Library Installation

You can install the **TSC2046** library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/133/medium800/sensors_Arduino_Open_Library_Manager.png?1690558965)

Click the **Manage Libraries ...** menu item, search for **TSC2046** , and select the **Adafruit TSC2046** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/123/134/medium800/sensors_libInstall.png?1690559361)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/123/135/medium800/sensors_depends.png?1690559366)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: 

## Load Example

Open up **File**  **-\> Examples -\> Adafruit TSC2046 -\> touchscreendemo** and upload to your Arduino wired to the breakout.

https://github.com/adafruit/Adafruit_TSC2046/blob/main/examples/touchscreendemo/touchscreendemo.ino

Connect a resistive touchscreen to the TSC2046. Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. If you touch the touchscreen, you should see the values read from the touchscreen being printed out.

The first number is the X coordinate, the second number is the Y coordinate and the last number is the Z resistance measurement in ohms. This lets you know how much pressure is being exerted on the touchscreen.

Additionally, the ambient temperature around the TSC2046 chip, voltage reading on the **AUX** pin and voltage reading from the **Vbat** pin are also printed out.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/141/medium800/sensors_arduinoSerial.png?1690572063)

# Adafruit TSC2046 SPI Resistive Touch Screen Controller

## Arduino Docs

# Adafruit TSC2046 SPI Resistive Touch Screen Controller

## Downloads

## Files

- [TSC2046 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/123/053/original/tsc2046.pdf?1690399116)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-TSC2046-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20TSC2046%20SPI%20Resistive%20Touch%20Screen%20Controller.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/123/054/medium800/sensors_schem.png?1690401032)

![](https://cdn-learn.adafruit.com/assets/assets/000/123/055/medium800/sensors_fab.png?1690401040 dimensions are in inches)


## Primary Products

### Adafruit TSC2046 SPI Resistive Touch Screen Controller

[Adafruit TSC2046 SPI Resistive Touch Screen Controller](https://www.adafruit.com/product/5767)
Getting touchy performance with your screen's touch screen? Resistive touch screens are incredibly popular as overlays to TFT and LCD displays. Only problem is they require a bunch of analog pins and you have to keep polling them since the overlays themselves are basically just big...

In Stock
[Buy Now](https://www.adafruit.com/product/5767)
[Related Guides to the Product](https://learn.adafruit.com/products/5767/guides)

## Featured Products

### Resistive Touch screen - 3.7" Diagonal

[Resistive Touch screen - 3.7" Diagonal](https://www.adafruit.com/product/333)
Want to poke at your projects? This resistive touch screen can be used with a stylus or fingertip and is easy to use with a microcontroller. You can put it over a paper overlay for a touch control panel or attach it to an LCD to DIY a touch-activated display.

- 2.45" x 3"...

In Stock
[Buy Now](https://www.adafruit.com/product/333)
[Related Guides to the Product](https://learn.adafruit.com/products/333/guides)
### Resistive Touchscreen Overlay - 7" diag. 165mm x 105mm - 4 Wire

[Resistive Touchscreen Overlay - 7" diag. 165mm x 105mm - 4 Wire](https://www.adafruit.com/product/1676)
If you already have a 7" TFT that is about 165mm x 105mm in size (with a visible area equal to or smaller than ~152mm x 91mm), you can put this glass resistive overlay _over_ it to add a resistive touch screen.

Note the 7" is the 'nominal' size - which fits many...

In Stock
[Buy Now](https://www.adafruit.com/product/1676)
[Related Guides to the Product](https://learn.adafruit.com/products/1676/guides)
### Resistive Touchscreen Extension Cable - 20cm / 8" - 1mm Pitch

[Resistive Touchscreen Extension Cable - 20cm / 8" - 1mm Pitch](https://www.adafruit.com/product/1662)
Streeeeetch your resistive touch-screen's reach with a 20cm extension cord. This is a great accessory for our resistive touch screen controller breakouts. Plug your 4-pin 1mm pitch FPC into the socket end and the other end into your controller board. Pretty nice! The socket connector on...

In Stock
[Buy Now](https://www.adafruit.com/product/1662)
[Related Guides to the Product](https://learn.adafruit.com/products/1662/guides)

## Related Guides

- [Adafruit A4988 Stepper Motor Driver Breakout Board](https://learn.adafruit.com/adafruit-a4988-stepper-motor-driver-breakout-board.md)
- [Adafruit Prototyping Pi Plate](https://learn.adafruit.com/adafruit-prototyping-pi-plate.md)
- [Adafruit Si5351 Clock Generator Breakout](https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout.md)
- [Pico Bluetooth Keyboard Bridge](https://learn.adafruit.com/pico-bluetooth-keyboard-bridge.md)
- [Adafruit ADG728 1-to-8 Analog Matrix Switch](https://learn.adafruit.com/adafruit-adg728-1-to-8-analog-matrix-switch.md)
- [Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro](https://learn.adafruit.com/adafruit-icm20649-wide-range-6-dof-imu-accelerometer-and-gyro.md)
- [Adafruit PowerBoost 500 Basic](https://learn.adafruit.com/adafruit-powerboost.md)
- [14-Segment Alpha-numeric LED FeatherWing](https://learn.adafruit.com/14-segment-alpha-numeric-led-featherwing.md)
- [Bluetooth CLUE Robot Car using CircuitPython](https://learn.adafruit.com/bluetooth-clue-robot-car-using-circuitpython.md)
- [Light Meter](https://learn.adafruit.com/light-meter.md)
- [Adafruit Simple Soil Moisture Sensor](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor.md)
- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [CircuitPython Libraries on any Computer with Raspberry Pi Pico](https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico.md)
- [Adafruit PAM8302 - Mono 2.5W Class D Audio Amplifier](https://learn.adafruit.com/adafruit-pam8302-mono-2-5w-class-d-audio-amplifier.md)
- [ulab: Crunch Numbers fast in CircuitPython](https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython.md)
