Replace potentiometer with resistor for LCD contrast

Hello everyone,

I have managed to set up the right contrast with my 25kOhm potentiometer for my 16x2 LCD.
How do I replace it with a normal resistor?

The resistance between the left and center pin is 21,8kOhms and the between the center and right pin 0 ohms.
(I get the good contrast when the potmeter is turned full clockwise.)

Now when I replace the potmeter with a 22kOhm resistor, then I can't see any text on the LCD.

I'm using the GDM1602A display from Xiamen Ocular.

What's the problem here?

There are 3 pins on your potentiometer and 2 on a resistor so i'm not sure what you mean by you replaced the potentiometer with a resistor.

The main objective here is to create the same voltage on the center pin (wiper) of the potentiometer. Measure the voltage on this pin with respect to ground. If it is 0V you can just remove the poteniometer and ground this connection. If it is +5V you can connect it to +5V through a 25k Ohm resistor. Otherwise you need to use 2 resistor to make a voltage divider.

JeffPB:
There are 3 pins on your potentiometer and 2 on a resistor so i'm not sure what you mean by you replaced the potentiometer with a resistor.

The main objective here is to create the same voltage on the center pin (wiper) of the potentiometer. Measure the voltage on this pin with respect to ground. If it is 0V you can just remove the poteniometer and ground this connection. If it is +5V you can connect it to +5V through a 25k Ohm resistor. Otherwise you need to use 2 resistor to make a voltage divider.

I mean that I want to replace the pot with a normal resistor that the same resistance gives as the pot, because I don't want to use a potmeter.

I even not see text when there is no resistor connected.

The pot is an adjustable voltage divider. Here is a what I mean:

V+ teminal----resistor----wiper terminal----resistor----GND terminal

Okay thank you, so I need to connect 2 resistors and which resistance?
And what is a wiper terminal?

