This time, however, the last four columns of the LCD are in an "all dots on" mode, so that a little rectangle is shown. The LCD is set up using "lcd.begin(4, 20)", and, other than the last four columns, it works perfectly. Is this a partial failure of the display, or is some other mystery at work here?
Ah yes, this is a "2004" module, and it has five
epoxy "spots" on the back ("COB" - Chip On Board construction).
OK, one of these is the "master" corresponding to the left-most four columns, each of the others adds four columns. In a 1602 LCD, each serves eight columns, and this relates to the odd arrangement in memory of the alternate rows of the 2004.
Clearly there is a malfunction of the connections to the LCD concerning the "expander" chip serving the last four columns. If you are lucky - and it is in fact most likely to be a problem with the "Zebra strip
" which connects the PCB to the LCD - this can be corrected by judicious pressure on the bezel, possibly tightening it by bending the lug or lugs on the back. Failing that, it may be necessary (but tricky) to remove the bezel and re-seat the Zebra strips.
Alternately it could be failure of one of the interconnects to the fourth expander chip - not fixable unless you can identify (and repair) a fine scratch or etch fault on one of the PCB traces.
Afterthought: the fact that the last four columns initialise but do not display does suggest a failure of communication with the last expander chip.