ILI9341 TFT noise problem

I have a noise issue on my TFT display. I have some relays for switching 380V AC motors, and an ILI9341 display connected to an ATmega128 MCU. When a relay switches a motor, my TFT sometimes gets noise — occasionally the screen turns completely white.

I’ve added capacitors and even used a battery for the power supply, but it still gets noise.

On 2x16 displays, I add display.begin() in my program to reset the display every second, which helps — but on TFT displays, the reset process takes longer.

How can I fix this?

We can't see your circuit.
Do the relays have opto isolation, and are they actually wired for that.
Is the AC wiring properly separated from the Arduino wiring.
Are there snubber circuits on the relay contact side.
Leo..

Thanks for your response, but even when I completely disconnect the relays from the microcontroller and switch them on and off manually, the noise still affects the TFT in the same way through the air!
I don’t have physical access to the circuit right now, so I can’t take a photo of it. The circuit is inside an electrical panel that’s full of electromagnetic noise. The issue needs to be resolved through software similar to how calling lcd.begin() can help with character LCDs in noisy environments.

So it could be airborne or enter through the supply.
Did you twist or shield any longer wiring.
Sensors and/or switches might need a 100n ceramic cap from pin to ground, close to the MCU.
Leo..

Thanks it's better now :heart:

maybe you can solder the screen to the esp32.