Warning to users of some vendors LCD keypad shields

nicw:
I measured 49mA on one board, and 44mA on one other

Even on your boards with the issue, both are pushing current above the 40ma maximum DC Current per I/O Pin
as specified in the AVR absolute maximum ratings table.
So I have a very hard time understanding how anyone, especially the goofy designers of
the board that you contacted, could disagree that this is a problem, particularly if you read
the AVR documentation which explicitly states:

Stresses beyond those listed under “Absolute Maximum Ratings”
may cause permanent damage to the device.

But regardless of whether you are able to convince one vendor to correct his broken design,
it doesn't fully resolve the problem going forward, because there are several vendors
out there making similar LCD keypad shields and many of them appear to have copied
the same broken backlight circuit design so the problem will continue to live on.

--- bill

bperrybap:
But regardless of whether you are able to convince one vendor to correct his broken design,
it doesn't fully resolve the problem going forward, because there are several vendors
out there making similar LCD keypad shields and many of them appear to have copied
the same broken backlight circuit design so the problem will continue to live on.

And of course the problem is of LCD shields that are already made, and may be sitting on some distributor's shelf waiting to be bought.

Lets get this into perspective shall we. You simply cannot accept bugs in software as fact, and then just expect all hardware, (especially of this kind) will always be bug free, and the main reason I contacted the designer of this board in the first place when I saw others had failed. They make the boards for many distributors under different brands, and any change will eventually filter through.

We need to make sure any visitors to this site are made aware of such things and its explained plain enough for them to take corrective action in SW or HW many new comers may not understand. In my profession I see such things often, even well designed hardware can fail in production due to unexpected or unforeseen events. IMHO this will often be an issue buying Chinese copies of hardware, even Arduino compatible boards with extra features will probably get errors in the design, and a good reason to support official products. In this particular case the hardware is reasonable enough, and most hardware of this kind with those will lesser knowledge are far more likely to destroy a board or an IO pin via other methods. :wink:

drdanielfc:
Hello,

I'm using the SaimSmart 1602 as well but I'm not putting it right on the board, instead using DuPont cables to connect all the necessary pins to my arduino. I apologize for such a simplistic question, I believe it's basically the same as the last one you got, but it would work if I put a resistor in between digital port 10 on the arduino and the equivalent in the LCD shield?

If so, what resistance should I use?

And to be clear, I'd like to be able to use PWM control to dim the backlight, but I really don't want to physically modify the board if I can modify something outside (especially since I already have room to put stuff between the pins).

Again, I apologize for my simplistic questions. I'm not an idiot when it comes to electronics, but this is sort of my first dive into this sort of stuff.

I'd just like to make sure my question isn't forgotten; would highly appreciate an answer :blush:

dr,
A diode would be better than a resistor as that would allow d10 to fully pull the line
going to the base of the transistor low (which eliminates the current going into it)
but would not drive the line high which is where the issue is.

An issue with using a resistor will be that while the resistor will protect the pin from
the transistor drawing too much current when D10 is high,
it creates a voltage divider with the existing pullup resistor so the signal going
to the transistor will be some voltage above ground that may not turn off the backlight
as it will allow some amount of current to flow into the base of the transistor.

The actual current going into the base will depend on the value of the resistor
you select, and value of resistor used on the shield as a pullup and the transistor
used on the shield.
Since most shields don't provide an accurate schematic with exact parts used,
it's not possible to precisely calculate a resistor value or tell if it would completely turn
off the backlight (i.e. it might still be very dim, when you try to turn it off)

For sure 125ohm or larger would protect the pin from excess current
but depending on the other components, it might not fully turn off the backlight.

If you wanted to experiment a bit, you could use a pot rather than a fixed resistor.
Then when D10 is low, turn down the pot until you see the backlight go off.
(there is no overcurrent danger in doing this)
You then need to see if that value is large enough to protect d10 from over current.
To do that you need to measure the current going through the wire when D10 is raised to high.
Since the resistor value of the pot might be low enough to allow excessive current,
you should carefully do this test.
Just set it all up, but don't fully connect the meter.
Then connect the meter. The backlight should light up and you can
measure the current coming from D10. If it is over 40ma, the resistor value
should be larger.

While there is probably a resistor value that works acceptable, I'd use
a diode instead as it won't waste additional power when the backlight is on.

--- bill

bperrybap:
dr,
A diode would be better than a resistor as that would allow d10 to fully pull the line
going to the base of the transistor low (which eliminates the current going into it)
but would not drive the line high which is where the issue is.

An issue with using a resistor will be that while the resistor will protect the pin from
the transistor drawing too much current when D10 is high,
it creates a voltage divider with the existing pullup resistor so the signal going
to the transistor will be some voltage above ground that may not turn off the backlight
as it will allow some amount of current to flow into the base of the transistor.

The actual current going into the base will depend on the value of the resistor
you select, and value of resistor used on the shield as a pullup and the transistor
used on the shield.
Since most shields don't provide an accurate schematic with exact parts used,
it's not possible to precisely calculate a resistor value or tell if it would completely turn
off the backlight (i.e. it might still be very dim, when you try to turn it off)

For sure 125ohm or larger would protect the pin from excess current
but depending on the other components, it might not fully turn off the backlight.

If you wanted to experiment a bit, you could use a pot rather than a fixed resistor.
Then when D10 is low, turn down the pot until you see the backlight go off.
(there is no overcurrent danger in doing this)
You then need to see if that value is large enough to protect d10 from over current.
To do that you need to measure the current going through the wire when D10 is raised to high.
Since the resistor value of the pot might be low enough to allow excessive current,
you should carefully do this test.
Just set it all up, but don't fully connect the meter.
Then connect the meter. The backlight should light up and you can
measure the current coming from D10. If it is over 40ma, the resistor value
should be larger.

