Skip to content

False touch observed with no user input. Screens change randomly. #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atroph opened this issue Dec 5, 2022 · 3 comments
Closed

False touch observed with no user input. Screens change randomly. #159

atroph opened this issue Dec 5, 2022 · 3 comments

Comments

@atroph
Copy link

atroph commented Dec 5, 2022

------------------------ BUG REPORT -----------------------------------------

Expected behavior

The program will disregard any false touches and only register a touch when it meets a certain time threshold.

ex: The touch screen shall be touched continuously for 100ms in order for the touch to be registered as valid.

I have noticed that the IRQ line is exceptionally noisy and am wondering if there is some hardware filtering that is either missing, not working correctly, or this is normal behavior. This can be observed on the official kit by looking at the built-in LED on the uc module and noticing that it is continuously flashing at a very fast and dim rate. When the screen is touched the LED becomes brighter and is periodic in appearance until the touch is released.

Actual behavior

Actual touches register at a random value and only repeat at the interval set below at line 276.

Line 277 was added by me to trigger logic captures.

2022-12-05_11-20-44

It appears that a touch is registered when the IRQ line goes low for an amount of time that I can't seem to find in the code. If "noise" meets that threshold it'll show up as a false touch. Maybe a debounce timer needs to be tweaked? I'm more of a hardware person vs a software one.

500ms
Touch screen constantly pressed. IRQ line is periodic and touch is registered every 500ms.

2022-12-05_11-19-47

1000ms
Touch screen constantly pressed. IRQ line is periodic and touch is registered every 1000ms.

2022-12-05_11-18-55

False touch (notice the IRQ line at the top does not show a periodic waveform)
Touch screen not touched, IRQ line has a low point with a maximum period of 17us, touch is registered.

2022-12-05_11-26-40

2022-12-05_11-55-21

Weather Station Color version

Using the master branch, latest version (Feb commits?).
Tested with no changes made to the code with the exception of wifi settings and api key.
Tested with city code, time zone changed, wifi settings and api key.
Tested with "if (touchController.isTouched(500))"
Tested with "if (touchController.isTouched(1000))"

Hardware

Hardware is official kit and observed on two different kits brand new out of the box.

------------------------ END BUG REPORT -------------------------------------

@TiVoHomeUser
Copy link
Contributor

Not sure if this is what you are looking for.
The screen pressure for the touchController.touched() is in the library XPT2046_Touchscreen.cpp line 25
#define Z_THRESHOLD 400

@atroph
Copy link
Author

atroph commented Dec 5, 2022

Not sure if this is what you are looking for. The screen pressure for the touchController.touched() is in the library XPT2046_Touchscreen.cpp line 25 #define Z_THRESHOLD 400

That seems to have done it.

Changed the value to 800 for testing and the phantom touches have went away.

Captured about 30 mins of data without a single event.

Thanks!

2022-12-05_17-30-12

@marcelstoer
Copy link
Member

Thank you @TiVoHomeUser!

Looks like people are shifting this Z-value in both directions - depending on their displays I guess.

@atroph atroph closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants