Electronic Design

Eight-Wire Resistive-Touchscreen Controller Has I<sup>2</sup>C Interface

An analog, resistive touchscreen is a sensor consisting of two opposing layers, each coated with a transparent resistive material. The layers are separated by small spacer dots of nonconductive polyester that prevent the two layers from making contact. Touching the top surface compresses the flexible top layer towards the supported bottom layer. This causes electrical contact of the two layers between the span of insulating dots.

Determining a touch location re-quires two measurements: one to determine the X coordinate and one to determine the Y coordinate. For a single axis measurement, a drive voltage is applied across one layer. Once applied, the voltage linearly changes from the minimum drive voltage at one end to the maximum drive voltage at the other end. The opposing layer is used to measure the voltage at the point of contact. This process is repeated, alternating the functions of the two layers to obtain a measurement on the opposing axis.

The four-wire touchscreen (Fig. 1) is decoded by developing a voltage across the vertical layer's resistive material (top layer) and reading the horizontal touch location voltage on the opposing layer (bottom layer). A voltage is then placed across the horizontal layer's resistive material (bottom layer), and a vertical touch location voltage is read from the opposing layer (top layer).

For four-wire decoding:

  1. Apply VCC to xR, GND to xL, leave yL and yU unconnected.
  2. Read yU voltage.
  3. Apply VCC to yL, GND to yU, leave xR and xL unconnected.
  4. Read xL voltage.

The four-wire touchscreen analog-to-digital converter (ADC) output is:


n = ADC output count
VREF+ = positive voltage reference
VREF− = negative voltage reference
VIN = ADC input voltage

In general, VREF+ = VCC. The simplified four-wire touchscreen ADC output is then:

n = NVIN / VCC

An eight-wire resistive touchscreen is similar to the four-wire version. It has four additional sense lines to improve accuracy and counter environmental effects (Fig. 2). These lines are individually multiplexed to the references of the ADC (Fig. 3).

The decoding steps for the eight-wire touchscreen are:

  1. Apply VCC to xR; GND to xL; leave yL, yLs, yU, and yUs unconnected; connect xRs to VREF+ and xLs to VREF­.
  2. Read yU voltage.
  3. Apply VCC to yL; GND to yU; leave xR, xRs, xL, and xLs unconnected; connect yLs to VREF+ and yUs to VREF­.
  4. Read xL voltage.

The eight-wire touch screen ADC output is:


n = ADC output count
VREF+ = positive voltage reference
VREF- = negative voltage reference
VIN = ADC input voltage

It is possible to avoid multiplexing the sense lines if a four-channel ADC is available (Fig. 4).

The eight-wire touchscreen nonmultiplexing decoding steps are:

  1. Apply VCC to xR; GND to xL; leave xRs, xLs, yLs, yU, and yUs unconnected.
  2. Read yU, xRs, and xLs voltages.
  3. Apply VCC to yL; GND to yU; leave yLs, yUs, xR, xRs, xL, and xLs unconnected.
  4. Read xL, yLs, and yUs voltages.

The eight-wire touchscreen nonmultiplexing-sense-lines ADC output is:

Combining these values will return the same result as for the multiplexing-sense-lines conversion:

Both techniques (multiplexing and nonmultiplexing the sense lines) are equivalent. However, the last technique is particularly useful in microcontroller-based touchscreen controllers. This technique has been used to build a touchscreen controller with an I2C interface for a 12.1-in. eight-wire resistive touchscreen. While there are some commercial touchscreen controllers available, all of these utilize an RS-232 interface. In this application, there were no free RS-232 ports.

The touchscreen controller is based in the PIC16F876 microcontroller from Microchip (Fig. 5). This microcontroller includes a five-channel 10-bit ADC and supports the I2C interface. The above mentioned nonmultiplexing-sense-lines technique was em-ployed. With this technique, a minimal amount of external components are needed (only an optional low-pass filter has been added to eliminate noise). Low cost and compact size distinguish the resulting I2C-compatible eight-wire touchscreen controller.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.