0

Building a cap touch interface with a couple of comparators and the SR latch

Posted by Carol on Sep 29, 2009 in Capacitive Touch

With all the press and bluster about capacitive touch and all the custom peripherals that make it possible, I thought it might be a good idea to look into a solution that is a little more generic.

One simple method for measuring capacitance is to build the cap touch sensor into a relaxation oscillator as one of the frequency determining elements. For example, the figure below shows a generic oscillator circuit.

9-29-2009-9-38-53-am

The two comparators form a windowing system that sets and clears the flip flop when the voltage across the sensor capacitor exceed 2/3 VDD or falls below 1/3 VDD. If this looks familiar to you, it should, it is the standard schematic for a 555 timer.

The frequency output is then routed into a counter, with a secondary counter driven by a stable clock source.

To do a conversion of the sensor value, both timers are cleared and then left to run free.

When Timer0 over flows, Timer1 is stopped and the value is retrieved. This value will be proportional to the frequency of the oscillator. If the exact value of the frequency is important, then we would need to design the system so that Timer0 timed out at a 10X multiple of 1 Hz, fortunately, the exact proportionality coefficient is not really important because we are only interested in a shift in the value.

Ok, that works for a one button system, how do we expand it into something more useful? Simple, we use the comparators on the microcontroller, because they also include 4:1 analog multiplexer so we can switch our relaxation oscillator to one of four inputs allowing a 4 buttons system. In fact, if we expand the same concept with an external analog multiplexer, we can push the number of buttons as high as we need. The only limitation will be the time required to measure the frequency of all those buttons.

See the figure below for an example.

9-29-2009-9-39-24-am

Of course, if we are willing to get a little creative in our layout, we can chop down the number of inputs while still retaining the variety of button inputs. Below is an example of how 4 inputs can be expanded to cover 10 buttons.

9-29-2009-9-39-45-am

In the example, buttons 1/3/7/9 are full buttons, while 0/2/4/5/6/8 are half buttons. The only challenge with this system is that we have to do some extra decoding on the output to determine which button is pressed. Fortunately, this is fairly easy, all you have to do is look for two buttons with the same shift. Note: it is usually easier to look for the half buttons first, and then if you don’t find one, look for single buttons.

For those that are interested, the dual comparator with a flip flop is available on the following small Microchip microcontrollers;
PIC16F616 / PIC16HV616 14 pin with PWM
PIC16F690 family 20 pin with PWM, USART, and SSP
PIC16F887 family 28/40 pin with 2PWM, UART, EEPROM, and MSSP

 
0

Touch Blog General Touch Screens

Posted by Charlie and Cassie on Sep 2, 2009 in General, Touch Screen

Touch Screen Article, Blog Aug 2009:  Cassandra Backus, Charlie Riegert

Touch screens are user-friendly input devices that are becoming widely accepted in everyday human-machine interaction.  From large industrial machines to groceries store check-out lines, all the way down to our cell phones and personal media players, touch screens are quickly becoming the standard interface.

 

It is important to understand that there is not a single perfect touch technology that fits every design and application. The three primary touch technologies each have different strengths and weaknesses. This chart highlights the main topics for consideration when choosing a touch technology: Cost/Optics/Sensor Life/ Integration Ease/ Multi Touch capability/ and Touch Object (the user input method)

 

Touch Technology Comparison Chart

image0021

Resistive technology easily dominates the touch market, accounting for over 80% of all touch designs, boasting several desirable qualities: low cost, ruggedness, ease of integration, and the ability to use any type of user input method (gloved hand/ stylus/ finger). The only major drawbacks for resistive technology are the optical quality of the sensor and its limited multi touch capability. This article will discuss the basic theory of resistive touch technology and address the crucial role of the resistive touch screen controller within a completed touch system, focusing on the embedded market. 

 

Resistive Touch Technology

Resistive 4, 5, and 8-wire touch sensors consist of two facing conductive layers, held in physical separation from each other. The force of a touch causes the top layer to move and make electrical contact with the bottom layer. Touch position measurements are typically made by applying a linear voltage gradient across a layer or axis of the touch sensor. The touch position voltage for the axis can be measured using the opposing layer.

 

4 wired Diagram

4wirediagram4

 

The basic decoding of an 8-wire sensor is similar to a 4-wire. The difference is that an 8-wire sensor has four additional interconnects used to reference sensor voltage back to the controller. A touch system may experience voltage losses due resistance changes in the bus bars and connection between the controller and sensor. The losses can vary with product use, temperature, and humidity. In a 4-wire sensor, variations in the losses manifest themselves as error or drift in the reported touch location. An 8-wire touch sensor automatically adjusts for the changes, with the additional four reference lines. The reference lines allow the controller to know what the voltage is, at the touch sensor bus bars.

 

5 wire Diagram

5wirediagram

5 wire resistive technology is a bit different and is designed to allow damage to the top layer without interfering with the touch solution. The voltage is not directly applied to the edges of the active layer, as it is for 4-wire and 8-wire sensors. The voltage is applied to the corners of a 5-wire sensor. To measure the X-axis, the left edge of the layer is driven with 0 Volts (ground), using connections to the upper left and lower left sensor corners. The right edge is driven with +5Vdc, using connections to the upper right and lower right sensor corners. To measure the Y-axis, the top edge of the layer is driven with 0 Volts (ground), using connections to the upper left and upper right sensor corners. The bottom edge is driven with +5Vdc, using connections to the lower left and lower right sensor corners.

 

Resistive Touch Electronics

Most resistive “touch controllers” on the market are basic analog-to-digital converters.  They convert the raw electrical data from the sensor to a digital signal.  The basic analog-to-digital converters can handle this operation, but still require more development to make them work properly as a touch screen controller.

 

To measure a touch position, the controller must drive the X axis and then the Y axis, creating a voltage divider where the voltage is sensed off the non-driven axis. While on the surface this is a simple concept, the sensor contains both resistive and capacitive elements that must be taken into account when designing this type of a device. These elements cause an associated RC rise time that varies both with pressure and the aging of the sensor. The analog-to-digital converter logic must be designed with this rise time in mind.  In addition, filtering algorithms must be implemented to eliminate any invalid electrical data from the sensor.  Calibration routines must also be defined, and then implemented, to map the electrical data to the visual display.  Often, the analog-to-digital converter logic is designed around the characteristics, and anomalies, of a particular sensor.  This can cause the integrator to pigeon-hole themselves into a single sensor sourced for the system.  This can quickly turn sour, should the sensor no longer be sufficient for the system.  This could be due to environmental damage to the sensor, manufacturer changes, or trying to implement the controller in a different application that requires a particular sensor construction, optic qualities, or durability.  This then forces more engineering time to develop more algorithms for compensating for a different sensor to create a functioning system again.

 

 

 

As you consider touch screen controller options, investigate the details to be certain that you have a complete touch controller solution, rather than just an analog-to-digital convertor.  A true turnkey touch screen controller should eliminate the need for reiterative engineering costs by providing filtered, reliable touch coordinates which ultimately provides for lower costs and quicker development cycles for embedded products.

 

 

 

 

 

 

 

Copyright © 2010 Notes from the Lab All rights reserved. Theme by Laptop Geek.