0

Sample Rate Jittering

Posted by Burke on Jun 4, 2010 in Capacitive Touch, General, Input

When you are designing a system that has a sensor that must be sampled, eliminating noise from the readings should be one of your concerns. Averages and other low-pass filters do a good job at smoothing the signal which reduces the amount of white noise, but if the sample rate of your system is a harmonic of the noise’s frequency a different approach is needed.

First, we need to understand what is going on in the system that is causing us to change our sampling behavior. The picture below shows a normal sensor signal that has been injected with a single-frequency noise signal. The sampling rate occurs at a harmonic frequency to the noise and so the samples are not occurring at random locations on the noise – they are following a harmonic sine wave.

Sampling at a Harmonic of the Noise Frequency

If each sample is processed individually, the system will have to filter out the sine wave which could slow the response time. If multiple samples are added together or averaged, the resulting stream of samples will look like they have a large increase in the amount of white noise. This will have to be filtered out which will decrease the sensitivity of the sensor.

The solution to this problem is to slightly jitter the sampling rate of your system. Instead of sampling every X ms, sample every X+Y ms, where Y is a random value that is much smaller than X. For example, if your system is sampling once every 10 ms, then the sampling rate may be jittered by +/- 25 µs. (TIP: To create a simple, pseudorandom number, you can take the least significant bits from the previous sample and add them to the sampling rate timer. It’s not perfectly random, but it should be random enough.)

The result of this technique will be that your system will sample with the behavior shown in the picture below. Notice how the samples are still following the sample rate, but now they are more randomly distributed throughout the injected noise signal. Now if the system processes one sample at a time, it will see a small amount of increase white noise which will be solved with a simple averaging filter. If the system takes several samples and combines them before processing them, the white noise should naturally eliminate itself and the samples will hover around the normal sensor signal.

Jittering the Sample Rate

Tags: , , , , , ,

 
0

Capacitive Touch Algorithm Tuning for Thick Overlays

Posted by Padmaraja on Oct 20, 2009 in Capacitive Touch

Often the capacitive touch applications need thick overlay to be used over the capacitive touch pads to make the system mechanically robust. In addition to that, for aesthetic reasons, the overlay may be curved. This poses a serious issue of reducing the touch sensitivity. The curvature on the overlay distorts the sample reading from the buttons. Also it gives a variation in reading from button to button. To overcome these issues, the capacitive touch algorithm needs some tuning.      

 

When thick overlay of plastic or glass is used, the sensitivity goes down significantly. As you know, the human touch produces a basic capacitor, with finger and the touch pad being the electrodes and the overlay material is the dielectric material separating the plates. Because the thickness of the dielectric material increased(the overlay), the capacitance shift produced by touch reduces, thus reducing the sensitivity. Because of this, the signal to noise ratio reduces further down.

To overcome this, a slow moving average algorithm is used. First, the capacitive sensing module, such as Charge Time Measurement unit(CTMU) or Capacitive Sensing Module(CSM), is sampled 16 to 64 times(N Samples) every fixed interval. These N samples are accumulated and used as the current running sample. The averaging algorithm takes the current sample and takes a fraction of it and adds to the running average. The running average is not updated until 20 or more samples of slow moving average. By doing this the average changes very slow and the slight shift of the current sample allows to detect the touch.

Because of the low sensitivity, the difference between the current sample and the average data could be less than 1%. Each channel needs tuning on the number of samples for slow moving average to suit the touch key size and key characteristics.

 
0

Interesting Webcast about microcontroller in Human Interface

Posted by Yann on Oct 5, 2009 in Capacitive Touch, Displays, General

Technical Editor Robert Cravotta explores processor and software-processing architectures and the impact they have on system and software development. Relevant architectures include microprocessors, microcontrollers, digital signal processors (DSPs), multiprocessor architectures, processor fabrics, coprocessors, and accelerators, plus embedded cores in FPGAs, SOCs, and ASICs.

EDN Webcast

 
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

The Difference Between Capacitive Touch & Capacitive Proximity Sensors

Posted by Keith on Jul 14, 2009 in Capacitive Touch

The only difference between a capacitive touch sensor and a proximity sensor is sensitivity. A proximity sensor is really just a very sensitive touch sensor. So, to make a proximity sensor, use the same basic design for a touch sensor, and then significantly increase the size of the sensor pad, reduce or eliminate the insulating cover, and crank up the sensitivity of the capacitance to digital converter.