While there is probably a resistor value that works acceptable, I'd use
a diode instead as it won't waste additional power when the backlight is on.

--- bill

Is there a specific diode I should use (ie could you link me to a good one)? And I can just connect it between d10 on the shield and the arduino? Does the orientation matter?

I truly apologize for the simplistic questions.

drdanielfc:
Is there a specific diode I should use (ie could you link me to a good one)? And I can just connect it between d10 on the shield and the arduino? Does the orientation matter?

I truly apologize for the simplistic questions.

There is discussion about this earlier in the thread.

Thank you bperrybap for the headsup and the test sketch (OP), and dweston for the diode fix. I just purchased a no-name board equivalent to the old dfrobots and the sketch showed it to be bad, with a current of 121ma. I found a 1N5817 on an old circuit board and after installing per dweston's directions (Reply#10) the current dropped to 65ma and the sketch indicated it was good. Both of you rock!

Is that current for the entire shield or just for the d10 pin?
If it is just for d10, then it is still too high as 40ma is the max current per pin.

--- bill

I just purchased the DFRobot version from Amazon and it had this issue. I followed post #69 by Rocketeer503 but used a 1N5231 diode instead since it was what I had on hand. I ran the test sketch and it checked out good! Thanks! I will update if I have any issues down the road

Hey guys,
I just got this 1602 keypad shield http://imall.iteadstudio.com/im120417018.html and found this thread.
I've read through here and did the test - checked out bad, but I'm still very confused as to whether or not this is a shield that has the mentioned problem.
As a noob I see the D10 input mod from post #3 as the best "fix", but I'm unsure as to how to use this.
Could someone please upload a sample code with the D10 correction so me and others can test it out and use it in our future sketches?

Cheers!

Fyod:
Hey guys,
I just got this 1602 keypad shield http://imall.iteadstudio.com/im120417018.html and found this thread.
I've read through here and did the test - checked out bad, but I'm still very confused as to whether or not this is a shield that has the mentioned problem.
If you run the test sketch and it reports the shield has the issue. The shield has the issue.

As a noob I see the D10 input mod from post #3 as the best "fix", but I'm unsure as to how to use this.
Could someone please upload a sample code with the D10 correction so me and others can test it out and use it in our future sketches?

"sample code with the D10 correction" ????
I'm not sure what you are asking for.

I as well as a few others have posted h/w fixes for the issue.
I also posted a text document in a zip file that includes a description
of the issue, along with 2 possible s/w only work arounds, along with instructions
on how to use them in your sketches.

Fyod:
Hey guys,
I just got this 1602 keypad shield http://imall.iteadstudio.com/im120417018.html and found this thread.
I've read through here and did the test - checked out bad, but I'm still very confused as to whether or not this is a shield that has the mentioned problem.
As a noob I see the D10 input mod from post #3 as the best "fix", but I'm unsure as to how to use this.
Could someone please upload a sample code with the D10 correction so me and others can test it out and use it in our future sketches?

Cheers!

Take a close look at your circuit board around D10. Look for a thin trace coming off of that pin and going to a small IC, that should be the transistor (It might be under the LCD screen, verify with the schematic if you can). I wasn't able to find a germanium diode so I grabbed the closest one to me, a 1N5819. It is not the best diode for the job but it gets the job done. Essentially you are going to "splice" that diode in with the marking band towards D10. All you have to do is cut that trace coming off of D10 with an xacto blade, bend the diode into a U shape (be careful, they do crack open), scratch the black "paint" off of the trace, then solder the diode in place.

Part I used: Schottky Diode - COM-10926 - SparkFun Electronics

Hope this helps!

OP I just tested your sketch and it's fried my brand new Leonardo board :astonished:

Looks like I've got the same LCD keypad shield as you. I brought it ages ago here Recommendations For You - DealeXtreme Mine doesn't say DR Robot but looks like the same shield in every other respect.

I was having problems getting it to display anything but a few solid blocks as you were initially (although my blocks were only half height for some reason). I still haven't managed to get it displaying anything (despite the pins being correct as far as I can tell). Anyway I thought I'd test if it also had the backlight issue you discovered. On running your sketch the backlight faded in and out so I concluded it didn't have the issue. I carried on trying to diagnose why the LCD wasn't displaying anything, then it stopped working completely after a few minutes. Noticed the arduino chip was super hot. Now VIN/5v and GND are dead short on arduino board (nothing else plugged into arduino)

When I tested the sketch on my older seeduino board the backlight flashed on and off indicating the shield did have the bad wiring. For whatever reason the voltage didn't droop on my Leonardo making the sketch think it was fine (and going on to fry it).

It may have been a design flaw of my Leonardo in particular as it is a cheap clone Recommendations For You - DealeXtreme

Still I just thought I'd warn anyone else of the potential danger of running the sketch.

scott-nightingale:
OP I just tested your sketch and it's fried my brand new Leonardo board :astonished:

So sorry to hear that. This h/w issue is stressing the AVR WAY beyond it's maximum ratings.
When doing so there is always a risk of damaging the AVR.
The code tries to minimize the time it put the AVR at risk but unfortunately there is still
a risk of damage.

I don't think that this is due to a design flaw in the Leonardo board you have.
This is a h/w issue on the LCD backpack.

The only safe way to verify the shield for the issue is to not use the Arduino board.
I'll update the initial post to be more clear about the potential risks
of using the sketch.

--- bill

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.

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.