Connect 1602a LCD to Arduino without potentiometer

Hello everyone,

Is there any good guide to connect lcd to Arduino without potentiometer. I found some on the internet. But the problem is that I have to also connect 7 push buttons to the Arduino. So after following guide(without potentiometer), only 4-5 digital pins are left.

So how can I attach remaining buttons to digital input..?

Or 0 and 1 pin can be used also as a digital input for buttons.

Is there any good guide to connect lcd to Arduino without potentiometer.

What is the potentiometer used for?

So after following guide

What guide?

So how can I attach remaining buttons to digital input..?

What remaining buttons? An LCD does not have buttons. It uses zippers.

So how can I attach remaining buttons to digital input..?

Don't forget that the A* pins can be used for digital input/output

ahsan64:
Is there any good guide to connect LCD to Arduino without potentiometer. I found some on the internet. But the problem is that I have to also connect 7 push buttons to the Arduino. So after following guide(without potentiometer), only 4-5 digital pins are left.

This is a very confused question, in no small part because it clearly conflates completely unrelated matters and is missing important details.

One minor point is - just what in particular is a "1602a LCD"? :astonished:

The potentiometer in most tutorials is wrongly shown connected with the ends to ground and Vcc and the wiper to pin 3 - the "Vo" or contrast control pin. This is a stupid blunder handed down from one bad design to another! It is also wrongly specified as a 10k value.

In fact, it should connect to pin 3 and ground only as a variable resistor, and its value should generally be 1k. Its value then is sufficiently approximate that if using a breadboard, you can simply try various single resistor values such as 220, 330, 470 or 680 Ohms, and it may work satisfactorily with pin 3 connected directly to ground. Pick whichever gives the best contrast and use that in your final design. Beware however that it depends on the actual value of your 5 V supply and may vary with wide temperature changes.

But it has nothing whatsoever to do with the usage of any Arduino pins. I do understand some misleading "instructables" will suggest you can or should use a PWM pin of the Arduino to control it. This is simply nonsensical as PWM does not produce an actual stable voltage and you find you need to set a very low PWM value in analogWrite; what you are actually doing is using the internal resistance of the output pin (about 50 Ohms) or the series resistor they tell you to use as the resistor I specified above which is a pretty much useless waste of a pin.

ahsan64:
Or 0 and 1 pin can be used also as a digital input for buttons.

A bad idea.

If you need more pins, use an I2C "backpack" soldered to the display and connect it to A4 and A5 (along with any other I2C device or expansion on the same two pins).

UKHeliBob:
Don't forget that the A* pins can be used for digital input/output

Not just "can be used"; they are digital input/output pins (except A6 and A7 on Nano/ Pro Mini). They happen to have analog input functionality as well but they are unashamedly and categorically digital pins.

A4 and A5 should however be reserved for I2C devices because I2C devices are just so useful. :grinning:

OK, I give up. What makes them

unashamedly and categorically digital pins.

rather than analogue pins that can be used as digital pins ?

The potentiometer in most tutorials is wrongly shown connected with the ends to ground and Vcc and the wiper to pin 3 - the "Vo" or contrast control pin. This is a stupid blunder handed down from one bad design to another! It is also wrongly specified as a 10k value.

I'm not disputing the truth of that, but I have dug out an old Hitachi data sheet and it suggests a pot of 10k to 20k wired exactly like that. It also suggest the same but with a NPN transistor and 2 resistors to provide temperature compensation.

I don't know how old the data sheet is, but I'm going to guess maybe 1995 or thereabouts, it's an old, not very good photo copy.

If a pot between Vcc and 0V with the wiper on pin 3 is wrong then it is a mistake that seems to have its origins in the manufacturers data sheet.

I have some difficulty finding that datasheet, but in essence I believe that was a test circuit.

It may have been just that - a test circuit that the original engineers used - simply because they had a 10k pot handy - and unthinkingly it was put into the early datasheet. The erroneous diagram does not appear in the more common one but figure 21 is more to the point although introducing some confusion with the -5 V supply for extended temperature range displays.

I harp on the point because the wrong connection makes contrast setting more difficult and wastes a small but significant (compared to the overall consumption) current.

UKHeliBob:
OK, I give up. What makes them

Paul__B:
unashamedly and categorically digital pins.

rather than analogue pins that can be used as digital pins ?

Because they are in fact - digital pins - that can be - used as analog pins.
It is only the Arduino board and IDE that refers to them as "analog".

Paul__B:
The potentiometer in most tutorials is wrongly shown connected with the ends to ground and Vcc and the wiper to pin 3 - the "Vo" or contrast control pin. This is a stupid blunder handed down from one bad design to another! It is also wrongly specified as a 10k value.

In fact, it should connect to pin 3 and ground only as a variable resistor, and its value should generally be 1k.

Seems not all have made the error you refer to.
This mob quoted " VE (Contrast V)....Decides the contrast level of display. Grounded to get maximum contrast."

Because they are in fact - digital pins - that can be - used as analog pins.

I suggest that it would be more correct to say that when used as inputs they can be used as either analogue or digital input pins. In the Arduino environment they default to being analogue inputs which has the side effect of making them usable as digital inputs if switched between GND and 5V. Even doing pinMode(aPin, INPUT) does not change them into purely digital inputs.

We should not forget that it is the Arduino environment that we are working in

bluejets:
This mob quoted " VE (Contrast V)....Decides the contrast level of display. Grounded to get maximum contrast."

Sadly, that is not helpful either! :astonished:

Nor is it even correct. By definition, maximum contrast means the maximum distinction between dark and light on the display. Grounding Vo gives maximum overall darkness of the character blocks (the surround always remains light) but as you approach it, the background of the character block also becomes dark, thus the contrast is reduced.

You do need to adjust it for optimum - readability - or so most people would suggest. :roll_eyes:

And that page cites a datasheet which in section 7 gives the wrong information (including bad potentiometer values - 20k) as well as the correct connection.

Paul__B:
In fact, it should connect to pin 3 and ground only as a variable resistor, and its value should generally be 1k.

I learn something almost every day on this site. That idea should simplify a current project using an LCD. Thanks!

I have some difficulty finding that datasheet, but in essence I believe that was a test circuit.

Hi Paul__B, see attached scan. I am sure this is at least 20 years old, it would not surprise me if it were 30 years old. Given that this is the suggestion in the manufacturers published data, then test or not, it's not surprising that's the way a lot of people wire them up.

Hitachi LCD controller0001.pdf (540 KB)

Yes, well, they redacted it but - too late! :astonished:

Also interesting is that is a datasheet for an early assembled module, not the HD44780 chip itself. That seems to be why it is so hard to locate. :grinning:

Think I'll just stick to how the majority do it then.
Seems too argumentative and nit picky to do it any other way.
I know now what to do in the future , thanks.

Also interesting is that is a datasheet for an early assembled module, not the HD44780 chip itself.

Hmmm.
The title of the data sheet is 'How to use Hitachi's built in controller driver LCD-ii (HD44780) liquid crystal character display'

I take that to mean it is about the chip not an assembled module. It's not strictly a data sheet either, it is instructions on how to use the module.

I also have a separate data sheet LM020L, which is about a complete module. It has the same circuit with a pot between 0V and +5V.

It's situations like this that encourage me not to throw old stuff away! I don't need paper copies of these old data sheets, but without them I would not have been able to share this.

Oh I never throw old stuff away.

Major domestic concern! :astonished:


PerryBebbington:
Hmmm.
The title of the data sheet is 'How to use Hitachi's built in controller driver LCD-ii (HD44780) liquid crystal character display'

I take that to mean it is about the chip not an assembled module. It's not strictly a data sheet either, it is instructions on how to use the module.

No, it tells you it is describing an assembled module. It is a LCD character display. The term "Vo" is pin 3 of the display module. It refers to one end (negative end) of the resistor ladder which is constructed on the display module. It is not a part of the HD44780 chip.