Hello again,
The A0 as contrast pin:
Yeah you must be right about the A0 pin, I just remember that I made it work before, but I must have used one of the PWM pins. Sorry about my stubbornness earlier.
Schematic
I have been a bit constrained on time so I did a quick schematic of the entire PCB, I hope you can read it even though it is not as neat as the previous one. The bar in the bottom is screw terminals by the way.I hope this helps you to understand what I am trying to do.
Voltage measurements:
I agree with you that the fact that I had to use that extra wire is concerning. I have taken my PCB with me to work and put an oscilloscope on the 5V to the LCD to see if it was dropping or if I could see anything happening when it stops functioning correctly but the voltage is rock-steady. I have a taken a picture of the oscilloscope here (it is measured at the entry point to the LCD compared to GND). I have turned down the volts per division so much that 0V is outside the screen and the oscilloscope also registered the max and min voltage which was between 5.10V and 5.12V when running the sketch that shows the timer in the display (which by the way still works flawlessly) and 5.10V and 5.14V when running the sketch that makes it act up.
Current measurements
I have used a lab power supply set to 12V and applied that to run the system, and the total current draw is 0.04A at 12V for the whole PCB when it is working correctly and the exact same with the sketch that does not work
I am downloading the sketch to the nano using only the USB cable and with the power cable not attached.
The reason why I do not use the voltage regulator on the arduino it self is, as you also suggest, because I need the 12V for the pump I am using so to have just one power input I decided to regulate it externally and just feed the arduino the 5V from the LM7805.
I hope this can help you to get an idea about the application here.
But what about the sketch that actually works?
What I find really weird is that it works great (even with no delays in the sketch) when I print the timer, but as soon as I want to print text, nothing works.