I am using a Mega with an LCD shield to drive 2 relays to turn a variable frequency drive on and off. If I run the code just driving the relays, the relays work fine, and the LCD displays correctly. If I connect the CFD to the relays, it starts and stops correctly (relays working fine), but the LCD panel get corrupted in 1 of several ways; e.g. the first line is corrupted with all of the same non alphabetic character, or wht should be displayed on line 2 is overwritten on line 1. I have tested that there is no direct electrical connection between the input of the relay and the relay switch, so the VFD appears to be electically isolated from the Arduino.
Does anyone have any ideas?