Problem with LCD and leOS2

Hi guys, I’m working on a new project with Arduino Mega. And i have a problem, I’m using:

  • LCD 20x4
  • RTC DS1307
  • Shield SD Card
  • Keypad 4x4

I exsplain my project.
When I select the right code, Arduino turns on a relay and it starts a timer it using the library leOS2.
After when I press “D” on the keypad Arduino turns off the relay and saves the timer with the date in SD card.
Ok, this program works very well if I read the data with the Serial Monitor. But when I use LCD, it works well to some hours and after the LCD doesn’t work, it crashes and it doesn’t show anything.
Do you have any advices? I can’t understand what is the problem.
I attach my code.

Thanks :grinning:

project.ino (33 KB)

Sorry can you help me?