I noticed that there might be a problem with my newly bought KeyPadLCD shield, when the LCD was moderately bright when my Arduino was powered only by USB cable, and much brighter when powered with 12V to the power connector.
Googling the Internet revealed that others have noticed similar problems, including this lengthy Arduino forum thread, warning that some versions of the LCDKeyPad shield can burn up the Arduinos they are used on.
After reading and studying this thread, I was still confused as to what the specific cause of the problem was, and how to correct it. It may be that the thread is so long, because many others are similarly confused. Thus I have summarized my studies and understanding below, in the hopes that I (and others) might better understand this issue.
The problem:
As seen in the schematics linked below, 5V is connected to LCD pin 15 , LCD pin 16 connected to collector pin of a transistor, with the transistor emitter connected to ground.
The LCD backlight was designed to be controlled (off to full brightness) by applying a 0 to 5V potential to the transistor base, in this case from Arduino pin D10. Note: The following schematic would have been easier to understand, if instead of simply D10 written next to the line between the 4.7k resistor to the transistor base, it had clearly shown a line from a pin labeled D10, also connected to that line.
See:
http://forum.arduino.cc/index.php?PHPSESSID=hhbirj8dd46l2m524u5mei5bd2&action=dlattach;topic=96747.0;attach=15152;image
On power up, Arduino pin D10 is by default in INPUT mode ( no defined voltage ). This means that the backlight will be off or nearly off by default, and lead a new user to think that the LCD is not working and defective.
Thus, many shield manufacturers have placed a 4.7k resistor between 5V and the transistor base, so the backlight will be on by default, due to the resistor passing approximately 5V/4k7 ohms or 1mA of current to the transistor base.
Now, if you want to control the LCD backlight intensity using Arduino pin D10, you need to set pin D10 to OUTPUT mode, which by default will be initially LOW. The Arduino absorbs the above 1mA current and a close to 0V on the transistor base turns LCD backlight off or nearly so.
The problem happens when you set pin D10 to OUTPUT and HIGH to turn backlight on again, ie the Arduino provides 5V to pin D10 and thereby directly to the transistor base. A typical transistor base to emitter resistance is low, for this discussion lets say around 500 ohms, so 5V/500ohms=100mA of currentl, way over the Arduino pin tolerance of 40 mA or less. This effectively results in a short circuit between pin D10 to ground and eventual Arduino burnout!
The Theoretical Solutions:
Looking at the schematic referred to above, one can either disconnect the 4.7k resistor that turns the LCD backlight on by default and then connect it or similar to the Arduino pin D10 as a curentl limiting resistor. The backlight will now be OFF by default, but pin D10 will now have full and protected control of backlight intensity.
Or a suitable diode can be placed in series between pin D10 and where the 4.7k resistor attaches to the line to the transistor base. If the diode's orientation is correct, it will prevent short circuit of pin D10, when it is set to OUTPUT and HIGH. In this case however, you will only be able to turn the backlight ON with pin D10 in INPUT mode, backlight OFF with pinD10 in OUTPUT mode (either HIGH or LOW). You will have no intensity control.
Refer to the following corrected schematic – note that the free end of the diode should have been labeled as connected to Arduino pin D10, rather than labeled with a cryptic BT.
http://forum.arduino.cc/index.php?PHPSESSID=7r8mtgghd6t50agg9c37nbavk7&action=dlattach;topic=96747.0;attach=23847;image
A third option mentioned in the thread (untested? not feasible? not recommended?) is simply disconnecting LCD 15 and 16 and Arduino D10 pins and reconnecting D10 directly to LCD 15, LCD 16 directly to ground. (Then why was the transistor there in the first place?)
The Practical solution:
Since I haven't read of anyone actually doing and describing how they did the first (my preferred) solution or third solution, I did the second by soldering a diode onto my LCDKeyPad shield, as described in the above Arduino forum thread. Links to photos of other similarly repaired shields are:
http://forum.arduino.cc/index.php?PHPSESSID=mhha79v8o3sepvkd1ortgj7eg0&action=dlattach;topic=96747.0;attach=66886;image
http://forum.arduino.cc/index.php?PHPSESSID=32gn5knof1d20p1kulljths0i0&action=dlattach;topic=96747.0;attach=82288;image
Final Comment:
Given my understanding as described above, I found that rereading the thread referred to above, was much less confusing that it was the first time.