Why do I have to open Serial Monitor to display non nan values ?

Hi.

I have no idea what 'nan' is.
I do not see any serial communication in your sketch.
But opening the serial monitor, causes a reset.
Perhaps your screen needs some extra time to reset after power on.
So try to have a larger delay() in line 18, and if that doesn't help, put in some extra delays in other lines, just to test.