resistive touchscreen sensitivity
Hi team
I posted this on the Arduino forum, and had a search through several electronics sites; perhaps there's also someone here who can suggest something.
I have successfully hooked up my touchscreen to Max via Arduino; the code is fine, the circuit is fine and the Max patch is fine. I'm just wondering if it's possible to tweak the sensitivity of the entire circuit? When touching, one must press fairly firmly, otherwise any relaxation of touch, even with continued contact, results in a rapid fall to zero. In the Max patch, I'm using [sel 0]-> outR, after all the [serial] gubbins to help smooth some jitter. But is it possible to tweak the sensitivity, perhaps by using resistor values other than 10k. Hey, maybe even connect a variable resistor to allow realtime tweaks? Hmmm.
Thanks
Brendan
what's the expiry date on posts?
#bump
a lot of "touch" interface activity on this forum of late.......
Sorry for the OT, but...
Brendan, are you Brendan Byrne? Once of Falmouth/iRes fame?
I'm not famous I'm afraid, or even renowned.
I'm Brendan/Univ of Ulster/Accessible Creative Interaction Design PhD student. Erm, I once met Meatloaf, if that's any good to ya?
LOL
Brendan
I've never worked with one of these touchscreens, but the way you usually have to deal with variable resistance components is to find the range of resistances using an ohm-meter, and then calculate the appropriate voltage divider resistances that will give you the best range. This calculator might help:
http://www.raltron.com/cust/tools/voltage_divider.asp
You want to optimize the circuit to give as close to 0-5volts as possible. If you want even more range than you can get with a simple voltage divider circuit, you might have to employ an op-amp to buffer and scale your voltages. I believe Electrotap used to have a good blog post about that.
All that said, I'm sort of surprised that the 10k resistors are necessary at all, as I'd assumed that resistive touch surfaces were basically overlaid ribbon controls essentially, and that the voltage divider would be intrinsic to that design. Do you have a datasheet?
@Andrew
Thanks for the advice and link.
No data sheet found (cheap Far East product*), but I do know that the average overall resistance of the four electrodes is 200-900 Ohms. The 10k resistors allow a cleaner signal on the analogRead lines; without them there was more jitter, and the signal continually maxed out when finger pressure relaxed. I'm going to look at a smoothing function in Arduino, but may not get the required results as my code necessarily toggles between the two read lines. I may have to accept that I have already optimized this circuit as best I can. I'm going to try to compensate in Max. The problem is this:
Values incoming are X and Y axis 20-230ish (2bytes, each 0-254 from Arduino). Continuous touch along the panel gives fairly smooth values in Max varying only +/- 10, with occasional large leaps +/- 50-100. Discrete touches are more predictable, but can still be jittery. Temporal smoothing (with [line]) in excess of 100ms has the expected effect but is way too laggy, I need more or less instant response (I've trawled the forum for 'smoothing' and tried them all). I might use a gate for discrete touches (closing the gate when values descend), but don't know how best to smooth the continuous data......
Thanks for the responses
Brendan
*edit, isn't everything nowadays???
Atmel (the company that makes the AVR chip used on the Arduino) has some really excellent documentation in their Application Notes section:
Check out AVR341: Four and five-wire Touch screen Controller using tinyAVR and megaAVR devices
There is a pretty in-depth discussion of the engineering problems associated with 4-wire touchscreens and solutions. The code examples are aimed at a lower-level language than the Arduino API, but you should be able to get a decent idea of how it should work. In general, any of the info in the Atmel Application Notes can be applied to Arduino projects since they are based on the same chips. Hope that helps!
Hey Andrew
I've found one or two extracts from the Atmel source here and there, but man, you really hooked me up dood (as they say in Hollywood!); this is great.
Best
Brendan