LCD turns off after x amount of time

Hi all!

ok, so my setup is...

I have a seeed relay shield, an seeed ethernet shield and an arduino mega, displaying on a backlit lcd 20x4 panel.

After a certain amount of time the lcd backlight is on but the text disappears. I also have this hooked to a dht11 temp/humidity sensor which reports data to google spreadsheets. The thing keeps reporting so I know it is working but the lcd goes blank. any ideas?

This seems to be a common problem when using the LiquidCrystal library with 20x4 displays in the 4-bit mode.

It seems that the library can’t handle displays that are most likely out-of-spec and running at a slower than expected speed.

To verify if this is the problem you could switch to an 8-bit interface and see if it works more reliably. Don’t forget to modify the constructor to match your new interface.

LiquidCrystal lcd(RS, E, D0, D1, D2, D3, D4, D5, D6, D7);

Don

Don, thanks for replying. I am investigating changing it to an 8 pin config vs 4 now.

One other data point that I just noticed and wanted to present was that this happens only when I have a 3rd outlet on my relay changing states.

Normally I have 2 relays changing output electricity, one that changes when the temp gets too high and one that changes when the humidity gets too low. As soon as I added a third (my relay shield has room for 4) then this issue happens. I looked at this site: Arduino Shield List: Seeed Studio Relay Shield and changed my code to accommodate the shield using the normal pins for the lcd to:

LiquidCrystal lcd(42, 40, 38, 36, 34, 32);

Is it still the 8 pin/4 pin issue or am I missing something?

Is it still the 8 pin/4 pin issue or am I missing something?

It's probably more than the 8 pin/4 pin issue since you mention relays.

This too has been a common problem and the solution frequently involves one or more capacitors across the LCD power pins.

Don

Any thoughts on where I should connect a capacitor?