Go Down

Topic: Backlight and I2C on LCD Display (Read 7385 times) previous topic - next topic

Zarnick

I did understood both that and my mistake, that's why I'm using a trimpot now. I'll fix it for the good contrast and that should be ok. I only meant that sometimes, you can hardwire this. I mean, I can't control the voltage the user is going to attach, but if I could, then I wouldn't need the voltage divider right? Or I'm still off the track here?

MAS3

You're still off.
If you want to use a fixed value, you should build something that does the same as that potentiometer.
And as said, that means you need to make the voltage divider by using at least 2 resistors.
You cannot do the same thing with a single resistor.

If you cannot control the voltage the user is going to attach, as you stated, then you should at least specify the voltage this is to be attached.
Should that user decide to do something completely different, then the consequences are theirs.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Zarnick

Ok, I'll study more on Voltage Dividers then ;).

bperrybap


Ok, I'll study more on Voltage Dividers then ;).

The issue isn't really about the voltage divider,
it is understanding the nature of the signal used by the Vo pin.
A voltage divider is  simply one easy way to create that signal.

--- bill

Zarnick

Let me see if I finally understood that then. I need to send a specific Voltage for the contrast to be correctly adjusted, the fact that if I simply put a resistor to GND there and that it works, is because the LCD in question already has this in it's board, but I really should be simply sending a new Voltage (around 5V), thus creating a complete circuit, instead of actually closing the circuit by attaching it to GND right?
And this is actually what a potentiometer does, so it would be wrong the believe that the potentiometer is a variable resistor, it is actually a variable voltage divider, is that correct?

Paul__B


If you want to use a fixed value, you should build something that does the same as that potentiometer.
And as said, that means you need to make the voltage divider by using at least 2 resistors.
You cannot do the same thing with a single resistor.

You are still "off"!   :smiley-eek:

There is actually no need to use two external resistors.  Since there is already an 11k resistor on the LCD board between Vo and Vcc and will be in every such LCD assembly,  you only need an external resistor - which may be variable or fixed if you have determined a suitable value - between Vo and ground.  You then have two resistors - one external and one internal - a voltage divider.

The fact that the datasheets - which are mostly copies of one another in case that is not blindingly obvious with the mistakes transferred from one to the next - show potentiometers, is simply that they are demonstrating an experimental or "demonstration" circuit, not a definitive way to make a final product.

It is OK to use a 10k potentiometer because it is simple and probably as cheap or cheaper than a 1k one; it is not OK to assert that is the only or optimal way to do it.

Zarnick

I see, so my previous reply would be correct?

Paul__B


I see, so my previous reply would be correct?

Yes.  Try a 1k potentiometer (or even a 10k, but it will only work near one end) from pin 3 to ground, that is ground one end, wiper to pin 3, when you get a good setting you could measure the value with your multimeter and select a fixed resistor value close to the measured value.

gilshultz

I never found the answer to the question so here goes! The LCD boards I have are using a PCF8574  which is connected to the LCD and is controlled with the I2C interface.  It also contains a jumper plug on the opposite side of the board from the I2C interface connector.  Try connecting a P-Channel BS-170 available from On-Semi or whatever you may have.  The drain and source leads connect in place of the plug.  Put a 10K resistor in series with the gate then connect it to a PWM output.  If you connect it in reverse the LED will remain on, because the internal substrate diode will conduct.  This should not damage anything assuming a 5 volt system.  Hint: use the tilde character to complement the PWM value you write, that will invert the logic which will again be inverted by the MOSFET.  If you do not 0 will be full on, 0xFF will be full off.

When the PWM output is LOW the MOSFET will turn on illuminating the backlight LED. If it does not work try reversing the Drain Source leads. I would start with an On-Semi BS170 P-Channel MOSFET or use whatever you may have.  For those that want to use a resistor just connect it in place of the plug.  The LED cathode on my parts is driven from the +5 supply and the anode is connected to the collector of a transistor on the board.  I have not had the time to actually try this but I see no reason it should not work. If the PWM source and the LCD do not have the same ground problems will ensure.  

