Warning to users of some vendors LCD keypad shields

scott-nightingale:
I think you were very clear on the risks of testing this flaw. Just interesting the sketch didn't seem to pick up the issue when I ran it on the Leonardo and ran the BL as if the wiring was good. I have no doubt this is where the damage occurred and not in the microseconds you sketch took to test the fault.

If I had to guess, I'd guess that the "short" created in this case for this shield has enough resistance
that the output signal doesn't droop low enough to be read as a low.
So even though the pin is being overloaded, the sketch can't detect the issue.
And then by continuing to using it, it eventually burns out the pin.
I updated the initial post with an additional warning and a link to response #3 which now
describes a manual way to detect this issue using a meter.

--- bill

would like to know where is the "test sketch and it reports the shield has the issue. The shield has the issue."
the module turns on back lite bright blue with 16 spots on the upper line...
???
:roll_eyes:

phoenixcomm:
would like to know where is the "test sketch and it reports the shield has the issue. The shield has the issue."
the module turns on back lite bright blue with 16 spots on the upper line...
???
:roll_eyes:

I'm not really understanding your question, but the very first post has all the information.

--- bill

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.

twallace51,
All of this information is already in this thread.
In fact nearly all of it is in the original post, including a description of
the issue and an attached schematic image.

As was discussed in the thread, the issue with a few of the solutions you are
considering is that they are very difficult to do, particularly your #1 solution.
While better than using a diode, it requires unsoldering and resoldering the LCD
to be able to get to the area where the transistor and resistor are located.
In post #1, I mentioned using the diode solution, not because it was ideal,
but because doing much else required lots of desoldering.

The reason you don't see any discussion of directly wiring d10 to the backlight
is that it is not guaranteed to work. LCD Backlights are typically driven with a transistor
because backlight current needs can vary between LCDs and some can consume more power than than an i/o pin
on a microcontroller can supply supply.
While some backlights can be driven by an AVR pin directly, some can't.
That is why you typically see the backlight begin driven by a transistor.

This part of your post is incorrect.

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.

Note: this is the same diode solution I used in the orginal post; however,
the entire point of the diode is to allow controlling the transistor and hence the backlight,
while D10 is always in OUTPUT mode.
With the diode, when D10 is HIGH, the diode blocks it but the pullup on the shield turns on the backlight, when D10 is LOW
it goes through the diode and overrides the pullup and turns off the backlight.
When D10 is used in PWM mode using andlogWrite() you
get dimming/intensity control.
The point of the diode is prevent the short between the D10 being HIGH and ground through the transistor
so that the D10 can be left in OUTPUT mode and driven HIGH or LOW with no issues.

The ideal solution would be to replace the transistor with an FET. Problem solved.
Not only do you get the backlight on by default by the pullup turning on the FET, but
D10 can overfide the pullup to control the gate with no issues of a short,
since there is no current flow into the gate.

But that requires being able to get to the transistor which is usually quite difficult because
it is under the soldered LCD.

There is a s/w only solution that is also mentioned in the original post.
In that solution, there is no modification needed to the board,
you must have D10 in INPUT mode to allow the pullup to turn on the backlight
and then set D10 to OUTPUT and LOW to turn off the backlight.
This work around precludes the use of PWM since that leaves the pin OUTPUT
mode all the time and during the HIGH portions of the PWM signal, there will
be the short through the transistor.

The original post mentions this and reply #1 has the code for the s/w work around.

--- bill

