I have a TFT 2.8" Capacitive Touchscreen connected to an Arduino MEGA along with 12 temperature sensors.
I use the display to change the set temperature of an aluminum bar that changes temperature. The sensors read the temperature.
However, it seems like the screen is interfering with the sensors. When I press the up/down arrows to change the temperature, I frequently get a voltage drop across my sensors.
I have no idea how to fix this, as I have tried many things.
Any thoughts or advice would be greatly appreciated.
TFT Capacitive Screen interfering with sensors
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- nclaire
- Posts: 12
- Joined: Sat Jan 29, 2022 3:15 pm
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: TFT Capacitive Screen interfering with sensors
How are the temperature sensor connected to your controller? Are you going through analog pins or using another type of sensor?
- nclaire
- Posts: 12
- Joined: Sat Jan 29, 2022 3:15 pm
Re: TFT Capacitive Screen interfering with sensors
There are 12 LM35 temperature sensors connected to analog A0-A11.
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: TFT Capacitive Screen interfering with sensors
Are you using opamps between your LM35s and the ADC pins? I find that critical to get stable readings with multiple devices on the ADC and other interactions with the controller.
https://www.adafruit.com/product/808
https://www.adafruit.com/product/808
- nclaire
- Posts: 12
- Joined: Sat Jan 29, 2022 3:15 pm
Re: TFT Capacitive Screen interfering with sensors
I am not. But what I have noticed is that the 5 V on my MCU drops by about 50 mV at the same time that I am seeing the drop in my sensors, corresponding to a similar 40-50 mV drop. I do not know why touching my screen sometimes causes this drop though.
Do you know anything about this?
Do you know anything about this?
- nclaire
- Posts: 12
- Joined: Sat Jan 29, 2022 3:15 pm
Re: TFT Capacitive Screen interfering with sensors
I have confirmed that it happens due to the touch. I unplugged the I2C pins from the screen to MCU, and when I touch the screen, nothing happens (as expected) and nothing changes on my sensors. When I plug the I2C pins back in and touch the screen, the sensor reading drops in voltage.
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: TFT Capacitive Screen interfering with sensors
Does the brightness change as well when you touch the screen?
What are you using for a power supply? How much current is being drawn normally versus when the display is touched?
What are you using for a power supply? How much current is being drawn normally versus when the display is touched?
- nclaire
- Posts: 12
- Joined: Sat Jan 29, 2022 3:15 pm
Re: TFT Capacitive Screen interfering with sensors
Thank you for your help. I believe I identified the issue. I had a line in my code that declared the x and y coordinate points as outputs after reading the touch. I had included this because I had experienced other issues in the past with the screen, and upon research, I found that this might help. It did not, but I guess I left it without realizing it was causing other problems. However, since removing that line of code, I have not seen the sensor problem. I have executed it about 20-30 times, so I feel confident I have resolved the problem.
Thank you again!
Thank you again!
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: TFT Capacitive Screen interfering with sensors
Thank you for summarizing the resolution. Good find.
Please be positive and constructive with your questions and comments.