using a touch screen from a phone

alright gang can it be done, i have my doubts that its possible, has anyone tried it? and are there any alternatives?

yes it can be done:
it's probably a 4-wire resistive touch screen.

I would check out the TSC2004 from Texus Instrument: it uses TWI interface so you should be able to use the arduino TWI library.

Touchscreen chips usually come surface mount so you'll need to get some breakout boards from sparkfun.

Read this pdf:
http://www.circuitcellar.com/library/print/0100/dahlin-114/dahlin114.pdf

it'll have most of the info. you need to get started.

jimmeh,

nima's link is a good one - however, you may be able to drive the touch screen from the Arduino itself.

It'll take 4 pins - 2 digital outs and 2 analog ins.

Simply, you apply 0V and 5V to one axis and read a touch value from the other. Then do the other axis.

I did this with a PIC a few years back.

Regards,

Mike

cheers for the replies, this is basically what i had in mind, i thought it would be as simple as plugging it in would it be able to handle the 5volts?

http://cgi.ebay.co.uk/LCD-TOUCHSCREEN-LENS-FOR-SONY-ERICSSON-W950i-M600i-W950_W0QQitemZ250223172732QQihZ015QQcategoryZ68024QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

It looks like it would be an analogue resistive type of touch screen - there appear to be 4 connections and two of them lead to lines that go up each side. I guess the others lead to lines across the top.

They will handle 5V without trouble.

Here is a wikipedia article for a quick intro on how they work:

and this one gives more info:

It would be worth reading through the spec sheet of the chip nima mentioned to find out how they do it - then implement it in code in the Arduino (or just use the chip).

They seem to be reasonably priced in that auction. FWIW, I have purchased from that seller recently without problem :slight_smile:

Regards,

Mike

I've used Wasp's touch screen in the past - here is a nice page about them:

http://waspswitches.co.uk/english/touchscreens_4wire.shtml

got it working! after some very fiddly soldering! cheers gang, i just plugged it straight into the arduino, works pretty well.

I just realized that i have an old defect PDA (Compaq Ipaq) lyíng around. I couldn't resist it when i saw it in the electronics dumpster at the local recycling station a few month back. Lo and behold a nice big 4 wire touchscreen on top of the display.

So let me se if i get this right. i apply 5V and ground to two of the 4 wires and the others are hooked up to analog inputs on the Arduino board an treated just like any other variable resistor ? each giving me a number for the X and Y position on the screen ?

Is there a standard for the 4 wires, can i somehow meassure which is which ?

Is it really that easy ? (except for what looks lige a nightmarish soldering session)

really is that easy!

Super, that opens up for a series of new projects to pile on top of the others :slight_smile:

So let me se if i get this right. i apply 5V and ground to two of the 4 wires and the others are hooked up to analog inputs on the Arduino board an treated just like any other variable resistor ? each giving me a number for the X and Y position on the screen ?

You have to apply the 5V across one pair then read the analogue value from one of the wires in the other pair, then apply the 5V to the other pair and read the analogue voltage from one of the wires in the first pair.

It is that easy, though in a commercial environment you would have to calibrate the x and y values so top left and bottom right etc are accurate, also to prevent build up from electrolysis you would reverse the voltage on the pairs, you would debounce the touches, you would have a sleep mode with touch detection, some filtering of the values is desireable and if you are using it as an input device to replace a mouse, you need to be able to detect a "click".

None of this is necessary in simple applications, though.

Regards,

Mike

got it working! after some very fiddly soldering! cheers gang, i just plugged it straight into the arduino, works pretty well.

That's good news, Jim. I was so tempted to get one of those screens, but I have enough projects in line for these Arduinos as it is.

Do you have a project in mind for it?

Mike

Could you post your code Jimmeh ?

Thanx

its all delt with in max, just like a potentiometer have it coming into the serial. im basically going to make a kaoss pad, im also getting trying to get this encoder working with it so i can select what changes.

But you do have Arduino read the touch screen right, i don't quite understand how to read the pair. Are they hooked up like two pots constantly ? like one pot and then anoter pot ? i hope this question makes sense.

A little drawing and a few lines of the Arduino code actually doing the analog read would be greatly apreciated.

Thanx

5v --
gnd -- touch screen
analog 1 --
analog 2 --

i have max dealing with all the calculations it just reads analog 1 and 2 ins from the arduino

Thanks, i will gie it a try one of these days.

Sorry to sound like a complete idiot. But i don't really get it.

My touch screen have 4 wires,

1 going up the left side
2 along the bottom
3 going up the right side
4 along the top

I can understand that i put 5v Across one of the pairs (1 and 3 or 2 and 4)of they act like the two outside pins on a pot and when i pres the screen one of the wires in the other layer becomes the wiper and i can read one of the coordinates from that.

But how do i read the other coordinate without changing the way it is hooked up to the Arduino pins ?

I seems to me that i would have to put 5v across the other two wires, how do i physically do that with out changing
the way it is hoohed up to the Arduino pins ?

Jimmeh are your 4 wires configured like i describe above ?

Thanks

I can understand that i put 5v Across one of the pairs (1 and 3 or 2 and 4)of they act like the two outside pins on a pot and when i pres the screen one of the wires in the other layer becomes the wiper and i can read one of the coordinates from that.

But how do i read the other coordinate without changing the way it is hooked up to the Arduino pins ?

You energize one pair using output pins from the arduino, not a 5V supply. Then you set those two port pins to inputs and power the other pair from other output pins.

Does that make sense?

Mike

I kind of understand it :slight_smile:

But doesen't that require that i hook up the pairs of wires to both digital (out) pins for powering and Analog pins for reading ?