Switching a load scrambles LCD

This seems like a decoupling issue. I have standalone 328 controlling two relays which switch a 120 volt 5va load. I have .1 uF ceramics between VCC and ground, AVCC and ground, and another one directly on the LCD display (1602) itself. I also have a 470 uF electrolytic on the 5V rail next to the 328 and 100 uF electrolytic on the LCD. I am using a 4001 diode across each relay coils. Without a load connected to the relays, it ran overnight without issue (+10 Hours). With a load, the LCD scrambles within a few switching cycles, but the sketch continues to run normally. What is at play here that I am missing?

Still having this issue, any suggestions? I wonder if using an I2c backpack might help...

Still having this issue, any suggestions? I wonder if using an I2c backpack might help...

You haven't described the placement of your LCD with respect to your standalone processor but if the wires are picking up interference, and it sounds as if they are, then a serial interface will probably help.

Also, you have described how you tried to deal with transients caused by the relay, but what about those possibly generated by the load itself?

Don

placement of your LCD with respect to your standalone processor

yea this probably part of the problem. Everything(12v power supply, mcu, lcd, outlets) is carefully stuffed into a two gang electrical box. In hindsight , probably not ideal.

what about those possibly generated by the load itself?

great point, but am unsure of how I would go about doing this. I just assumed that my 12v power supply was built well enough that it could handle reasonable fluctuations on its supply. On the other hand, it cost $2.50 off of ebay: http://www.ebay.com/itm/260990909977?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649. What techniques or approaches should I consider on this end.

shortening the leads between the LCD and mcu as well as wrapping them in foil and braided cable seems to have done the trick. two days and no problems