LiquidCrystal lcd using fewer digital pins?

Hi guys,
The LCD LiquidCrystal displays take a stupid amount of digital pins(6*), how do I get around this as I will not have enough pins for it to work with the rest of my project.

Many thanks.

You can get one that use the SPI bus. I was going through my box of old stuff the other day and found a parrelex serial lcd that only takes one pin.

Assuming you are using a character display like 16x2 or 20x4, use an I2C display. This uses two pins and can share with other I2C devices, like an RTC, and is commonly available. I believe you can get an I2C adapter for use on the LCD you have.

Thank you both, I will have a look into it. I'm just glad it is an issue and it's not me being stupid lol :slight_smile:

Going with the I2C is the easiest way as you can add this feature to any standard lcd display which uses the HD44780 chip. You need to buy an extra I2C device (pretty cheap) and solder it to your lcd.

Your Arduino - assuming it is an UNO or compatible - comes with two dedicated I2C pins (A4, A5).
You will need a special library and I recommend to read the following Wiki, which will explain how to set everything up and what different I2C adapters are available and what you have to consider setting them up.

When you install the recommended I2C library of F. Malpartida, make sure you delete the existing lcd library first, which was installed with the IDE.

oops

What kind of display do you have that uses 6 pins? And are you counting the power/ground pins in that count?
The 1602 uses like 11 pins (not counting power/ground), but they do have I2C add-ons you can solder onto the back and they even have built in pots for contrast control.

So, to suggest relevant solutions, it'd be helpful to know what exactly you're working with since all of the solutions here may not apply since it seems to definitely not be what people are assuming it is.

Just being thorough, as for all we know you're already running an SPI setup with its 4 pins and you're counting 6 because of power/ground.

hunterzzpro:
how do I get around this as I will not have enough pins for it to work with the rest of my project.

Did you also use up all the analogue pins.
They are just digital pins with the added functionality of analog-in.
Leo..

Hi guys,

To answer INTP: The LCD uses 6 pins digital pins :slight_smile:

To answer rpt007: It is an uno board, I will 100% look into I2C cheers.

To answer wawa: ahh, that is an option for these LCD displays?

Thanks everyone

You can use any pin arrangement, and is common practice. You just have to change the Liquid crystal(a,b,c,d,e,f) command and follow the same order of wiring. It is the order that is important, not the pins.

Hm, looks like I'm using more pins than necessary. Guess I followed the wrong tutorial when I first tried the 1602. I have all RS, RW, E, D0 - D7 going to the board's digital pins, and the accompanying
LiquidCrystal lcd(12,11,10,9,8,7,6,5,4,3,2);
Works as it should, but not optimal, since stuff I'm finding now is saying RW and D0-D3 aren't needed.

Much to learn, I have.

LiquidCrystal lcd(12,11,10,9,8,7,6,5,4,3,2); Sounds like nonsense, or its a library for an alien chip that simply has the same name as that which everybody else uses. It may work with the standard display because you have wired it correctly to pins 12>7 and the other calls are meaningless, and thus ignored.

This command usually calls only six pins

https://www.arduino.cc/en/Reference/LiquidCrystalConstructor

Guess I had it setup to run using all 8 data, which I guess is imperceptibly faster
And the RW is for reading, which I didn't understand or need yet.

I'm afraid I can't comment, I have never seen any code calling for more than six pins before. I note your word "imperceptibly"

INTP:
What kind of display do you have that uses 6 pins? And are you counting the power/ground pins in that count?
The 1602 uses like 11 pins (not counting power/ground), but they do have I2C add-ons you can solder onto the back and they even have built in pots for contrast control.

"The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins"

Look at my YouTube video "#23 LCD Big Digits" and ignore all the stuff about Big Digits (although it could be useful!) and just see how I connect it using I2C. Two wires, so two pins + power. Simples.

URL in the footer of this post. Enjoy!