Now, when the user’s hand comes near the proximity sensor, the capacitance will start to rise before their hand touches the sensor. All that is left to do is set the touch detection threshold such that the circuit triggers at the required distance. Typically a 2” diameter sensor, with only a solder mask covering, can easily achieve 3-5 inches of detection range.

 
0

How small can I create capacitive touch sensors, and how close together can the buttons be?

Posted by Keith on Jul 8, 2009 in Capacitive Touch

This is a recurring question with capacitive touch; how small can I make the buttons be, and how closely together can I pack the buttons? Unfortunately, there is no simple answer here, the minimum size of the buttons, and the minimum spacing is really a function of the thickness of the cover material, its characteristics, and the resolution of the capacitance to digital conversion system used.

If the buttons are close together, and the insulating cover is thick, then you have the cross coupling problem discussed in question 2. If the buttons are too small, then your design won’t create a significant amount of capacitance shift in response to a touch. Remember, the amount of capacitance shift generated by a touch is proportional to the area of the button, and inversely proportional to the thickness of the insulating cover; so large buttons, widely spaced, with a thin cover produce the greatest sensitivity. Small buttons, closely packed together under a thick insulating cover produce much less sensitivity, and they will cross couple, making an accurate touch detection more difficult.

 
0

Water doesn’t like capacitive touch :(

Posted by Keith on Jun 30, 2009 in Capacitive Touch

One of the factors that affect the amount of capacitance generated is the characteristics of the insulating material. This is quantified in the form of a material dependence constant known as Permittivity (e); the higher the permittivity of the insulating material, the higher the capacitance of the resulting capacitor. Permittivity is usually expressed as a function of the permittivity of free space(e0), and a relative permittivity number for the specific material(er). Glass and plastic have relative permittivity values in the range of 3 – 8, so they create capacitances that are 3 – 8 times greater than capacitors that use air as an insulator. Water, on the other hand, has a relative permittivity of 78.

This means that if water is covering a capacitive touch panel, and the user touches a sensor covered by the water, then the user’s finger will couple to every sensor covered by the water, almost as well as it couples to the sensor beneath the user’s finger. In addition, if the water also covers a ground, then the parasitic capacitance of the sensor will also significantly increase and couple potentially cause a false touch trigger.

 
0

When I touch a capacitive touch sensor, why do adjacent touch sensors react?

Posted by Keith on Jun 20, 2009 in Capacitive Touch

When you touch a sensor, you form a capacitance to ground that is a function of the area of the sensor, the characteristics of the insulating cover over the sensor, and the thickness of the insulating cover. You also form a capacitance to ground with any adjacent sensors, through the insulating cover. However, the effective area of the sensor is smaller because the path to the adjacent button is at an angle, and the distance between your finger and the adjacent button is greater as well.

This means that the amount of affect that a press will have, on an adjacent buttons, is determined the distance between the buttons, and the thickness of the insulating cover. To minimize this cross talk effect, separate the buttons as much as possible, and use the thinnest insulating cover possible.

sesning-layers-diagram

 
1

capacitor basics

Posted by Keith on Jun 10, 2009 in Capacitive Touch

In a recent webinar, a number of questions came up concerning capacitive touch. I thought I would cover some of the questions and provide some insight into the physics of capacitive touch along the way in some upcoming posts. Likewise, if you have questions or topics that you’d like us to address, drop us a note.

Let’s start by reviewing a few capacitor basics. A capacitor is basically any two conductors separated by an insulator; the area of the conductors, the spacing between the conductors, and the characteristics of the insulating material, all combine to determine the amount of capacitance created. So, any two pieces of metal, which are not connected to one another, exhibit capacitance. The two pieces of metal can be two plates in a tuning capacitor, two cars sitting in the parking lot, or two bits of iron in adjacent red blood cells.

hat this means for capacitive touch is that every surface of an average human being is capacitively couple every other surface. So, if I touch a capacitive switch sensor, I am actually capacitively coupling the touch sensor, through my body, to ground beneath my feet. Or, in the case of a hand held device, I am capacitively coupling the sensor, to the ground of the circuit through my other hand that is holding the device.

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