Can a 4x20 LCD replace a 2x16 LCD on a keypad shield? (Solved + update)

Hi
I have an Arduino UNO clone (Duinotech sold by Jaycar, Australia) with a similarly branded keypad shield with 2x16 LCD display. The project is for monitoring input / output voltages and currents of power conversion systems and calculating conversion efficiencies over a range of conditions.

This is my first ever Arduino project (in fact first ever micro project involving programming), but I have all hardware and software working OK.

The problem is, I want to display more groups of numbers than can easily fit on the 2X16 display. I do have a spare keypad board with a crook display (I broke it) and am wondering if I can replace the display board with a 4x20 device. This would give me enough display area. As far as I can see and from info found, the pin-outs and operating modes are identical.

Can someone confirm this? Is there a particular brand / type I need to get to ensure compatibility? What needs to change in the code - lcd.begin(16,2) to lcd.begin(20,4)??????

I do want to keep the keypad shield as I use the push-buttons and the whole software / hardware set-up is built around it. I don't want to restart the project to cater for a different display / push-button interface unless there is no alternative.

My apologies if this has been covered before, but looked through quite a few of the 500 odd pages without finding it. Not much specific info from a general web search.

Thanks
Duck51

Duck51:
. . .

Can someone confirm this? Is there a particular brand / type I need to get to ensure compatibility? What needs to change in the code - lcd.begin(16,2) to lcd.begin(20,4)??????
. . .

Thanks
Duck51

Yes, no, yes.

You should be able to swap your 16x2 display for a 20x4 device since the interface is indeed identical. You may have to tinker with the backlight current limiting resistor and/or with the contrast adjustment.

If you do not change lcd.begin() your program should work just as it did before.

After you confirm that part you can change lcd.begin() as you stated and utilize the expanded display area.

Don

The 2004 display is physically larger. Will it fit on the keypad shield?

Hi
Thanks for the replies. Yes I know the 4x20 is larger, but it is only a single row of connections, so I will just be a bit creative with length of connectors and mounting angle / position. It just needs to be functional, not pretty.

Duck51

Basically make sure RS (pin4), EN (pin 6), D4 (pin 11), D5 (pin12), D6 (pin 13) and D7 (pin 14) from the LCD2004 go to the appropriate connections on the shield. Pins 1 and 16 on the LCD2004 are ground, pin 2 is 5v and pin 4 controls backlight brightness. Depending on the 2004 you have this pinouts may vary, double check any paperwork that came with it.

crunchysteve:
Basically make sure RS (pin4), EN (pin 6), D4 (pin 11), D5 (pin12), D6 (pin 13) and D7 (pin 14) from the LCD2004 go to the appropriate connections on the shield. Pins 1 and 16 on the LCD2004 are ground, pin 2 is 5v and pin 4 controls backlight brightness. Depending on the 2004 you have this pinouts may vary, double check any paperwork that came with it.

I'm not sure what the first sentence has to add other than the erroneous information about pin 4 (the second mention), but the second sentence could be important.

A very few LCD modules have a pinout that varies from the standard.

In general if the pins are above and to the left of the display you should be OK. Those devices have pin 1 near the pc board edge and the numbers increase sequentially toward the center.

If the pins are below and to the left then you have to be careful. The pin numbers typically have the normal meanings, but their locations may vary.

Don

Hi
Once again gentlemen, thanks for the replies. The display I have ordered has identical pin-outs to my old 16x2 unit, with connector pad in the top left, so should be no issues there. The old display has 100 ohm current limiting to the backlight LED, will have to check what the new display has. There is no limiting on the key pad shield mother board - just the fully on transistor or FET switch.

Another trap seems to be some 4x20 displays for 3.3V only - saw at least one in my search.

Have successfully removed the old display from the mother board with no damage to either - (not always guaranteed with plated holes, even with the right equipment), so am ready to go.

As I live in South Australia have had to order new display from interstate - should have it in a week if courier has heard of South Australia and can find it. (supplies of serious electronic components in SA is pathetic - we don't have an RS or Element 14 or many, if any of the Ebay traders)

When I get it going will post result and photos of how I mounted it.

Regards
Rob

Duck51:
As I live in South Australia have had to order new display from interstate - should have it in a week if courier has heard of South Australia and can find it. (supplies of serious electronic components in SA is pathetic - we don't have an RS or Element 14 or many, if any of the eBay traders)

On the other hand, when ordering - as I mostly do - from the Chinese eBay traders, I rather doubt that you would be delayed any more than we are in (country) NSW.

Jaycar is very good - took over from DSE well before they dissolved.

I am actually in slightly country SA, which is not good for any sort of speedy delivery.

Yes - do have a local Jaycar, and they have a good range of Arduino items, and other useful stuff, but I also do switch mode power supplies using Analog devices / Linear tech chips and surface mount components, none of which they have.
RS / Element 14 ship in less than 24 hours but at a cost. Standard post from Ebayers usually exceeds the worst time estimates, express post sometimes gains little, considering the cost.
I have had courier deliveries reach Adelaide quickly, and then sit in a depot for several days until they have a worthwhile load for my location.

Unfortunately SA is too small a market to attract many suppliers of any specialized items.

Anyhow, I have had my spit now.

Regards
Rob

Hi
The ebayers must have read my gripe. New 4x20 display ordered Sunday night, delivered (express post)Tuesday morning. Best ever delivery speed from Ebay.
Fitted display to keypad mother board and it works perfectly. Have not altered code yet, so everything is still compressed into the first 2 lines, but the overflow (17th character) on the 2nd line can now be seen.
Would not have taken a chance on this without the help from the forum - thanks again to everyone who replied.
Photos of result attached (I hope)

Regards
Rob

WP_20190326_21_13_35_Pro.jpg

Have now verified full functionality of 20x4 display as a replacement for a 16x2 on a keypad shield.
Physically to make it fit it needs long leads and needs to almost stand up on its lower edge.
Pin-outs of the 16 pin header are identical.
The same 100 ohm current limit is fitted to the back-light LED, so nothing nasty there.
The contrast preset works as before.
By changing lcdbegin(16,2) to lcdbegin(20,4) all 4 lines are usable and it will obey all set cursor commands in the new range.
See photo.

Regards
Rob

The contrast preset works as before...

... and it doesn't look as if it is correctly set either then or now.

Try cranking it down a bit (higher voltage on pin 3). You shouldn't see much (or any) trace of the 'boxes'. The blank spaces are supposed to look like the background.

Don