Warning to users of some vendors LCD keypad shields

I mentioned a backlight control issue with a few lcd shields in this thread:
http://arduino.cc/forum/index.php/topic,95618.0.html
This thread is a follow up to the LCD backlight control issue.

NOTE: 2023-08-26
The best way to test and/or avoid this issue is to use the hd44780 library
The hd44780_pinIO i/o class for this type of hardware has code to test for this issue and has code that will work around the issue.
The hd44780 library is available in the IDE library manager. You can search for "bperrybap" to easily find it.
That library has a test sketch called LCDkeypadCheck that will test the hardware.
For more information (which I encourage reading) you can reference the hd44780 library git repo:

The hd44780 library wiki:

or the wiki for the hd44780_pinIO i/o class:


You can download a sketch to test the h/w here:
http://forum.arduino.cc//index.php?action=dlattach;topic=96747.0;attach=57859

NOTE: 2016-11-15
For those that would like to do backlight control, you can use my hd44780 LCD library package (available in the IDE library manager) that supports backlight control and will auto detect this issue and work around the issue in s/w for shields that have the issue.
See this thread post for more information:
https://forum.arduino.cc/index.php?topic=96747.msg2998589#msg2998589

NOTE: 2013-10-29
I have created a test sketch that will automatically detect if the shield has an issue.
See this thread message for the test sketch:
Warning to users of some vendors LCD keypad shields - #60 by bperrybap - Displays - Arduino Forum
Or download it directly here:
Warning to users of some vendors LCD keypad shields - Displays - Arduino Forum
Since this h/w flaw in the shield is stressing the AVR way beyond its rated limits
there is the possibility that running this sketch will damage the AVR on the Arduino board.
The only safe way to verify this issue is to not use the Arduino to try to detect this issue.
See response #3 for a safe alternative to using the sketch:
Warning to users of some vendors LCD keypad shields - #4 by bperrybap - Displays - Arduino Forum

WARNING: 2014-07-03
There has been 1 reported case of the test sketch not detecting the issue a Leonardo board
and the Leonardo eventually being damaged after using the backlight.
Warning to users of some vendors LCD keypad shields - #99 by system - Displays - Arduino Forum

NOTE: 2014-02-16
The next post:
Warning to users of some vendors LCD keypad shields - #2 by bperrybap - Displays - Arduino Forum
has been updated to contain a zip image (SWblCTL.zip) of some additional information
including code for a s/w work around.
While not as good as h/w fix, for many situations it can be "good enough".
Download it directly here: SWblCTL.zip

It is definitely an issue for these LCD keypad shields:

DFRrobot:
http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino-1.html

Emartee:
http://emartee.com/product/42054/Keypad%20LCD%20Shield%20V2.0%20%20Arduino%20Compatible
http://emartee.com/product/41909/Keypad%20LCD%20Shield%20%20Arduino%20Compatible

Sainsmart:
http://www.sainsmart.com/evaluation-board/atmel-avr-board/sainsmart-1602-lcd-keypad-shield-for-arduino-duemilanove-uno-mega2560-mega1280.html

OSEPP:
http://osepp.com/products/shield-arduino-compatible/16x2-lcd-display-keypad-shield/

See the reference schematic (look closely at the transistor that controls the backlight)
[attached below]

The idea was that the backlight would be on by default and then pin D10 could control it.
The 4.7k pullup turns on the transistor if D10 is an input and the transistor turns off when
D10 is low. It was supposed to also turn the backlight on when D10 is HIGH.

In those backlight circuit designs, the problem is that the Arduino pin is shorting to ground through the
transistor when the pin is high. Yes the backlight is on and it "appears" to be working but it is massively
overloading the Arduino pin which may eventually cause problems and perhaps
even burn out the pin.
I'm amazed that it even works at all.

The real solution is a different backlight circuit design.
It is also possible to alter the circuit on the shield; however,
the issue I had on my emartee shield is that the pullup and the transistor
are under the LCD which is soldered to the shield/board, which really limited what could
be done without de-soldering the LCD.

The answer is to add a diode between D10 and the base so that D10 can
pull the base low but not short out when D10 is HIGH.
It turns out that this can actually be done on the emartee board without desoldering
the LCD. The trace to D10 goes around the header than drops through the board.
The trace can be cut and a diode dead bugged to the board.

Another issue is that you can't use a typical silicon signal diode like a 1n4148 as the voltage
drop is too high and the backlight will not go all the way off.
I used a germanium diode 1n34a - which worked perfectly and the AVR no longer gets warm
under heavy LCD activity with the backlight on.

