Warning to users of some vendors LCD keypad shields

Thanks bperrybap for the test program and the heads up. I have the Sainsmart LCD keypad shield that I just purchased on Ebay and it lists as dimmable. I don't think the builders are going to correct the boards considering the time frame of this issue. This thread is needed. Despite the earlier programming cautions, I don't recommend any software fix as Arduinos are used for testing and a preexisting sketch may have set pin 10 high. If the shield is then put on before connecting to the computer, the USB port will be overloaded before reprogramming and hopefully just disconnect. This however would be frustrating to figure out if this issue is not known. A hardware fix is the only good option. I had some old radio shack 1N34A germanium diodes and completed your repair. Found that the diode can easily brake if the leads are not carefully bent. Thanks again.

My DFrobot keypad LCD purchased Jan2013 also has a 1K resistor for R7. (you can measure it between pin10 and the Vcc pin) The board matches the pic posted by Rocketeer503. Unfortunately this means that neither a 500R resistor or a 1N34 diode from the transistor base to pin 10 will turn off the transistor. I tried both and they only drop a couple of mV from the nominal 0.8v base voltage - not enough to turn off the transistor. My bare board draws 8 mA with pin 10 grounded and the LCD backlight off or 25 mA with the light on. I think I'll just leave the pin 10 trace cut and soldier on without dimming capability.

Reb9,
An alternative is use a resistor between D10 and the base AND cut the connection of R7 to VCC
You might even be able to re-use R7
by cutting the D10 to base connection and re-connect it to
the other side of R7 where VCC was so R7 now connects to D10 on one side
and the base on the other.
This allows D10 to have full control of the transistor.
The draw back is that by default the backlight will be off since there
is no pullup on the base.
This can eaasily be fixed in s/w.
An easy remedy is to simply switch to using fm's LiquidCrystal library
replacement:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
If you fill in the constructor with the backlight control information,
then lcd.begin() will turn the backlight for you.
You will also be able to use lcd.backlight() to turn it on, lcd.noBacklight() to turn it off and
lcd.setBacklight(dimvalue) for dimming.

Note:
Do not use the deprecated setBacklightPin() call, just fill in the constructor
with the backlight pin and polarity. After that, every thing will work just
like with the LiquidCrystal that comes with the IDE other than you now
have backlight control.

--- bill

Bill
Doesn't look like I can do that on this shield without removing the LCD sub panel. I may eventually pluck the transistor and dead bug a new one. I'll keep your suggestions in mind.
thanks for keeping this thread going

I am new to Arduino and am almost wholly incompetent with PCB's. I bought the Sainsmart 1602 on Ebay, used the test program and found my LCD to fail. I am interested in the software fixes, but am unsure where to put the code and what specific code I should use.

Am I modifying the library or each individual sketch?
Does this short fry the pin when the backlight is bright or dimmed? And if it is one of these, can I just leave the LCD in one setting.

The shield seems to be working now. Does it dry the pin gradually or immediately?

Thanks.

Ceramiclover,
The information you are asking about is there but is scattered about
across various thread responses.

I have updated the initial post with information about s/w work arounds.
Go have a look at the first post again and you will see the new information.

In terms of s/w modifications you could modify either the library or the sketch.
The default LiquidCrystal library does not have any way to control the backlight,
so if using that library, the changes would be in the sketch.
If using some other 3rd party LiquidCrytal library like fm's library, then the changes could be in either the library
or the sketch.

The information I provided shows how to do it in the sketch
as it will work for any library.

--- bill

Hi Folks,
I am a super newbie, Just got my Uno R3 yesterday and also picked up a Sainsmart 1602 keypad shield. I ran the test sketch from this post and looks like that shield has the problem. After running across this post while trying to figure out how to actually make the hardware do something, I read this thread thoroughly. If I am understanding correctly, the problem is that the D10 pin on the LCD shield needs to be isolated from the base of the transistor so that D10 won't be looking at a base-emitter drop to ground if it goes high. If this is correct, seems to me that the easy solution is to remove the pin connected to D10 of the shield and replace it with a jumper wire with a diode or resistor. Then plug the jumper wire into the pin D10 socket of the Arduino. I think you could probably even just bend the shield pin in or out and plug in there too.

Am I missing something? Remember I am new to this world! I think would rather do this surgery than start scraping off the top of a circuit board or remove the LCD.

I am an EE from way back so I understand electronics, but have primarily been an analog guy. This seems like a good entry into some neat stuff that bridges both analog and digital. Looking forward to being part of this group.

Jerry

jerrybass1955:
If I am understanding correctly, the problem is that the D10 pin on the LCD shield needs to be isolated from the base of the transistor so that D10 won't be looking at a base-emitter drop to ground if it goes high. If this is correct, seems to me that the easy solution is to remove the pin connected to D10 of the shield and replace it with a jumper wire with a diode or resistor. Then plug the jumper wire into the pin D10 socket of the Arduino. I think you could probably even just bend the shield pin in or out and plug in there too.

Am I missing something? Remember I am new to this world! I think would rather do this surgery than start scraping off the top of a circuit board or remove the LCD.

Jerry,
I don't think you are missing anything.
While your suggestion would seem to work electrically, I'm not sure it is possible mechanically.
There isn't much space once the shield is plugged on to the Uno and the pins are quite stiff in terms of bending
so I'm not sure you could make it fit/work.
The other h/w solutions in the thread are electrically the same as what you are proposing,
they just tap into the circuit by modifying the traces on the PCB rather than mess with the header pin.
--- bill

Thanks for the wisdom. I took another look and you appear to be correct. I obviously thought there was more room than there is. That said, I think it still may be possible to do something similar using stacking headers like those from Adafruit to lift the board up. The resistor or diode could be built into a modified header I think. I may give that a try since I have a couple of sets ordered (for no particular reason except it looked like something that one should have around).

