TFT touchscreen/LCD malfunctioning

Hi, I’ve run into a bit of an issue with the displays i’m using and since I don’t have much experience with electronics I would appreciate some help diagnosing this problem:

The gist of this project is using an Arduino Mega to operate a thermal box. I have included a picture of my setup, but basically I have a couple of temperature sensors (Platinum RTD Sensor - PT100 - 3 Wire 1 meter long : ID 3290 : $11.95 : Adafruit Industries, Unique & fun DIY electronics and kits) and a 12V ceramic heating element which is powered by an external 12V power supply through this MOSFET module (IRF520 MOSFET Driver Module). I also have a 3.4 TFT touchscreen (3.5 TFT 320x480 + Touchscreen Breakout Board w/MicroSD Socket [HXD8357D] : ID 2050 : $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits) and an LCD for a GUI. The idea is that when the start button is pressed, the program goes through a PID loop and powers the heating element to reach a predetermined set point. All that is working fine, but I have found that when the heating process starts, both my LCD and touchscreen start behaving erratically and displaying random characters, weird colors, and flickering on and off (I included some photos). When I switched the touchscreen over to being powered by the 12V supply via a buck converter it improved slightly but I am still getting weird behavior. The display still registers and responds to touch but will not display normally unless the arduino is reset. Any help on this matter would be much appreciated! :slight_smile:

LCD.pdf (223 KB)

touchscreen.pdf (667 KB)

wiring_setup.pdf (395 KB)

behaviorBoxMaster5_1.30.19.ino (45.6 KB)