Hi
thanks to a recent thread on this forum I have successfuly hooked up a 4-wire resistive touchscreen to MaxMSP via Arduino. Touchscreen 'analogRead' outPins are pulled to ground via 10kOhm resistors to reduce flakiness/jitter. To ensure stable readings I have to press fairly firmly on the surface; any reduction in pressure lets readings fall rapidly to zero. I was wondering (in my naivety) if it is possible to enhance the sensitivity of the screen (preferably in hardware), perhaps by trying different values of resistor in the circuit?
Noob-osity = c. 80%
Have you tried increasing the value of the resistors to somewhere between 50 and a 100K?
Gut feeling from the playings around ive done in the past seem to suggest your values may be a bit low, alternatively, have you tried replacing them with ESD diodes instead?
I have tried increasing the resistance to ground of the two analogRead lines in the circuit, without radical improvement; the issue is that the voltage rapidly drops to zero if, even during contiued contact, pressure is relaxed:
/* TOUCHSCREEN ELECTRODE PAIRS= X1-X2, Y1-Y2
connect as A0=X1, A1=Y1, A2=X2, A3=Y2;
A0 and A1 alternate readings, so 10k pulldown to gnd on these;
'open circuit' floating values cured via digitalWrite to 0v on
A2 and A3
*/
int xVal = 0;
int yVal = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
pinMode(A0, OUTPUT); //analog 0 = gnd;
pinMode(A1, INPUT); //analog 1 = signalRead;
pinMode(A2, OUTPUT); //analog 2 = +5v;
pinMode(A3, INPUT); //switch3
digitalWrite(A0, LOW); //gnd
digitalWrite(A2, HIGH); //+5v
delay(10); //let voltage settle
xVal = analogRead(A1); //read pin 1
xVal/=4;
digitalWrite(A2, LOW); //back to gnd
//switch pinModes to read other axis
pinMode(A0, INPUT); //analog 0 = signalRead
pinMode(A1, OUTPUT); //analog 1 = gnd
pinMode(A2, INPUT); //switch2
pinMode(A3, OUTPUT); //analog 3 = +5v
digitalWrite(A1, LOW); //gnd
digitalWrite(A3, HIGH); //+5v
delay(10);
yVal = analogRead(A0);
yVal/=4;
digitalWrite(A3, LOW); //back to gnd
//send data to Max
Serial.print(xVal, BYTE);
Serial.print(255, BYTE);//punctuation byte
Serial.print(yVal, BYTE);
delay(80);
}
I have tried increasing the resistance to ground of the two analogRead lines in the circuit,
What values have you tried?
With values over 100K you will run into noise problems, do you see this before the rapid fall off?
The other solution is to use an op amp to improve the input impedance but this is quite high already with the analogue input.
I went from 10k to 22k to 44k, without any noticeable difference; i'm sending the circuit 5v on the powerlines, reading one input, then switching them to zero before reading the second. Using the serial monitor in Arduino I'm getting X/Y 0-1023 across the entire touchpad as expected. I think the problem may be that, without contact, I have an open circuit. The problem remains the rapid descent to zero unless firmly pressing all the time.
Thanks for your contribution