Jerry

bperrybap:
Jerry,
I don't think you are missing anything.
While your suggestion would seem to work electrically, I'm not sure it is possible mechanically.
There isn't much space once the shield is plugged on to the Uno and the pins are quite stiff in terms of bending
so I'm not sure you could make it fit/work.
The other h/w solutions in the thread are electrically the same as what you are proposing,
they just tap into the circuit by modifying the traces on the PCB rather than mess with the header pin.
--- bill

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.

nicw:
This thread seems in a mess to me and is confusing.

The top post states to look at the circuit especially at the backlight transistor. That shows only connections to pins 15 and 16 of the LCD, and to VCC and 0V, it shows no connection to D10 as mentioned.

Yes it does. Look closer at the schematic. While LCD pin 15 is connected to VCC,
LCD pin 16 is not connected to ground. It is connected to a transistor.
D10 connects directly to the base of the transistor.
When D10 is high, the circuit allows current
to flow into the base out the emitter with no current limiting resistor.
And that is the core of the problem.

So I purchased board and checked it. As expected it was the same, connection to pin 15/16 of the LCD, power and gnd with no connection to D10.
That might be the case, if so, then your shield is not the same as these others and does not have a transistor
for backlight control and so it does not have the problem.
Did you run the test program? What did it say?

Then look at the photos of the Diode mod, it clearly shows the diode connected to the trace going to D8 not D10.
I assure that the diode is going to D10 and not to D8.
While not really shown in the photos, (until now) as mentioned in the original post:

The trace to D10 goes around the header then drops through the board.
The trace can be cut and a diode dead bugged to the board.

note: I just updated the 2nd photo in the 2nd post to show the other side of the header
for clarity. As you can see the diode connects to t trace that goes to D10.

Going by the photos the board looks the same as the one I have here, but I can see no issue with it at all, and it matches the circuit as shown.
Maybe you haven't looked close enough? Or maybe your shield is different.
If your shield really is like this one or the others
that has backlight control, then there is a transistor and then the LCD backlight pins
(pin 15 and 16) are not directly connected to power and ground.

what am I missing here? Very confusing thread.....

Not sure. I think perhaps you are not understanding what the problem is?
which is that the base of the backlight control transistor is being driven by an Arduino pin
an there is no current limiting resistor in the circuit path through the emitter
to ground
--- bill
.

Hi,

I wrote to the actual engineers of this circuit to explain the issue at first the engineer disagreed there was an issue, stating the current draw is negligible. Then following the conversation and doing my own tests I was also unable to reproduce the 100mA draw quoted here even though I verified the circuit I was testing was identical to the one mentioned here. After a long discussions and emailing back and forth his final response is below. The final response is acceptable.

NW

Hello,
see image of digital pin internal circuit diagram, showing internal resistor.

When you set it to high, and connect it to D10 pin on l602 shield, it will drop down to 0.7V. It is still OK. But to be safe, we will replace with the NPN transistor with a NMOS instead..

nicw,
What happened to your original post? Looks like it is gone.
Originally you said that your shield was the same circuit and
D10 was not part of the backlight circuit on your shield. Both can't be true.

All I can say is the problem is very real and multiple people have
seen and measured the excessive current draw on the pin.
If you are not seeing the high current draw, then your backlight circuit is not like
the circuit that I showed or you are not testing the same conditions.

Did you run the sketch that will test the shield for the issue?

The image you posted looks similar to the I/O Pin Equivalent Schematic
in the mega328 documentation. The resistor in that diagram is the pullup resistor
and has nothing to do with the issue and will not be limiting the current when
the pin is driven high.

Again the problem is when the Arduino D10 pin is driven high, not when the pin is driven
low or when the pin is in input mode(with/without pullup enabled).

Using a NMOS FET would be a drop in fix for the problem since FETs don't draw current on the gate
the way a transistor does going into the base.
But if I were going to fix the circuit, I'd look at alternatives that use
just resistors which are cheaper than the cost differential
between the existing NPN transistor vs a FET.
i.e. why use a FET to fix the broken circuit when you could just re-design
the circuit using a traditional transistor and an extra resistor?

--- bill

I eventually found one here that was the same, so I removed the post to the different one with a different circuit. I really don't care what other users say they have found with this probably with their hobby equipment. What I said was I could not reproduce what they were saying here with the same design, same sketch, same conditions, which is not that hard to do, this is not a complex circuit. The current draw was far less than I have read here, but I took up the cause to see what I could do with my contacts as others here said they had no response.

As I said after "LONG" discussions the company who designed the original circuit is going to change it. even though they see no real need in their opinion. You cannot assume that a transistor and resistor will be cheaper at the point of manufacture or that fitting two surface mounted parts is cheaper than one, or that a series resistor wont waste current draw etc. The cheapest and best method for them following the discussion they decided was to go to the fet. Like it or lump it :wink:

nicw:
What I said was I could not reproduce what they were saying here with the same design, same sketch, same conditions, which is not that hard to do, this is not a complex circuit. The current draw was far less than I have read here.

If you are not seeing the large current draw, then I'm guessing that the circuit and/or components
you have on your shield is more than likely different than the shield that I have.
I measured the current draw on my setup and it was 100ma which
is way beyond the maximum current rating for a M328 pin.

How much current did you measure with your setup?

--- bill

I am sure there are different tolerance boards, parts, power supplies etc. I measured 49mA on one board, and 44mA on one other, the third board here does not have this connection at all. One board is difficult to change the transistor or neatly modify it, while the other is quite easy with a well exposed transistor and exposed track. In the case here I have elected to permanently disable this entire circuit on both.

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: