Confused by LCD Backlight

Hello,
I am designing a project using an LCD and once it has run through its initial sequence of a few steps I want to turn the backlight off in software in order to conserve battery life. I also need to have the option for the backlight to come back on to give a "Low Battery" message at any time.
I have everything running fine when I have Pin 15 (backlight anode) of the LCD connected to 5V on the Arduino. My thinking was that I would be able to just hook Pin 15 to a digital pin on the Arduino and either digitalWrite that pin HIGH or analogWrite the pin to 255. When I initially did it, the backlight was coming on, but the characters were random instead of what was needed. I checked the voltage and it was at a fine level. I tried different things such as running the PWM output through a LP Filter or just using a low value resistor, but nothing got it to lcd.print the correct characters. Whenever I would connect Pin 15 back to 5V, the writing would work fine.

Can someone explain what might be going on or what I could try to do to make it better?
If I get it working, will that even improve my battery life by much? I'm assuming that the backlight is a fairly significant drain on batteries and using it as little as possible will save battery life.
Thanks for the help!

The backlight on an LCD draws far too much current for an output pin of the arduino. You'll kill the chip like that.

How does the LCD communicate to the arduino? Which pin(s) did you try to use to drive the backlight?

Can you show the code that is causing the problem?

Swtch it with a transidtor.

Hi,

What kind of lcd? 16x2 character or something larger?

Measure the current drawn by the backlight when you connect the anode to +5V (not an Arduino pin). Are you using a series resistor? I'm never sure if these lcds have a series resistor built in or not.

When you said you measured the voltage and it was fine, what exactly did you measure (which lcd pin, what voltage) and was the backlight on or off at the time?

It does sound like when the backlight is off, the power to the lcd controller chip is also getting cut...

Paul

Almost all of the "1602" displays from eBay have a "101" - 100 ohm - resistor as R8 - and a "0" as R9 if present.

For a white backlight, the LED runs at about 3.0V and the 100 ohm resistor carries the difference between that and 5V, which means that the current drawn is up to 20 mA, well within the capability of driving with an Arduino pin. In fact it will be somewhat less, because the Arduino pin will drop by a couple of hundred millivolts at this sort of current level.

It's not rocket science.

Paul__B:
Almost all of the "1602" displays from eBay have a "101" - 100 ohm - resistor as R8 - and a "0" as R9 if present.

Thanks for that Paul. So R8 is the backlight series resistor. What role does R9 play?

Paul__B:
It's not rocket science.

No, at the minute its all guesswork! The OP has not confirmed the type of LCD.

PaulRB:
No, at the minute its all guesswork! The OP has not confirmed the type of LCD.

And even if it is a cheap 16x2 display, not all of them include dropping resistors. So it's really all guesswork.

We really do need details on the specific display being used, and exactly how it is wired up.