Touch Control Panel Help

I've been reading the “Touch Control Panel” chapter from the Practical Arduino book. It seemed easy enough, so I purchased this 4-wire resistive touch control panel from ebay without a datasheet. I was able to figure out the pairs of connections by measuring the resistance between them with a multimeter while the screen wasn't touched. The resistance between pins 1 and 2 is 727 ohms and 217 ohms between pins 2 and 4. I read up on 4-wire resistive touchscreens and the location of the sensors. I then traced the pins to the sensors of my touch control panel. If the information that I read was correct, then the pin order of my touch control panel is X-, Y+, X+ and Y-.

I then downloaded this Touchscreen library. I wired everything up and used the touchscreendemo example from the Touchscreen library, using the resistance of 727 ohms between pins 1 and 3 of my touch control panel.

First I wired the touch control panel like so.

X- to D9
Y+ to D8
X+ to A1
Y- to A0

I moved my finger around to see how the values changed along one axis and the other value changed along the other axis. The results for each axis did change, but they didn't make any sense to me.

So I switched the pairs of wires around and I'm still getting similar results. Except the pressure values are a lot higher.

X- to D8
Y+ to D9
X+ to A0
Y- to A1

Even the pressure values don't seem right, at times it seems the harder I press the lower the pressure and vice versa. How do I know which wiring is right and which is wrong? What am I missing.

Maybe u need a special controller chip?
like ADS7843?

or r u trying to implement the functionality of that chip with ur Arduino?

Maybe the ADS7843 datasheet gives u hints on how to write ur own controller firmware and how to build the driver stage?

Did u try to swap D8/D9 only?

like this:
Y- to D8
X- to D9
X+ to A0
Y+ to A1
or this:
Y- to D8
X- to D9
Y+ to A0
X+ to A1

i think, the controller puts a voltage on X+&X- and then it measures the voltage at Y+...
the X sheet provides a voltage gradient then...
the Y sheet is used to measure the voltage at the connection point between X sheet and Y sheet...

so when u connect it wrong, it will put a voltage on X+&Y- and it will try to measure the voltage on X-, which wont work...

i have another idea:
u could apply a small voltage (e. g.: 1V & GND) to the 727Ohms pins...
then u could measure the voltage between one of the other 2 pins and GND,
while u touch the panel at different places...

the voltage should reflect the horizontal position in that setting...

Thanks for the suggestions Riddick. I tried you last suggestion last night. I ended up switching my pins to X+, Y-, X-, Y+ based on this datasheet.

I wired everything up like so:
X+ to A2
Y- to A1
X- to A0
Y+ to A3

I used this code to get X:

pinMode( A1, INPUT );     // Analog pin 1
pinMode( A3, INPUT );     // Analog pin 3
pinMode( A0, OUTPUT );    // Analog pin 0
digitalWrite( A0, LOW );  // Use analog pin 0 as a GND connection
pinMode( A2, OUTPUT );    // Analog pin 2
digitalWrite( A2, HIGH ); // Use analog pin 2 as a +5V connection
xVal = analogRead( 1 );   // Read the X value

xVal gives me the horizontal position. I guess this is where I am getting confused. Are the numbers for X supposed to increase from right to left or left to right? It would also help to know what the values for X and Y are supposed to be with no touch. I've read it's supposed to be 1023, is that correct or is it supposed to be 0?

Ok I think I got it to work. I had to add a delay after port assignments, without it values were not consistent. Oh and I'm getting 1023 with no touch.

pinMode( A1, INPUT );     // Analog pin 1
pinMode( A3, INPUT );     // Analog pin 3
pinMode( A0, OUTPUT );    // Analog pin 0
digitalWrite( A0, LOW );  // Use analog pin 0 as a GND connection
pinMode( A2, OUTPUT );    // Analog pin 2
digitalWrite( A2, HIGH ); // Use analog pin 2 as a +5V connection
delay(2); 
xVal = analogRead( 1 );   // Read the X value

Can someone help me make sense of the values I am getting? Isn't the origin supposed to be in the lower left corner?

oh - i forgot this thread...

r u sure that digitalWrite(A0...) works?
i mean: the analog port has (or had) different pin numbers...
analog pin 0 (for analogRead) is digital pin 14 (for digitalRead/digitalWrite)...
http://arduino.cc/en/Reference/AnalogRead

did u try the ohm-meter idea, 2?
maybe it is easier to understand the behaviour of the panel...

i think when the panel is not touched, the readings might be inconsistent, because the sheets (voltage gradient sheet and sense sheet) r not connected... but maybe there is a high pull-up/pull-down resistor between both sheets? the ohm-meter should tell u that...

JRMN:
The resistance between pins 1 and 2 is 727 ohms and 217 ohms between pins 2 and 4.
...
using the resistance of 727 ohms between pins 1 and 3 of my touch control panel.

Those two pieces of information are not consistant with each other.

JRMN:
Oh and I'm getting 1023 with no touch.

With no touch, the analog input is essentially floating, so the value you get is not well-defined, unless the touchscreen has an internal pullup. You could add pullup/pulldown resistors between the analog pins and +5v or ground to get deterministic values.

JRMN:
Can someone help me make sense of the values I am getting? Isn't the origin supposed to be in the lower left corner?

Where it the origin currently? You can swap X+ with X-, and/or Y+ with Y- if the origin is in the wrong corner.

[EDIT: you might also have to make the analogRead call twice and discard the first reading to get consistent results.]