This is my first post on the Arduino forums, but I've been consistently designing Arduino-based projects for hobbyist and academic use for about 1.5 years now.
-- The Problem --
Anyway, I've recently started a wireless thermostat project that I've gotten completely debugged, save for one major, persistent problem with my 16x2 LCD screen. Namely, the LCD display I have mounted in my casing shuts on/off randomly when separately drawing current through a relay switch to a motor, or suddenly changing this current through a resistive load like a lightbulb. This is frustrating to troubleshoot because of the electrical isolation that should be afforded by the relay.
-- Details --
When the relay is actuated, and I plug a pencil sharpener into the plug, the LCD shuts on and off randomly when I draw a current on the motor. Every time I insert a pencil and draw current, the LCD can toggle on or off. Sometimes, I can barely make out the text that is still being displayed as it just dims. After enough tries, the LCD becomes unresponsive and displays nothing or empty characters.
The LCD goes back to normal when I unplug and replug my setup, or simply reset the Arduino.
Even when the LCD fritz's out, everything else on the Arduino runs perfectly. It continues to read in temp data from my transmitter, and executes code and drives the relay in the exact same manner. It's just that the LCD screen turns on/off.
The main thing that's puzzling me is why the load on the receptacle has any effect whatsoever on the LCD. The main purpose of the relay is to electrically isolate the two systems. I'm guessing it's EMI if anything.
-- Personal Thoughts --
The most likely culprit that I can imagine is possibly the current that is being induced on the LCD pins by the AC current i.e. electromagnetic interference caused from the spark made at the relay contacts whenever the relay is actuated. However, why this is fritzing up the display itself and not randomly causing garbage characters, or interfering with the Arduino is a mystery to me.
This problem also occurs after I've used the receptacle to power a device (leaving some residual charge in the relay, perhaps), I reset the arduino, disabling (or disactuating) the relay, and I unplug the device. When I replug the device into the receptacle, the LCD fritzes again.
The problem doesn't occur as readily when flicking a light on and off
I've highlighted the problem in a video I've attached, as well as uploaded my main schematic, a picture of my setup, and the sketch driving my receiver.
Let me know if any of you have any ideas, or need more info. I'll take any help I can get at this point.