Just thought I'd drop in and thank bperrybap for bringing this matter up. I've also got one of the nuisance keypad jobbies. I rigged up the +5v and GND to the shield, testing on the 200ma range, from pin 10 to +5v gives me OVER RANGE (so that's over 200ma! ) From pin 10 to GND gives me just 4.6ma (and the backlight goes out).

I attempted a diode but every one I tried (even a schotsky) prevents the backlight from being extinguished. By trial and error with resistors of various values I found a 150 ohm seems to be the sweet spot. It still draws 26ma (when the backlight is on) but increasing the value to just 220 ohms prevents the backlight from going out.

I've managed to make the break in the track but it's fiddly on this beast as the small piece of track that's available to me runs pretty tightly between two others. Also, after the laborious job of carefully scratching away the paint, and cutting the break in the track, the small 1/4 Watt resistor I was going to use now looks enormous.

I'm leaving it as it is for now until I have a surface mount resistor available. I think a 1206 would slot in there nicely. Until then, I'll just be stuck with a permanently illuminated backlight (that's at least won't draw any current through pin 10.)

Hey, I've bought a DFRobot lcd shield (v1.0?) do I have this problem? The schematics are supposed to be this:

http://www.dfrobot.com/image/data/DFR0009/LCDKeypad%20Shield%20V1.0%20SCH.pdf

I see that it is a bit different from the one you posted, this one has a 10K resistor (R8) connect to base...

Thanks,
Tiago

EDIT: ok now i know that there is a version before v1.0, and since mine does not have printed 1.0, I am in doubt....

EDIT2: Later i will post a pic of the shield, that i have

tvcsantos:
EDIT: ok now i know that there is a version before v1.0, and since mine does not have printed 1.0, I am in doubt....

I have one marked v2.0. Inspecting the components under a magnifier, it looks like it has the problem (includes a "resistor" of zero ohms) yet testing proves that it's fine. Perhaps the (unmarked) transistor on this one is a mosfet.

Did not have time to read the entire thread, but it seems that the schematic can work without changing the hardware. Did anyone already try to not set pin D10 to high (as this would be an issue), but has anyone tried to program the pin as an INPUT with the internal pullup activated? That might draw enough current to close the transistor without blowing up the Arduino pin.

--EasY--:
Did not have time to read the entire thread, but it seems that the schematic can work without changing the hardware. Did anyone already try to not set pin D10 to high (as this would be an issue), but has anyone tried to program the pin as an INPUT with the internal pullup activated? That might draw enough current to close the transistor without blowing up the Arduino pin.

Did you take the time to read the first post in the thread?
The first post notes using the pin as in input as a
s/w work around and has a link to the second post
which has a zip file containing additional information and some code macros
to provide a safe backlight control function using this s/w work around.

While enabling the pullup won't hurt, the pullup is not needed when
the D10 pin is in input mode since there already
is a pullup on the lcd shield - which is what allows the back to be on by default
since by default, AVR pin 10 is an input after power up.

Note: I updated the first post to correct the tags for the link to the 2nd post
since it wasn't clickable. It is now clickable. Also added direct link to
zip image that contains s/w work around.

--- bill

Hello, i've just received this one i don't know why.
How can i use it completly with Arduino Uno ?
Pictures and programs requested !
Thanks a lot my international friendship from Marseille France.
Regards Morel Philippe.
www.pilote13008@facebook.com

PilotPhil:
Hello, i've just received this one i don't know why.
How can i use it completly with Arduino Uno ?
Pictures and programs requested !
Thanks a lot my international friendship from Marseille France.
Regards Morel Philippe.
www.pilote13008@facebook.com

Just never put pin 10 into OUTPUT mode and you'll be fine.

KenF:
Just never put pin 10 into OUTPUT mode and you'll be fine.

And you'll never be able to turn off the backlight, either. But that is the safest way to handle it.

If you do want control over the backlight, and don't want to modify the board as mentioned elsewhere in this thread, then:

  • To turn backlight off: set pin 10 to OUTPUT and LOW
  • To turn backlight on: set pin 10 to INPUT
  • Just be sure to never set pin 10 to OUTPUT and HIGH!

Hi all. I bought an LCD keypad from DFRobot ( )

The schematics can be found here : http://www.dfrobot.com/image/data/DFR0009/LCDKeypad%20Shield%20V1.1%20SCH.pdf

The link to schematics from DFRobot page still redirects to v1.0 so I give the right one above.

I use this for a while, using dimming by using D10 as an output with a value of about 150, so with PWM.

Can someone say to me if I'm concerned with the issue ?

I had a response from DFRobot. I paste it here.

grey.cheng":
Hello Eric,

Thank you for your inquiry.

I've seen this post 2 years ago, but It has been fixed at that time.

You could control the backlight with "D10" directly.

Best Regards,
Grey
--DFRobot Tech Support

Just a note:
I need to use pin 10 as a PWM for other things. So I just cut the lead, and ran a blue wire from pin 10 to the motor controller, and then wired a diode between the base of the transistor over and tied it to one of the analog pins, which I will use as a digital I/O.

The particular application requires the display, an RTC and a motor control for a pet feeder. It irritates me to no end that people that make things like this display, decide that a pin should be used for something like this. I think it should have come out to a via, such that if you wanted to you could either solder blob or install a jumper to tie it to whatever pin you want.

scrungy_doolittle:
I think it should have come out to a via, such that if you wanted to you could either solder blob or install a jumper to tie it to whatever pin you want.

That would be nice. But that could add to the board cost, will add to the documentation cost, and might not be appreciated by the target audience who generally seems to want a plug-and-play solution. Setting jumpers or soldering wires runs counter to that expectation.

From the description of you modifications, you seem to be a bit more advanced and not a beginner. Unfortunately, the shields need to be designed for the lowest common denominator.

It's a bit pricey, but have you see the Go-Between Shield? It lets you rearrange any and all pins as needed.

ShapeShifter:
That would be nice. But that could add to the board cost, will add to the documentation cost, and might not be appreciated by the target audience who generally seems to want a plug-and-play solution. Setting jumpers or soldering wires runs counter to that expectation.

Done appropriately there should be no added cost nor documentation costs.
It would literally cost nothing.
There are a couple of options but both are essentially the same.

  • Create a set of solder pads on the board that contain a small trace between them on the D10 trace going to the transistor.
  • Create a set of two holes spaced for a 2 pin header with a small trace between them on the D10 trace going to the transistor.

Cut the trace and you disable using D10 for backlight control and the backlight will be permanently on.

By doing this, the larger less technical audience gets the same board that they get now with D10 controlling the backlight.
The more technical audience gets a way to disable the use of D10 as they will be knowledgeable enough to realize this "feature" without having to provide any sort of documentation for it other than perhaps the schematic.

The first technique of using solder pads is used on the Arduino UNO R3 for the auto-reset enable.
(Cut the trace and you disable autoreset - would have been better if they had provided holes for soldering a header for a jumper)

I have seen many boards that have used both of these techniques.
In the "duino" space I've seen this done on 3rd party Arduino clones and USBasp devices.

Doing either of these options should not add any cost to the board.

--- bill

Hi

If the problem is electronic, that is, you want to turn off the LED which is normally on, then circuit in the picture could work. It will work, but the backlight always takes current, the transistor just short circuits the LED. A fet works too.

thepic.jpg

I have one of the offending boards, and got lucky enough to run across this post just as I was about to plug it in. I cut the trace and dead-bugged a 1N35 onto it, and rocked on without trouble.

Thanks, berrybap, for posting this info.