Difference between revisions of "Resistive Touchscreen"

From Mech
Jump to navigationJump to search
Line 6: Line 6:


The 12.1 inch version was used in the [[Ball Balancing Challenge]] project. Its [http://www.bergquistcompany.com/to_technical_specs.cfm specifications] can be found on the Bergquist website. The screens are transparent and are meant to be installed over an LCD display; however, they are also useful in a horizontal orientation (as in the "Ball Balancing Challenge" project) for sensing the position of an object resting above.
The 12.1 inch version was used in the [[Ball Balancing Challenge]] project. Its [http://www.bergquistcompany.com/to_technical_specs.cfm specifications] can be found on the Bergquist website. The screens are transparent and are meant to be installed over an LCD display; however, they are also useful in a horizontal orientation (as in the "Ball Balancing Challenge" project) for sensing the position of an object resting above.

According to the technical specifications, the activation force for this touch screen is 50g. From experience, activation is more reliable with a heavier weight. The area of contact may also play a role in activation; metal balls rolling on the screen produced a slightly noisy signal which needed to be filtered for reliable use in a real-time system.


<br clear=all>
<br clear=all>


== Implementation ==


A resistive touchscreen is essentially a large variable resistor. When a potential is put across two opposite sides of the touch screen, an output voltage can be read that is proportional to the touching distance between the activated sides. The Bergqist screen is a 5-wire resistive screen; its connections consist of four wires going to each of the corners (upper left, upper right, lower left, lower right) and one that goes to the surface. A potential across two opposite sides of the screen results in a gradient across the screen in that direction. When the surface is pushed in at a certain point, it forms a circuit, the output voltage of which can be read as an analog input into a PIC chip.
------------------------------------------------


There are several ways to read a 5-wire resistive touchscreen. In the "Ball Balancing Challenge" project, the voltage gradient in one direction was created by placing +5 volts on two adjacent corners (for example the upper right and upper left) and grounding the other two. The position in the vertical direction was then read as proportional to the voltage on the middle (surface) wire.


Of course, this method only allows for the reading of one axis of the screen at a time. In order to read both the X and Y positions of the touchscreen, it is possible to use an interrupt service routine to switch rapidly between X and Y readings. For example, the +5V side can be switched between X and Y positions by alternating the voltage between the upper left (UL) and upper right (UR) corners and the upper left and lower left (LL) corners. Correspondingly, grounding will be switched between the lower left and lower right (LR) corners, and the upper right and lower right corners. This results in a type of square wave output on the screen wire, with its voltage representing the vertical and horizontal positions alternatively.
[[image:mems accelerometer.png|right]]

Accelerometers measure linear acceleration and also gravity; the two are indistinguishable. Thus they unavoidably function as tilt sensors as well. Inexpensive 1, 2, and 3-axis accelerometers are available which are constructed with MEMS techniques.
MEMS gyroscopes are also available, for measuring angular velocity, but are more expensive.


The voltage gradient in both the X and Y directions is linearly distributed from +5V to ground. Because the touch screens are typically rectangular, it may be necessary to multiply one of the readings by the screen's aspect ratio in order to create an equal coordinate system.


<br clear=all>
<br clear=all>


== Circuit ==
[[Image:carrier.jpg|right]]


The LIS2L02AS4-TR accelerometer gives you a choice of +/-2g or +/-6g full scale. It needs only a single +5V supply. Its bandwidth is from DC to 1.5KHz. The output is usually low-pass filtered in applications which do not need the full 1.5KHz bandwidth, using an external capacitor.

The chip is available only in a surface-mount SO-24 package. Fortunately an adapter socket (Digikey A322-ND) can be used to give the chip convenient DIP-24 legs.

<br clear=all>

[[Image:somesoldered.jpg|right]]
Soldering the chip into the adapter socket is a little challenging. Here are some tricks that make it easier. The more of these you can take advantage of, the easier it will be.


* Use a very fine pointed soldering iron and fine solder.
* Apply a bead of liquid flux to the pads, which will make the solder flow in between the pin and the pad enthusiastically.
* Tape the chip down onto its socket adapter.
* Have a magnifying lens or loupe available.
* Know which pins are not used.


The last point is especially useful. Start with pin 1 which is NC (Not Connected), so that even if you get a solder blob connecting pins 1 & 2 that's ok. If the other pins are all aligned with their pads, pin 1's solder will now hold them there. If not, melt pin 1's solder and adjust.


[[Image:chip.gif|right]]


Now solder only the other pins that are in use, as shown in red on the diagram. Solder one or two on the opposite edge as well, for mechanical stability.


Pins marked "reserved" should not be solder-blobbed to their neighbors because we don't know what they connect to inside the chip. Reserved is not the same thing as NC.


<br clear=all>
[[Image:circuit.gif|right]]


The voltage switching described above must be accomplished quickly and precisely (so as to avoid a shortage). One way to accomplish this is to permanently power opposite corners with +5V and ground, and then switch the other two according to an ISR. The alternating PIC output signal is sent to one of the corners, and the other one gets its opposite signal through an inverter. The inverter ensures that only one axis of the touch screen is activated at a time.


Use a supply shunt near the chip (1uF) from +5 to ground). Use low-pass filter capacitors on the outputs (called Cload in the diagram). The output impedance of the chip is 110Kohm, so a 0.1uF capacitor gives a low pass time constant of ~10mS.


== References ==


1. [http://en.wikipedia.org/wiki/Microphone Microphone - From Wikipedia, the free encyclopedia] <br>
Tie ST, PD low, and FS low for +/-2g full scale operation. The output voltage ranges 0-5V, well matched to PIC inputs. 2.5V is the output when acceleration is zero and and the chip is horizontal (not tilted.)
2. [http://www.national.com/nationaledge/dec02/article.html Integrated Circuits for High Performance Electret Microphones] <br>


== External Links ==


[http://www.bergquistcompany.com/to_flexibility.cfm Bergquist Resistive Touchscreen Reference] <br>
The circuit shows some optional buffer amplifiers to produce a low impedance output.

Revision as of 19:36, 20 March 2008

Overview

A small Bergquist resistive touchscreen

Resistive touchscreens are useful for measuring the position of an object on top of them, or as an interesting user interface feature. The Bergquist company sells them in a variety of sizes, ranging from 3.5 to 23 inches diagonal.

The 12.1 inch version was used in the Ball Balancing Challenge project. Its specifications can be found on the Bergquist website. The screens are transparent and are meant to be installed over an LCD display; however, they are also useful in a horizontal orientation (as in the "Ball Balancing Challenge" project) for sensing the position of an object resting above.

According to the technical specifications, the activation force for this touch screen is 50g. From experience, activation is more reliable with a heavier weight. The area of contact may also play a role in activation; metal balls rolling on the screen produced a slightly noisy signal which needed to be filtered for reliable use in a real-time system.


Implementation

A resistive touchscreen is essentially a large variable resistor. When a potential is put across two opposite sides of the touch screen, an output voltage can be read that is proportional to the touching distance between the activated sides. The Bergqist screen is a 5-wire resistive screen; its connections consist of four wires going to each of the corners (upper left, upper right, lower left, lower right) and one that goes to the surface. A potential across two opposite sides of the screen results in a gradient across the screen in that direction. When the surface is pushed in at a certain point, it forms a circuit, the output voltage of which can be read as an analog input into a PIC chip.

There are several ways to read a 5-wire resistive touchscreen. In the "Ball Balancing Challenge" project, the voltage gradient in one direction was created by placing +5 volts on two adjacent corners (for example the upper right and upper left) and grounding the other two. The position in the vertical direction was then read as proportional to the voltage on the middle (surface) wire.

Of course, this method only allows for the reading of one axis of the screen at a time. In order to read both the X and Y positions of the touchscreen, it is possible to use an interrupt service routine to switch rapidly between X and Y readings. For example, the +5V side can be switched between X and Y positions by alternating the voltage between the upper left (UL) and upper right (UR) corners and the upper left and lower left (LL) corners. Correspondingly, grounding will be switched between the lower left and lower right (LR) corners, and the upper right and lower right corners. This results in a type of square wave output on the screen wire, with its voltage representing the vertical and horizontal positions alternatively.

The voltage gradient in both the X and Y directions is linearly distributed from +5V to ground. Because the touch screens are typically rectangular, it may be necessary to multiply one of the readings by the screen's aspect ratio in order to create an equal coordinate system.


Circuit

The voltage switching described above must be accomplished quickly and precisely (so as to avoid a shortage). One way to accomplish this is to permanently power opposite corners with +5V and ground, and then switch the other two according to an ISR. The alternating PIC output signal is sent to one of the corners, and the other one gets its opposite signal through an inverter. The inverter ensures that only one axis of the touch screen is activated at a time.


References

1. Microphone - From Wikipedia, the free encyclopedia
2. Integrated Circuits for High Performance Electret Microphones

External Links

Bergquist Resistive Touchscreen Reference