Pages: [1] 2   Go Down
Author Topic: HD44780 LCD Backlight control with PWM  (Read 12365 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I just hooked pin 15 of my JHD 162A (Chinese datasheet) to a PWM output on the Arduino (pin 3) to be able to set and change the brightness of the backlight.

It works well, even if the maximum light level obtained when analogWrite(3,255) is less than when it was hooked directly to +5 (which doesn't matter to me).

The question is, won't it damage the Arduino or the LCD in the long run ? Is there a safest way to do the connection (I'm no EE, so don't be shy to include details in your answer) ? Shouldn't I at least put a resistor between the two (which value) ?
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 74
Posts: 7260
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I think you should stop immediately and add a resistor (maybe 150 Ohm) between Arduino pin and back light. Running without a resistor will eventually damage either the arduino pin or the back light, whichever is weaker.

The diagram is showing a resistor between LED+ and VCC.
Logged


Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a link for similar info.
http://arduino.cc/forum/index.php?topic=53634.0

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4395
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have two observations.

(1) The 14-pin HD44780 LCD interface and the 2-pin Backlight are two completely (electrically) unrelated systems.  The HD44780 was around at for least a decade before LED backlights became popular.  There were some devices with electroluminescent backlights that required something in the neighborhood of 100 v to operate, but they were not common either.

Even with the incorrect title most people understand what you mean, I just don't think the misconception about a '16-pin interface' as used in some of the Arduino documentation should be encouraged.


(2) There are no standards concerning the LED backlights.  They have varying numbers of LEDs in varying series and/or parallel combinations.  Some implementations require an external series resistor and others do not since they have the required resistance already on the board.

A series resistance will never hurt anything and it is a essential to use one if you are not sure about your backlight configuration.  Since there are frequently several parallel strings of LEDs you may need a much smaller value than 150 ohms.


Don
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a transistor due to the amount of current the backlight requires and a maximum of 40mA should be drawn from any one arduino pin.

Backlights are normally 5V on displays where the data is 5V.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4395
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Backlights are normally 5V on displays where the data is 5V.
Except when they require 4.2 volts - as his does.

Don
« Last Edit: March 14, 2011, 09:44:44 am by floresta » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 74
Posts: 7260
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't like this particular back light for Arduino projects. To regulate its brightness finely, you need very small resistors and there's not a lot of choices among standard resistance values within that range.

Yeah, 150 Ohm is overkill, but it may be enough to help the user see the text in complete darkness, which is much less bright than what most people want, having back light visible and glowing in well-lit rooms.
Logged


North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Except when they require 4.2 volts - as his does.
I knew I shouldn't have posted... I did take a look but it's not been a good day smiley-sad
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you so much for all your answers. I did not fry the arduino or any LCD I tried (3 differents), but I feel lucky after reading the thread smiley
I'll try a 150 ohm resistor and decrease the value a bit if it's really unreadable at full PWM.

Again, thank you everybody.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm back, trying to get more power to the dimmest LCDs.
The 150 ohm resistor in serial with the pwm works nicely, but I would want to try to use a MOSFET to get more juice to the LCD backlight.

I have a 2N7000 available and wished to use it.
Could you just tell me if this is the right way to do it ?





As I already said, I'm a beginner in electronics and I'm afraid to make some stupid choice which would fry the arduino or the lcd (or both !).
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The orientation of the mosfet is making it hard read, but isn't that connection wrong.

Don't make any changes because I say this, until someone else confirms.

But, I think S should be connected to GND, LED+ to Vcc and LED- to D.

Turn that mosfet in your picture, 90 degree left, and draw lines again, with angles.

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Normally you would control the LED- line

Take a look at this page for some info on connection:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1266731629
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There you go! Now you can change the circuit.
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Exactly what I needed, Thank you !
Side note : It seems "Justin Berken" use the wrong symbol on his diagram (p-channel instead of n-channel), but judging from the datasheet of his MOSFET, it's a n-channel as my 2N7000.
« Last Edit: March 20, 2011, 02:49:52 am by pixelk » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My diagram would then look like this :



Zoom



Does this feel right ?
Logged

Pages: [1] 2   Go Up
Jump to: