Warning to users of some vendors LCD keypad shields

jazreenZIA88:
my 1602 lcd keypad shield have "D1 ROBOT" markings.
when you say "visually inspecting" it, does it translate to my shield and/or uno board getting fried?

i let it run for more than 30 minutes already using analogWrite and it appears okay to me.
i'm into software and noob in arduino :smiley:

By visually inspecting, I mean following the etch on the PCB to see how it connects to the transistor.
If there is not a resistor in series with the transistor then the backlight circuit is broken and is overloading the AVR.

Just because it appears to be working doesn't mean that it is ok.
It so easy to run the diagnostic sketch, I don't see the reason to not to.
In fact it would have given you the answer in just a couple of seconds whereas even after running your sketch for 30 minutes you still don't know the answer.

For those that are concerned about your lcdkeypad, but would like to use backlight control, you can use my hd44780 library.
It contains API functions to control a backlight circuit.
When the library is configured for backlight control, it will test the backlight circuit and if the backlight circuit is broken, it will automatically use safe methods to control the backlight.
The library has API functions to control the backlight that supports on/off and dimming. However, if you have a broken backlight circuit, the library will automatically protect the AVR by disallowing dimming and will revert to safe on/off control i.e. all pwm values other than 0 will be on, and 0 will be off and the library will never drive the output pin HIGH to turn on the backlight.

The library is called "hd44780" and is available in the IDE library manager.
Here is a link to the git hub page: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

The i/o class is called hd44780_pinIO
While not a direct drop in replacement for the LiquidCrystal library, it is API function compatible.
It includes an example sketch to test the keypad backlight circuit ( LCDKeypadCheck ) if you want to test or verify if your keypad has the backlight circuit issue.
hd44780_pinIO also quite a bit faster than the stock LiquidCrystal library and supports some additional capabilities.
See the github page for a list of the supported API functions.

--- bill

I used the sketch of bill "bperrybap" and it detects the BL circuit as BAD.
I soldered a 10k smd resistor according to the new schematic in and the sketch gave me a GOOD.
Backlight at full brightness - no change visible.

Thanks

DrBockel

The DF Robot shield I got from Deal Extreme in October 2015 also has the excess current problem so I did a bit of investigating.

I unsoldered the LCD to see what was underneath. In my case R7 is 1k ohm and the transistor is marked J3Y which according to the data sheet is a S8050 NPN rated at 0.5A with Hfe of 120-350.

To turn the transistor fully on, and supply the backlight with the 18.5mA it needs:
I(base) = I(collector)/Hfe = 18.5/120 = 0.15mA flowing into the base of the transistor.

To achieve a base current of 0.15mA the base resistor needed is:
Vcc-Vbe/Ibase = (5V-0.7V)/0.15mA = 29k ohm. I had only had a 10k resisotor so used that.

I reused the 1k ohm resistor to connect from the PWM pin 10, to the 29k (10k) base resistor. The combination limits the base current to 5mA.

As a side note, I used pin 3 for PWM as pin 10 conflicts with the Chip Select line on my data logger shield. I tried pin 9 but it made the backlight flicker instead of dimming. The other PWM pins had no effect. I have no idea why.

While I had the LCD off the board I made some measurements with the arduino, the sheild with and without LCD screen and the backlight on it's own.

Backlight        Arduino,       Arduino,         Arduino,                 LCD only                Arduino, 
brightness       LCD shield,    LCD sheild       No LCD shield            No Arduino,             Modified shied
                 LCD            No LCD           No LCD                   No LCD sheild           LCD
Full             79mA           58mA             -                        -                       67mA           
Minimum          56mA           55.1mA           -                        -                       55mA
Off              55mA           55mA             50mA                     18.5mA                  55mA

So the current draw for the components are:
over 125mA Unmodified shield with backlight full brightness, LCD and Arduino Uno R3
18.5mA Backlight only, no LCD screen.
0.1mA LCD screen, no backlight
5mA LCD shield only, no LCD screen, including modified resistor and power LED, backlight off
8mA LCD shield only, no LCD screen, including modified resistor and power LED, full brightness
50mA Arduino Uno R3 only

It amazing how many of these companies producing products don't have anyone with the technical expertise to know how to properly control a transistor. That seems like some pretty basic EE 101 knowledge.
Even worse, doing it correctly does not affect the product's manufacturing costs.

--- bill

bperrybap:
It amazing how many of these companies producing products don't have anyone with the technical expertise to know how to properly control a transistor. That seems like some pretty basic EE 101 knowledge.
Even worse, doing it correctly does not affect the product's manufacturing costs.

To be fair mine has been sitting unused for a few years so it could be part of the original batch. I imagine a gazillion of these were made and will continue to surface until stocks are gone or people like me finally notice.

regardless of the age of a given shield, this issue never should have existed because it is broken by design.
I always wondered if the original design used an FET instead of a transistor which would not have the issue. But then somebody decided to save a few pennies and substituted the part with a transistor and that is what broke things. - i.e. management, or the dumb people that cloned/stole the design, broke the engineers working original design. But that is just a wild a guess.
But it could be as simple as a dumb "engineer" actually designed it that way.
However it happened, many vendors were simply zeroxing this design to make their shields and not one of them bothered to look at the schematic to notice that the transistor was not wired up correctly.

--- bill

Hi all, I too have one of those cheap chinese clone LCD Shields, ran the test sketch and sure enough it needs fixing. As I'll be using my LCD shield on top of an Ethernet shield and I have already added one row of stackable headers to accomodate the large ethernet socket I thought I could put a 1N5818 diode in between those two headers at d10 (just pluck the pin from the stackable header) and avoid cutting traces etc. (see attached pic). Will this be enough or do I absolutely have to place this diode up and cut that trace? Also, please confirm I'm using the correct polarity on the diode (anode to LCD shield on top, cathode to ethernet shield/arduino below). THanks

1N5818_LCD_Shield.png

I have a brand new (March 2017) SainSmart with this issue and a brand new SODIAL 1602 without the issue. I guess this is a vote in favor of the I2C displays, going forward.

masbass, mrred128,
Again, you don't have to do anything if your code doesn't ever use pin 10.
The backlight will be on all the time.
If you still want to have backlight control, simply use my hd44780 library with the hd44780_pinIO class like I mentioned in the very first post.
It will auto detect the issue and automatically work around it in s/w.
So not only do you get backlight control (which the standard LiquidCrystal library doesn't give you) but hd44780 will do the backlight control in a safe way that works even on the shields with broken hardware.
With broken h/w you won't get dimming but still get on/off control.
Also, hd44780 is quite a bit faster than the bundled LiquidCrystal library.

That said, I do prefer using the I2C backpacks and the hd44780 library package makes using them very easy since it can auto detect everything.

--- bill

I use B4R (free basic cross compiler) and made a wrapper that incorporates your detection. I have 2 of these units (one good, one bad) and do not wish to trow any out.....I just will use i2c going forward.

@pberrybap

Good job for supporting some users.

Please, DO NOT do this stupid thing.

Ive just burnt my lcd doing that omg. >.<

bperrybap:
For those wanting to test their shield for this problem, there is an easy test.

Remove the shield from the arduino.

Attach a wire to the D10 pin on the shield.
Hook up ground and 5v to the corresponding shield pins.

When power is turned on, the backlight should light.

Ground the wire going to D10, the backlight should go off.

Now for a simple test.

Briefly (and I mean just a brief touch) connect the wire from D10 to Vcc.
If the backlight, blinks when you touch the D10 wire to VCC, the shield
has this issue.

Do not set D10 to HIGH or use PWM on this shield unless you modify it.
You can still control the backlight .
First set D10 to LOW. (only need to that once)

Then set the D10 to OUTPUT for off and INPUT for on.

UPDATE: (2014-07-03)
It is possible that there is still an issue even if the backlight doesn't "blink" during
the above test. This could happen if the excess current draw isn't large enough to cause
a power issue for the backlight when doing the above test.
It is possible that the current demand is still way beyond what
an AVR pin can safely supply.
If this is the case, it might work a while but could end up frying the AVR over time.

The best way to test for an issue is to actually measure the current on the D10 pin when it is being driven high.
To do this, wire up the shield as described above but then measure the current between the D10 pin and VCC.
Set your meter for current with + probe going to VCC and - probe going to the D10 pin on the shield.
If you measure more than about 30ma, the backlight circuit has the issue.

--- bill

queenbey:
Please, DO NOT do this stupid thing.

Ive just burnt my lcd doing that omg. >.<

The current recommend way to test a shield is to use the test sketch indicated in the first post.
Even better is to use my hd44780 library which will work around the issue and also includes a test sketch to test for the issue, which is also mentioned in the first post.
Either of these test sketches are quick and simple to run and if you use the hd44780 library you don't need to worry about it and can use the backlight API calls without worry of h/w damage.

How long did you connect the pin to vcc?
A brief touch would be moving the wire twards another wire in a quick motion where wires only briefly touch as the wires cross paths. Any more time and the risk of damage increases.
It is test that does come with risk of damage if you connect the wire too long.
It is kind of like testing the battery in you car by shorting out the jumper cables to see if you see a spark.
A very brief momentary touch is ok, but if too long it can cause damage.

When measuring the current into the D10 pin of the shield you must measure the current from the D10 pin on the Arduino board and not from VCC. If using VCC instead of D10 for measuring current, it will likely fry the transistor since the AVR can't supply nearly as much as a unrestricted 5v supply.

The LCD should be fine, more than likely what happened is the transistor got fried.
What did you use for the 5v?
I guess I should have said to use the 5v from the Arduino rather than a bench supply as the Arduino board can't supply gobs of current.

I'll go update the post that describes this to not recommend doing this and instead use the s/w from the first post.
That post was written before the s/w to test for it existed.

--- bill

1st off thanks to all who have contributed to the solutions in this thread!

2nd, HELP please!

I, like many others, just purchased one of these display shields. Read through this thread and downoaded the test sketch. The test sketch showed that my display had the problem. I disassembled the display off the main board to get to R7 and Q1 and found that R7 was 1KOhm. On my first read through, I didn't catch that a 1K would cause a problem using the recommended 510Ohm between D10 and base. (I didn't have any diodes handy.) So I cut the trace and installed the 510 and re-soldered the display back on. Test sketch now shows good, but I have no backlight control, it just always stays on.