6v6gt

I never found the answer to the question so here goes! The LCD boards I have are using a PCF8574  which is connected to the LCD and is controlled with the I2C interface.  It also contains a jumper plug on the opposite side of the board from the I2C interface connector.  Try connecting a P-Channel BS-170 available from On-Semi or whatever you may have.  The drain and source leads connect in place of the plug.  Put a 10K resistor in series with the gate then connect it to a PWM output.  If you connect it in reverse the LED will remain on, because the internal substrate diode will conduct.  This should not damage anything assuming a 5 volt system.  Hint: use the tilde character to complement the PWM value you write, that will invert the logic which will again be inverted by the MOSFET.  If you do not 0 will be full on, 0xFF will be full off.

When the PWM output is LOW the MOSFET will turn on illuminating the backlight LED. If it does not work try reversing the Drain Source leads. I would start with an On-Semi BS170 P-Channel MOSFET or use whatever you may have.  For those that want to use a resistor just connect it in place of the plug.  The LED cathode on my parts is driven from the +5 supply and the anode is connected to the collector of a transistor on the board.  I have not had the time to actually try this but I see no reason it should not work. If the PWM source and the LCD do not have the same ground problems will ensure. 
I've just noticed this.
(a) a picture (schematic) would be worth a 1000 words.
(b) whereas a P channel mosfet could be useful as a high side driver as here for powering the led backlight (since it [the led] is already indirectly grounded), the BS170 is not a well chosen example of such.

david_prentice

I am always amazed by variable backlight   questions.

In practice,  you might want off or on.   Possibly half-bright for night time.
You can do this with a single resistor and transistor switch.

You can probably achieve a good enough half-bright with 20mA i.e. with a 100R - 150R resistor switched over the 2 pin header.

David.

6v6gt

I am always amazed by variable backlight   questions.

In practice,  you might want off or on.   Possibly half-bright for night time.
You can do this with a single resistor and transistor switch.

You can probably achieve a good enough half-bright with 20mA i.e. with a 100R - 150R resistor switched over the 2 pin header.

David.
If you have to devote 1 pin of the MCU to control the intensity of the backlight (and of course 1 pin for the ambient light sensor) anyway, then it is only a matter of little extra coding effort to handle this using little more than analogWrite() on a PWM pin instead of digitalWrite() to change the brightness. Of course, you are correct that multiple levels of intensity are not really necessary, but in some cases, full brightness is too bright (the lcd also gets warm) so you would want at least the intensities "Day" (not Full), "Night" and "Off".
To do this nicely, it is better to spend some time on the programming logic to prevent noticeable flicker when the ambient light is on the border between 2 intensity levels. Here, I have developed something I'm quite happy with which applies large changes in the ambient light level immediately (say someone turning the room light off at night) but smaller changes are averaged and applied only every 5 to 10 seconds or so.

david_prentice

Some 16x2 modules are supplied with 0R series resistor mounted for the Backlight.
Other 16x2 modules have 22R series resistor mounted for the Backlight.  (or other suitable value)

The modules with 0R take a massive current.

So yes,  PWM is a good idea.   But a better idea is to mount an appropriate series resistor in the first place.

I can't help noticing your name.   You obviously must be a younger generation.   The 6V6G had a bigger glass envelope.

David.

6v6gt

. . .
I can't help noticing your name.   You obviously must be a younger generation.   The 6V6G had a bigger glass envelope.
. . .
Well, I feel there is still some life in me yet. This was a key part of my first electronics project, a 4Watt amplifier and took a huge part of my pocket money. "T" is for tiny !

david_prentice

From memory,   the GT had a cylindrical envelope.
The standard Octal base vaccuum tubes had a bulbous envelope.

Some Octal tubes had a metal envelope.    I am sure that I might have owned one.
I don't know how they were internally constructed.    Presumably there was a glass-metal pinch seal round the electrode pins.

I think the 6V6 was a Beam Tetrode.    Normally used in push-pull audio output stage.

Yes,   I know that I should check with Wikipedia before typing.

David.

Go Up