As an alternative a 1/8th watt ~510 ohm resistor could be used.
Not as power efficient as the diode when d10 is high (wastes about 8ma) but works ok.
(backlight will also not be 100% off but so dim that you won't see it)

There is also a software alternative which is to set the pin to input mode to turn the backlight
on and to output and low to turn the LED off. This will work fine for on/off control.
If this method is used, avoid using PWM.

If you don't want/need backlight control and are ok with having the backlight on all the time, cutting the D10 header pin from the lcd/keypad shield might be the easiest solution.
Once you cut that header pin, there will be no issues and D10 is available for other uses like other shields underneath the LCD/keypad shield.

I attached photos of the emartee board and my diode mod, to allow safe backlight control.

--- bill

Note:
updated to include SainSmart lcd keypad.
2014-01-20 updated to include osepp lcd keypad

IMG_5634.JPG

IMG_5632.JPG

IMG_5638.JPG

A few more photos.

NOTE: 2014-02-16
I have attached a zip image which contains a text file that details some s/w only workarounds.
(I used a zip image because the forum messes with line endings on text files and
I wanted the file to have DOS line endings to support the users still using Windows)

**NOTE:**2014-04-16
updated 2nd photo to show back side of header.
The diode attaches to a trace that goes behind the header and wraps
around to Arduino pin D10. It does not connect to Arduino pin D8.

--- bill

IMG_5639.JPG

IMG_6690.JPG

SWblCTL.zip (1.25 KB)

I was planning to use this sort of LCD shield for my next char 16x2 or GLCD project however not with a keypad one but this post surely warns me to look out for this abnormality.

Thank you!

--
Nishant

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

2017-11-04 Update:
The test below can cause damage to the lcd shield.
It is no longer recommend.
Use the test sketch, or the hd44780 library and its test sketch to test for the issue.
Refer back to the original post for details.


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

Gee, didn't bother checking out dfrobot's LCD shield since I have mine. The back light is so messed up: :astonished:

http://www.robotshop.com/content/PDF/dfrobot-lcd-keypad-shield-schematic.pdf

This is my serial LCD backpack:

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/serial-lcd-back-pack---phi-panel/

The back light is controlled as it should be, :slight_smile: just simple:

http://www.inmojo.com/files/AMIfv97vQBca0kxi6DMb4fCm8i1LzgUIVet6BjzFgptX8qs7mHHZ44LpwKDcEnYVIBM-Y6KC5m1adD9XOMj76z6sfFo8CymlssEJ3zm9i-Sgb28-lWcNvvJkuE7g99_1IwTWX3Q17eWdkR8f_1RMQ63bPjcJ4DVWTA/Phi-panel-serial-1602v1_7_backpack_schematics.pdf

The dfRobot backlight circuit was attempting to provide a circuit that allowed backlight control
but turned it on by default. This can be important when using the supplied LiquidCrystal
library which has no backlight control, since the reverse style LCDs (white on blue etc...)
would look "dead" until you turn the backlight on.
I'm sure many novice Arduino users would stumble on this.

While it does turn on the backlight by default, which allows reverse style LCDs to
be visible using the IDE supplied LiquidCrystal hd44780 library,
and allow the backlight to be turned off by setting D10 to LOW,
it shorts the AVR pin when the user later attempts to turn on the backlight back on by setting D10 to HIGH
or when PWM is used.

Before I modified the shield, when D10 was HIGH, I measured the current on the AVR pin at over 100ma!

I sent notes directly to both dfRobot and emartee on 2012-03-14 and so far no response.

--- bill

Update:
I notified RobotShop this morning of the flaw and they responded in less than 45 minutes
that they will be contacting the manufacturer about the issue.

We thank you for pointing this issue out.
We were not aware of this problem and will contact the manufacturer in order to work out a solution.
We will also add a note on the current product in order to prevent people from burning their boards.

That is great customer service & technical support.
--- bill

Thanks Bill. That's right. It's unfair to compare my back pack with their shield. My back pack has an ATMEGA328 so it starts up and recalls back light amount from EEPROM but their shield has no such mechanism. But what about using a depletion mode MOSFET? if the D10 is input on reset, the MOSFET conducts, unless you turn it off by a 5V. Will that solve this shield problem?

liudr:
Thanks Bill. That's right. It's unfair to compare my back pack with their shield. My back pack has an ATMEGA328 so it starts up and recalls back light amount from EEPROM but their shield has no such mechanism. But what about using a depletion mode MOSFET? if the D10 is input on reset, the MOSFET conducts, unless you turn it off by a 5V. Will that solve this shield problem?

There are many ways to redesign the circuit solve the problem.
The final design can potentially be influenced by cost.
mosfets are great, but a mosfet solution will cost more than a simple NPN transistor design.
But then I'm very sensitive to costs as I came from an environment of building products in the 100k/month range.
With that volume, pennies mattered.

--- bill

I just received a DFR-007

I am unsure how to fix this problem

can this unit be fixed with the resister or diode ?

There are 2 places that I can see that are labled "K"

One is open and the other is at the top of the LCD PCB

or should I just send it back

SolarPanels,
You should be able to use either the diode or the resistor.
They prevent a "short" in different ways.
If you don't ever set D10 high there is no issue to worry about.
See reply #3 for how you can still do backlight control with this design.

The problem is that if you return it, there is no guarantee that
a shield you get from somebody else won't have the same issue.
I've seen several that all seem to have copied the same circuit.

The simplest would be to just keep it and either not use backlight control
or use it as described in reply #3.

--- bill

I've successfully fixed the DFR-007 backlight cct error using a 1N5819 Schottky diode (a 1N5817 or 1N5818 even better) inserted between the base of Q1 and the pin 10 post (diode cathode to pin 10). The trick was to note the PCB track between these two points is situated on the top surface of the board running out from under the LCD board, through the gap between the J1 and J2 connector strips (referenced to the DFR-007 cct http://www.robotshop.com/content/PDF/dfrobot-lcd-keypad-shield-schematic.pdf and towards the outside edge around to the pin 10 post.

See the attached photos for further guidance.

Code to test with:

//Sample using LiquidCrystal library
#include <LiquidCrystal.h>

/*******************************************************

This program will test the LCD panel and the buttons of
the DFRobot LCD Keypad Shield for Arduino
Product code : RB-Dfr-07
http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino-1.html

Note cct error identified by Arduino forum discussion at:
http://arduino.cc/forum/index.php/topic,96747.0.html
which advises insertion of a Germanium 1n34a or a Schotky 1N5819
diode between pin 10 and the base of Q1 (K to pin 10).

sample code originally by Mark Bramwell, July 2010
modifications by Dion Weston, March 2012



********************************************************/

// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// define some values used by the panel and buttons
int backLight   = 10;    // LCD Panel Backlight LED connected to digital pin 10
int lightLevel  = 255;   // Initialise light full on
int lcd_key     = 0;
int adc_key_in  = 0;
#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5

// read the buttons
int read_LCD_buttons()
{
 adc_key_in = analogRead(0);      // read the value from the sensor 
 // my [Mark Bramwell's] buttons when read are centered at these valies: 0, 144, 329, 504, 741
 // we add approx 50 to those values and check to see if we are close
 if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
 if (adc_key_in < 50)   return btnRIGHT;  
 if (adc_key_in < 195)  return btnUP; 
 if (adc_key_in < 380)  return btnDOWN; 
 if (adc_key_in < 555)  return btnLEFT; 
 if (adc_key_in < 790)  return btnSELECT;   
 return btnNONE;  // when all others fail, return this...
}

void setup()
{
 lcd.begin(16, 2);              // start the LCD library
 lcd.setCursor(0,0);            // move cursor to beginning of line "0"
 lcd.print("Backlight adjust"); // print a simple message
 
}
 
void loop()
{
 analogWrite(backLight, lightLevel);
 lcd.setCursor(13,1);            // move to position 13 on the second line
 lcd.print(lightLevel);

 lcd.setCursor(0,1);            // move to the begining of the second line
 lcd_key = read_LCD_buttons();  // read the buttons

 switch (lcd_key)               // depending on which button was pushed, we perform an action
 {
   case btnRIGHT:
     {
     lcd.print("LED On          ");
     lightLevel = 255;
     break;
     }
   case btnLEFT:
     {
     lcd.print("LED Off         ");
     lightLevel = 1;
     break;
     }
   case btnUP:
     {
     lcd.print("LED Fade Up     ");
     if (lightLevel < 255) lightLevel += 1;
     break;
     }
   case btnDOWN:
     {
     lcd.print("LED Fade Down   ");
     if (lightLevel > 1) lightLevel -= 1;
     break;
     }
   case btnSELECT:
     {
     lcd.print("Select          ");
     break;
     }
     case btnNONE:
     {
     lcd.print("                ");
     break;
     }
 }
 
}

Thank you dweston and bperrybap

I just noticed that the product page says

"Do not use Pin 10 while this shield is connected"

http://www.robotshop.com/productinfo.aspx?pc=RB-Dfr-07&lang=en-US

I do not remember that statement when I ordered it

impressive if they have responded to this info so quickly

A 1N5711 or a REAL Germanium (1N34 - 1N60) would be somewhat easier to mount. Any small signal germanium or schottky diode would work as well. If one pulls the base of the 'switch' transistor below about.5 volts, the transistor is in cut off, non conducting. There is however an easier method that doesn't require cutting traces and 'hanging parts on the display... and that is to replace Q1 (9013) with a BS170 or a VN2222, VNK10 or any other n channel small signal enhancement type Mosfet. The circuit looks like it was designed for a Mosfet and someone 'goofed' and put a bi-polar device in it's place.

IMO and direct experience.

Doc

Docedison:
A 1N5711 or a REAL Germanium (1N34 - 1N60) would be somewhat easier to mount. Any small signal germanium or schottky diode would work as well. If one pulls the base of the 'switch' transistor below about.5 volts, the transistor is in cut off, non conducting. There is however an easier method that doesn't require cutting traces and 'hanging parts on the display... and that is to replace Q1 (9013) with a BS170 or a VN2222, VNK10 or any other n channel small signal enhancement type Mosfet. The circuit looks like it was designed for a Mosfet and someone 'goofed' and put a bi-polar device in it's place.

IMO and direct experience.

Doc

On my shield it isn't easier to replace the transistor.
This is originally what I wanted to do.
The problem is that the transistor is on the shield but it is under the LCD module
so it requires removing the LCD module to get to it.
Since the lcd module is soldered to the shield it requires de-soldering all 16 pins on the lcd module header.
I decided it would be easier to simply do a quick cut
and solder in the diode which is completely hidden when the shield is installed.
Plus since I didn't have any surface mount FETs and my though hole FETs wouldn't fit
under the LCD module when it was soldered back in place, it was my only option.

But if PWM backlight dimming is not needed, then the software work around is by far easier than
any hardware mode.

--- bill

I DO Apologize for that BLUNDER, I only looked at it from an engineering (electrical not mechanical) standpoint and the Mosfet is far and away the easiest fix, for that matter good engineering where the Bi-Polar device is just CHEAP when surplus parts are chosen (as they frequently are). I do however stand by my choice of parts, there are any number of small signal schottky diodes that would be a better choice The 1N5711-2 or a now discontinued but available as surplus HP "Hot Carrier" diode HP 5082-0023??? is one and certainly a REAL Ge. diode would work as well.

Doc

Hey! I actually own a "DFRobot I2C / TWI LCD1602 Module"
http://www.robotshop.com/productinfo.aspx?pc=RB-Dfr-69&lang=en-US

wich it comes with the "DFRobot I2C LCD Backpack"
http://www.robotshop.com/productinfo.aspx?pc=RB-Dfr-145&lang=en-US

I would like to know wich is the easiest way to fix the BJT issue in this case. Any one can confirm that the 'A' of diode will be set on BT (P3 of PCA8574) and the 'K' on the base of BJT thanx in advance

In another post, the user 'dfrobot' (presumably somebody from DFRobot), mentioned that the new version of the DFRobot LCD shield does enable pin 10 to control the brightness. I tested the board I had ordered from Robotshop.com on May 31st, and setting pin 10 via PWM to 0..255 does control the brightness level.

Sort of off topic but I have had business with Robot Shop before and they ARE one of the BEST companies I have found to do business with.
There are a lot of places to buy Cheap parts. Robot Shop is where I go when I need a 'non' cheap part.
If the part cost is over $50.00 That's where I buy it, They have one of the BEST customer Service Dept's I have ever dealt with.....
Robot shop is "on" a complaint immediately and they have yet to disappoint me After 2 4D Systems 32PT SGC displays and issues with the first one...
It didn't look new as the plastic shield cover on the LCD was bubbled and had fingerprints under the film.
Robot Shop sent me a new one and issued me an RMA the next business day.
This is the reason I decided to buy my second from Robot Shop rather than shop around for a better price or faster/cheaper shipping.
To MY Shame I found out from 4D Systems that all their 32PT SGC devices look that way as the film is lifted to inspect the LCD for any cosmetic
damage prior to assembly.

Doc

MichaelMeissner:
In another post, the user 'dfrobot' (presumably somebody from DFRobot), mentioned that the new version of the DFRobot LCD shield does enable pin 10 to control the brightness. I tested the board I had ordered from Robotshop.com on May 31st, and setting pin 10 via PWM to 0..255 does control the brightness level.

I bought mine a year ago and yes, it have the issue :frowning:

I have been done the mod adding a Diode (IN5819) how you can see in the schematic (I have marked green the new diode in the graphic) . Now I have a new issue with the brightness wich have been decreased...