I mentioned a backlight control issue with a few lcd shields in this thread:
http://arduino.cc/forum/index.php/topic,95618.0.html
This thread is a follow up to the LCD backlight control issue.
NOTE: 2023-08-26
The best way to test and/or avoid this issue is to use the hd44780 library
The hd44780_pinIO i/o class for this type of hardware has code to test for this issue and has code that will work around the issue.
The hd44780 library is available in the IDE library manager. You can search for "bperrybap" to easily find it.
That library has a test sketch called LCDkeypadCheck that will test the hardware.
For more information (which I encourage reading) you can reference the hd44780 library git repo:
The hd44780 library wiki:
or the wiki for the hd44780_pinIO i/o class:
You can download a sketch to test the h/w here:
http://forum.arduino.cc//index.php?action=dlattach;topic=96747.0;attach=57859
NOTE: 2016-11-15
For those that would like to do backlight control, you can use my hd44780 LCD library package (available in the IDE library manager) that supports backlight control and will auto detect this issue and work around the issue in s/w for shields that have the issue.
See this thread post for more information:
https://forum.arduino.cc/index.php?topic=96747.msg2998589#msg2998589
NOTE: 2013-10-29
I have created a test sketch that will automatically detect if the shield has an issue.
See this thread message for the test sketch:
Warning to users of some vendors LCD keypad shields - #60 by bperrybap - Displays - Arduino Forum
Or download it directly here:
Warning to users of some vendors LCD keypad shields - Displays - Arduino Forum
Since this h/w flaw in the shield is stressing the AVR way beyond its rated limits
there is the possibility that running this sketch will damage the AVR on the Arduino board.
The only safe way to verify this issue is to not use the Arduino to try to detect this issue.
See response #3 for a safe alternative to using the sketch:
Warning to users of some vendors LCD keypad shields - #4 by bperrybap - Displays - Arduino ForumWARNING: 2014-07-03
There has been 1 reported case of the test sketch not detecting the issue a Leonardo board
and the Leonardo eventually being damaged after using the backlight.
Warning to users of some vendors LCD keypad shields - #99 by system - Displays - Arduino ForumNOTE: 2014-02-16
The next post:
Warning to users of some vendors LCD keypad shields - #2 by bperrybap - Displays - Arduino Forum
has been updated to contain a zip image (SWblCTL.zip) of some additional information
including code for a s/w work around.
While not as good as h/w fix, for many situations it can be "good enough".
Download it directly here: SWblCTL.zip
It is definitely an issue for these LCD keypad shields:
DFRrobot:
http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino-1.html
Emartee:
http://emartee.com/product/42054/Keypad%20LCD%20Shield%20V2.0%20%20Arduino%20Compatible
OSEPP:
http://osepp.com/products/shield-arduino-compatible/16x2-lcd-display-keypad-shield/
See the reference schematic (look closely at the transistor that controls the backlight)
[attached below]
The idea was that the backlight would be on by default and then pin D10 could control it.
The 4.7k pullup turns on the transistor if D10 is an input and the transistor turns off when
D10 is low. It was supposed to also turn the backlight on when D10 is HIGH.
In those backlight circuit designs, the problem is that the Arduino pin is shorting to ground through the
transistor when the pin is high. Yes the backlight is on and it "appears" to be working but it is massively
overloading the Arduino pin which may eventually cause problems and perhaps
even burn out the pin.
I'm amazed that it even works at all.
The real solution is a different backlight circuit design.
It is also possible to alter the circuit on the shield; however,
the issue I had on my emartee shield is that the pullup and the transistor
are under the LCD which is soldered to the shield/board, which really limited what could
be done without de-soldering the LCD.
The answer is to add a diode between D10 and the base so that D10 can
pull the base low but not short out when D10 is HIGH.
It turns out that this can actually be done on the emartee board without desoldering
the LCD. The trace to D10 goes around the header than drops through the board.
The trace can be cut and a diode dead bugged to the board.
Another issue is that you can't use a typical silicon signal diode like a 1n4148 as the voltage
drop is too high and the backlight will not go all the way off.
I used a germanium diode 1n34a - which worked perfectly and the AVR no longer gets warm
under heavy LCD activity with the backlight on.
As an alternative a 1/8th watt ~510 ohm resistor could be used.
Not as power efficient as the diode when d10 is high (wastes about 8ma) but works ok.
(backlight will also not be 100% off but so dim that you won't see it)
There is also a software alternative which is to set the pin to input mode to turn the backlight
on and to output and low to turn the LED off. This will work fine for on/off control.
If this method is used, avoid using PWM.
If you don't want/need backlight control and are ok with having the backlight on all the time, cutting the D10 header pin from the lcd/keypad shield might be the easiest solution.
Once you cut that header pin, there will be no issues and D10 is available for other uses like other shields underneath the LCD/keypad shield.
I attached photos of the emartee board and my diode mod, to allow safe backlight control.
--- bill
Note:
updated to include SainSmart lcd keypad.
2014-01-20 updated to include osepp lcd keypad