Touch screen coordinates vary with pressure (XPT2046) - Page 1
Forum section: electronics / projects

author: David_AVD
author_rank: Super Contributor
timestamp: August 25, 2014, 10:41:23 pm
content: I'm using a 7" (800 x 480 pixel) TFT panel with touch overlay in landscape orientation. It comes attached to a PCB with the SSD1963 display and XPT2046 touch controllers.What I've noticed is that the X/Y coordinates can vary depending on how hard you press the screen. This means button presses are sometimes registered incorrectly.If I press firmly the coordinates are correct. If I press lightly the X is off to the right, sometimes by a significant amount. The Y doesn't seem to suffer as much variation.The error amount may vary slightly between different screen samples. My touch code is written in C (for an Xmega) and largely based on the uTouch library.One thought was to measure the Y (pressure) and ignore presses that are too light, but I haven't managed to get that working yet.Does anyone here have any experience with this setup and have you noticed the same issues?

author: Skimask
author_rank: Super Contributor
timestamp: August 25, 2014, 10:50:59 pm
content: Pressure is documented in the datasheet, however I didn't notice the variation of the sensed X/Y with pressure. I'd be willing to bet it's more a matter of your finger not being perfectly round rather than a software/hardware error.

author: David_AVD
author_rank: Super Contributor
timestamp: August 25, 2014, 10:54:19 pm
content: The amount of X error can 100 - 250 pixels relative to the touch location, so it's not like it's a small variance with finger pad size.

author: bktemp
author_rank: Super Contributor
timestamp: August 26, 2014, 04:56:46 am
content: When the contact resistance of the touch matters, then some current is flowing thrue the sensed wire. In most cases the time between applying the drive voltage to the screen an reading the voltage is too short. A 7" Touchscreen is quite large, so it has a high capacity. Try to add some delay before sampling the voltage.

author: Skimask
author_rank: Super Contributor
timestamp: August 26, 2014, 06:44:26 am
content: And just noticed you said 7" screen. All the ones I've played with are the 4.3" or 5" screens. Got two 7" screens but haven't played with them yet.

author: David_AVD
author_rank: Super Contributor
timestamp: August 26, 2014, 07:21:35 am
content: I had tried delays in various places to no avail. I did get the Z (pressure) reading working so am discarding presses that are light enough to cause the erroneous X readings.This seems to have solved the incorrect button issue at the expense of the interface not being quite as nice to use (heavier touch required).

author: cebrax
author_rank: Contributor
timestamp: March 17, 2016, 10:28:40 am
content: I have different readings with different SCLK frequencies with also a 7" display, did you try lowering your frequency?

author: David_AVD
author_rank: Super Contributor
timestamp: March 17, 2016, 08:56:08 pm
content: No I didn't.

author: prasimix
author_rank: Unknown
timestamp: March 18, 2016, 03:41:38 pm
content: Quote from: David_AVD on August 25, 2014, 10:41:23 pmYes, I did. There is simple cure, start to tweak heavily utouch or simple forget it, and make everything from scratch.Hereyou can see improvements.