I saw one post talking about needing a 29K but using a 10K and switching the 1K somewhere else, but I'm not savvy enough to follow what that was talking about. If I replace the 1K with a 4.7K and replace the 510 with a 10K will that work? Like the new schematics, or what do I need to do to get backlight control working?

Thanks for any assistance!

Impressive that you able to successfully get the LCD off the shield.
It is often quite difficult, unless you have some desoldering tools.

What is needed is to limit the current from D10 going into the base.
The shields that have the issue don't have a resistor between D10 and the base.
They typically only have a resistor between the base and VCC. This is a pullup resistor used to feed current into the base to turn on the backlight when D10 is an input and not driving the signal.

From your description, I can't tell what design you had or what you have done.
You also mentioned 2 resistors in the last paragraph.

Can you fully describe all the connections going to the transistor base and to D10?

-- bill

Mine is like the original schematic with VCC going into one side of a resistor (R7), the other side of the resistor goes to the base of the transistor. Also to the base of the transistor is a trace back to D10 with no resistor. However, my R7 is 1K, not 4.7K like the schematic. I cut the trace to D10 and dead bugged a 510Ohm across the gap, which made the test happy, but the backlight won't dim at all. I saw someone say they had to use a lower (~120Ohm) in the D10 line, but I think I also saw somewhere that still allowed too much current to flow and could cause damage.

As to the two resistors. There is a new schematic out there from dfrobot (attached) that shows a R7 4.7K just like the old schematic and a new R8 10K in between D10 and the base. Is that new schematic what they did to fix the problem and has a safe current load? Can I remove the 1K R7 and replace with 4.7K and swap the 510 for a 10K?

schematics-v1.0-dfr0009.pdf (48.4 KB)

Still not sure exactly how you wired in the added resistor.

It sounds like you may have put the new resistor in between D10 and the base but not between R7 and the base.

If you did that, then the short issue is resolved but D10 won't be able to turn off the backlight as there is now a voltage divider formed by R7 and your new resistor rather than D10 being able to absorb the current from R7.

If that is what you did,
you could cut the trace between R7 and VCC.
The backlight will be off until s/w turns it on by setting D10 high.


D10 must connect directly to the non VCC side of R7 to be able to pull down the pullup.
There must also be a resistor between D10 and the base to prevent a short through the base.
D10 needs to connect to both resistors like what is shown in the schematic that was in your post.

--- bill

Sorry that I am not describing it well. This is what the traces, etc. look like on my board. I tried to take a direct photo, but the board is black and it just wouldn't work.

I cut the trace between D10 and where it connects to the transistor side of the R7 resistor. Then jumped the gap with a 510Ohm resistor.

So I need to restore the trace where I cut it and then cut the trace between the R7 resistor and the transistor and patch the 510 Ohm across there?

You can't turn off the backlight the way you did the modification as that creates a voltage divider rather than allowing D10 to ground the R7 pullup resistor.

To fix it, isn't just restoring the D10 trace and inserting the the new resistor between R7 and the base.

It is what I said earlier:

D10 must connect directly to the non VCC side of R7 to be able to pull down the pullup.
There must also be a resistor between D10 and the base to prevent a short through the base.
D10 needs to connect to both resistors like what is shown in the schematic that was in your post.

You have to do the resistors like what is shown in the schematic in your post #166 schematic
Note that D10 connects to both resistors and still must flow through a resistor before going to the base.

Its been a long time since I looked at this, but from what I remember, depending on the board trace layout, it may be very difficult to dead bug the added resistor between R7 and the base and get D10 to connect between R7 and your added resistor.

Alternatively, you could just cut the r7 to vcc connection with what you have now and D10 could control the backlight, but the backlight would be off until D10 turned it on.

Another possibility is to measure the actual backlight current. Some 16x2 backlights are very low current and use as little as 2-5ma. If that is the case, then you don't need a transistor at all and you could control the backlight directly from the D10 pin.

--- bill