Wanting is not the right word, needing is. If the circuit requires a potentiometer, you will NEED to provide one. Do you not want one because of any particular reasons or do you not like potentiometers? In this circuit, none of your answers to my question is relevant. You NEED one or connect the pin 3 to ground and have no control of the contrast (could look alright now but overtime your contrast shifts by itself until you can't read the screen).

The resistance between the left and center pin is 21,8kOhms and the between the center and right pin 0 ohms.
(I get the good contrast when the potmeter is turned full clockwise.)

If you get good contrast with the potentiometer turned all the way to the end then you are applying 0 volts to pin 3. Some LCDs work well in that configuration. All you have to do is remove the potentiometer completely and connect pin 3 to ground (usually pin 1).

Don

Beat me by nine seconds ... again.

1 Like

liudr:
Do you not want one because of any particular reasons or do you not like potentiometers?

Not any of that reasons.
Just because it would be stupid to place a potentiometer, if a single/two resistor(s) can do the same job, and I'm going to make a project with the LCD, and it needs to be as small as possible. A resistor would be much more compact and better for the project I'm making.

floresta:

The resistance between the left and center pin is 21,8kOhms and the between the center and right pin 0 ohms.
(I get the good contrast when the potmeter is turned full clockwise.)

If you get good contrast with the potentiometer turned all the way to the end then you are applying 0 volts to pin 3. Some LCDs work well in that configuration. All you have to do is remove the potentiometer completely and connect pin 3 to ground (usually pin 1).

Don

Beat me by nine seconds ... again.

That worked floresta! Thank you!

Following the requirement is not considered stupid at least this side of the pond. You may not understand what I said about long-term drift but sure, connect pin 3 to ground and try out your luck, why not? Since you are not a rule follower anyway? And NO one/two resistors CAN'T do the job of the potentiometer!

1 Like

liudr:
Following the requirement is not considered stupid at least this side of the pond. You may not understand what I said about long-term drift but sure, connect pin 3 to ground and try out your luck, why not? Since you are not a rule follower anyway? And NO one/two resistors CAN'T do the job of the potentiometer!

Indeed, I will try my luck with it. As you are reacting now, it seems that you are having a problem with that.
And you are able to take a conclusion that I'm not a rule follower, because I don't follow your orders? That tells more about you, then about me.
Have you ever heard of thinking out of the box?

Can this topic be closed, please?

TiboJ:

liudr:
Following the requirement is not considered stupid at least this side of the pond. You may not understand what I said about long-term drift but sure, connect pin 3 to ground and try out your luck, why not? Since you are not a rule follower anyway? And NO one/two resistors CAN'T do the job of the potentiometer!

Indeed, I will try my luck with it. As you are reacting now, it seems that you are having a problem with that.
And you are able to take a conclusion that I'm not a rule follower, because I don't follow your orders? That tells more about you, then about me.
Have you ever heard of thinking out of the box?

Can this topic be closed, please?

I never said I order you anything. If you intend to use a piece of electronics, read the manual, or shut up! It says use a potentiometer. You are not just not a rule follower and also not too polite to helpers. You want to close the thread it's your own will. Find the lock thread button and push it or you want to think out of the box about closing the thread too. I only help those that can accept at least a bit fact that all help seekers and providers are not perfect and deal with it. You are not one of those that I would help any more. There is a door and make friends with it.

1 Like

Tiboj,
Keep in mind that the voltage needed on the LCD Vo pin (pin 3) for a good contrast level
can vary depending on conditions such as supply voltage and temperature.

While it is perfectly acceptable to eliminate the potentiometer, in favor of a simpler fixed solution,
doing so may not always produce acceptable results should conditions change.

Another alternative would be to use a PWM pin on the Arduino to drive the Vo pin.
This would allow s/w control of the contrast level.
It does require running the PWM signal through a low pass filter
(can be as simple as a Resistor & Cap)
and some software so it isn't as simple as using a pot or a fixed solution.

--- bill

I never said I order you anything. If you intend to use a piece of electronics, read the manual, or shut up! It says use a potentiometer. You are not just not a rule follower and also not too polite to helpers. You want to close the thread it's your own will. Find the lock thread button and push it or you want to think out of the box about closing the thread too. I only help those that can accept at least a bit fact that all help seekers and providers are not perfect and deal with it. You are not one of those that I would help any more. There is a door and make friends with it.

There was nothing telling me to use a potentiometer, better, in the book I'm reading they mention to use a resistor
Not polite to helpers? You are not polite to people asking questions. I'm always thanking everyone that HELPS me, but not someone like you that has nothing better to do then flaming and pretending.
If this is your manner of helping, good luck with it.

bperrybap:
Tiboj,
Keep in mind that the voltage needed on the LCD Vo pin (pin 3) for a good contrast level
can vary depending on conditions such as supply voltage and temperature.

While it is perfectly acceptable to eliminate the potentiometer, in favor of a simpler fixed solution,
doing so may not always produce acceptable results should conditions change.

Another alternative would be to use a PWM pin on the Arduino to drive the Vo pin.
This would allow s/w control of the contrast level.
It does require running the PWM signal through a low pass filter
(can be as simple as a Resistor & Cap)
and some software so it isn't as simple as using a pot or a fixed solution.

--- bill

Thank you for the tip! I will keep this in mind. :wink:

In 99.9% of cases the variable resistor is set once an left alone... it is most often mounted where you can't access it... therefore two resistors will do the job perfectly...

A better option would be to use one of the analogue pins to provide the required voltage for the contrast...
You could then change the voltage with a couple of buttons (you circuit may have buttons you could multiples for this)...

I'll be adding this later to one of my designs and if I remember, I will post back the code...
Mike

MikeOToole:
In 99.9% of cases the variable resistor is set once an left alone... it is most often mounted where you can't access it... therefore two resistors will do the job perfectly...

Not for me.
I see the need to make adjustments depending on the power supply voltage which varies depending on whether
the device is powered from a USB port on my PC, a "USB" wall adapter, or batteries.

A better option would be to use one of the analogue pins to provide the required voltage for the contrast...
You could then change the voltage with a couple of buttons (you circuit may have buttons you could multiples for this)...

The AVR chips used on Arduino boards do not have any analog output pins and
so they cannot generate an analog voltage, all the outputs are digital, which is why I have always
disliked the name "analogWrite()" which does not create an analog output.
It is used to generate a variable duty cycle digital PWM signal.

Running the PWM signal directly into the Vo pin of the LCD to control the contrast
either won't work or won't work very well.
That is why I said above that you will need to use a low pass filter on the PWM signal
to convert it from a digital PWM signal to an analog voltage.

--- bill

Thanks for the information!

Not for me.
I see the need to make adjustments depending on the power supply voltage which varies depending on whether
the device is powered from a USB port on my PC, a "USB" wall adapter, or batteries.

I thought the Arduino was always outputting 5v out of the 5v pin? Does the voltage of that pin change depending on the power supply?

Does the voltage of that pin change depending on the power supply?

Yes.
If you look at the data sheet the output voltage of a pin is quoted as a fraction of the supply voltage.

Grumpy_Mike:

Does the voltage of that pin change depending on the power supply?

Yes.
If you look at the data sheet the output voltage of a pin is quoted as a fraction of the supply voltage.

Good that I know that, because I'm going to use an external 6v power supply soon.

You better not because 6 V is too much for the chip.

Ok, so if I connect only 3 battery's in my battery pack, then I have 4,5v(3x1,5v).
Will that be enough voltage to let the Arduino operate good?