I mentioned a backlight control issue with a few lcd shields in this thread:
This thread is a follow up to the LCD backlight control issue.
You can download a sketch to test the h/w here:
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:
I have created a test sketch that will automatically detect if the shield has an issue.
See this thread message for the test sketch:
Or download it directly here:
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:
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.
The next post:
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:
See the reference schematic (look closely at the transistor that controls the backlight)
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.
updated to include SainSmart lcd keypad.
2014-01-20 updated to include osepp lcd keypad