Go Down

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

Zarnick

Hello, I have a backlight enabled LCD that I'm using together with the PCF8574. The wiring and schematics is the same as found in this tutorial from Garagelab, the only difference is the 10k potentiometer that I simply change to a resistor.
As in the tutorial, I'm using the LiquidCrystal_I2C library found here. I've noticed that the library has some control for the backlight, however I'm not being able to use it (it changes nothing), am I missing some wiring? Or it may be another problem?
The function I'm talking about is the setBacklight(val), it changes nothing.
I do believe that the setContrast(val) wouldn't change anything as well, since I'm connecting the contrast pin directly on the GND with a resistor, however I haven't tested it.

Thanks for the help!

arduinomagbit


Hello, I have a backlight enabled LCD that I'm using together with the PCF8574. The wiring and schematics is the same as found in this tutorial from Garagelab, the only difference is the 10k potentiometer that I simply change to a resistor.
As in the tutorial, I'm using the LiquidCrystal_I2C library found here. I've noticed that the library has some control for the backlight, however I'm not being able to use it (it changes nothing), am I missing some wiring? Or it may be another problem?
The function I'm talking about is the setBacklight(val), it changes nothing.
I do believe that the setContrast(val) wouldn't change anything as well, since I'm connecting the contrast pin directly on the GND with a resistor, however I haven't tested it.

Thanks for the help!


I believe you need another pin to control backlight. you need to define this backlighPin. You also need to use a transistor connected to the pin, and the LCD (A, K)

Zarnick

Something like this?


If yes, how do I set up the Backlight pin on the PCF8574P? Or is it the 7th pin as default?

Thanks.

MAS3

#3
Aug 20, 2014, 09:04 pm Last Edit: Aug 20, 2014, 09:05 pm by MAS3 Reason: 1
You are connecting power lines direct to the back light, following that "do it this way and it will magically work" site.
(They are actually trying to invoke magic by mentioning it on this particular page).
Well, no magic there.
You are powering the back light LEDs, so it will light to the intensity set by the resistor you are using for this goal.
There is nothing controlling the LEDs from the PCF8574.
And there is nothing controlling the contrast either.
So your findings are correct.

Most likely controlling the contrast and back light will only work with noticeable difference between the values 0 or any other value.
That means any other value will turn it on (100 %), while value 0 will turn it off.

By the way, did you know a potentiometer consists of 2 resistors in the way it is applied here to control the contrast ?
It doesn't do what you seem to think it does the way you hacked it.

I take it that the display works but you are looking for away to control back light and contrast ?
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

Yes, the primary issue would be the backlight, the contrast I'm happy with the resistor solution, but it would also be nice to be able to play with it.
I did found one way by connecting a PWM Arduino Pin on the contrast, but this didn't worked for the backlight.
What I found odd, was that even if I remove the +5VCC and GND pins that should be for the backlight (pins 15 and 16), the backlight is still on!

arduinomagbit


Something like this?


If yes, how do I set up the Backlight pin on the PCF8574P? Or is it the 7th pin as default?

Thanks.


yes, you also need a resistor (1k) between pin 7 and the transistor. If you want to control the brightness, simply use PWM. make sure that pin can handle PWM.

MAS3

My datasheet seems to be incomplete.
Which pin is the PWM compatible PCF8574 pin ?
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

I don't believe anyone is. That's why I used the Arduino Pin for the contrast ;)

MAS3

@Zarnick:
i missed your answer to my first reply.
The Fritzing doodle shows PCF pin 7 to be in use for brightness control.
As stated before, you need the resistor in the base of the transistor, don't forget that.

If you do want to use that PCF for such functions, it should be able to do something alike, but the PWM would need to be a software solution for this, and be probably at a relatively quite low frequency.
Not a thing to use when starting with this matter i'd say.

You need to know exactly what pin the library you are using expects for brightness and contrast control.
Sometimes you can set this, also something that should be explained in the libraries documentation.
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 try that as soon as I get home!

Thanks for the help!

bperrybap

One thing you can do for brightness control is to have two brightness levels but no OFF.
In you schematic, you use a resistor to ground to set the dim brightness.
When you turn on P7 of the PCF8574,
which turns on the transistor, you will get the bright backlight.

Not PWM for full range of dimming, but it can give you two levels of brightness if you
don't ever need to turn off the backlight.

--- bill

Zarnick

Well, unfortunately, nothing I did actually worked! Even taking the pins 15 and 16 off (completely unwiring them on the protoboard) led me no were, the backlight was still on! I'm beginning to think they may be fixed on the pins 1 and 2, since I got this LCD screen already soldered, I mean, I should completely turn the backlight off if I simply got rid of the wires on pin 16 and 15 right?

bperrybap


Well, unfortunately, nothing I did actually worked! Even taking the pins 15 and 16 off (completely unwiring them on the protoboard) led me no were, the backlight was still on! I'm beginning to think they may be fixed on the pins 1 and 2, since I got this LCD screen already soldered, I mean, I should completely turn the backlight off if I simply got rid of the wires on pin 16 and 15 right?


If the backlight is on when you think pins 15 and 16 are not connected, then you probably are not properly identifying
the pins.

The Tutorial you linked to show pin 1 on the left (nearest to the PCB edge) and the pins increasing to the right (twards the center)
with pin 16 furthest from the edge where pin 1 is.

The schematic you showed in reply #2 is for a different pinout.
It shows pin 15 closest to the PCB edge followed by 16 then 1 and then increasing up to 14 towards the center.

From what I have seen, the pinout in the tutorial is much more common than the one you showed
in reply #2.

--- bill

Zarnick

I'm using the pins on the tutorial I showed, were the pins 15 and 16 are the farthest away from the PCB edge. The one I linked the image here was on another web-site, I just used since it was what I was looking for....even if it didn't helped. But I always used the pins from the tutorial, otherwise I wouldn't be able to actually use the LCD.

Zarnick

Just to be clear, here's the actual Fritzing sketch.

Go Up