Arduino Forum

Using Arduino => Displays => Topic started by: bperrybap on Mar 15, 2012, 08:17 am

Title: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 15, 2012, 08:17 am
I mentioned a backlight control issue with a few lcd shields in this thread:
http://arduino.cc/forum/index.php/topic,95618.0.html (http://arduino.cc/forum/index.php/topic,95618.0.html)
This thread is a follow up to the LCD backlight control issue.
You can download a sketch to test the h/w here:
http://forum.arduino.cc//index.php?action=dlattach;topic=96747.0;attach=57859 (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 (https://forum.arduino.cc/index.php?topic=96747.msg2998589#msg2998589)

Quote
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:
http://forum.arduino.cc//index.php?topic=96747.msg1447948#msg1447948 (http://forum.arduino.cc//index.php?topic=96747.msg1447948#msg1447948)
Or download it directly here:
http://forum.arduino.cc//index.php?action=dlattach;topic=96747.0;attach=57859 (http://forum.arduino.cc//index.php?action=dlattach;topic=96747.0;attach=57859)
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:
http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042
 (http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042)

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.
http://forum.arduino.cc/index.php?topic=96747.msg1828105#msg1828105
 (http://forum.arduino.cc/index.php?topic=96747.msg1828105#msg1828105)


NOTE: 2014-02-16
The next post:
http://forum.arduino.cc/index.php?topic=96747.msg725979#msg725979 (http://forum.arduino.cc/index.php?topic=96747.msg725979#msg725979)
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 (http://forum.arduino.cc/index.php?action=dlattach;topic=96747.0;attach=125630)
It is definitely an issue for these LCD keypad shields:

DFRrobot:
http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino-1.html (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/42054/Keypad%20LCD%20Shield%20V2.0%20%20Arduino%20Compatible)
http://emartee.com/product/41909/Keypad%20LCD%20Shield%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 (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/ (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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 15, 2012, 08:19 am
A few more photos.
Quote
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Nishant_Sood on Mar 15, 2012, 09:25 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 26, 2012, 11:48 pm
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 (http://forum.arduino.cc/index.php?topic=96747.msg725978#msg725978) 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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: liuzengqiang on Mar 27, 2012, 04:36 pm
Gee, didn't bother checking out dfrobot's LCD shield since I have mine. The back light is so messed up: :smiley-eek:

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,  :) just simple:

http://www.inmojo.com/files/AMIfv97vQBca0kxi6DMb4fCm8i1LzgUIVet6BjzFgptX8qs7mHHZ44LpwKDcEnYVIBM-Y6KC5m1adD9XOMj76z6sfFo8CymlssEJ3zm9i-Sgb28-lWcNvvJkuE7g99_1IwTWX3Q17eWdkR8f_1RMQ63bPjcJ4DVWTA/Phi-panel-serial-1602v1_7_backpack_schematics.pdf
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 27, 2012, 06:50 pm
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.

Quote
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


Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: liuzengqiang on Mar 27, 2012, 10:54 pm
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?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 28, 2012, 01:37 am

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

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: SolarPanels on Apr 01, 2012, 01:57 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 02, 2012, 02:32 am
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

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dweston on Apr 02, 2012, 07:45 am
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 (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:

Code: [Select]
//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;
     }
}

}
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: SolarPanels on Apr 02, 2012, 05:33 pm

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Docedison on May 25, 2012, 08:26 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on May 25, 2012, 08:52 pm

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Docedison on May 25, 2012, 11:00 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Jul 16, 2012, 03:58 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MichaelMeissner on Jul 16, 2012, 05:01 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Docedison on Jul 16, 2012, 07:17 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Jul 16, 2012, 10:42 am

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 :(
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Jul 16, 2012, 10:02 pm
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...
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 16, 2012, 10:59 pm

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...


That is because the diode does not go in series with the pullup resistor to the base of the
transistor but in series with the D10 to connection of the base of the transistor.


--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Jul 16, 2012, 11:10 pm


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...


That is because the diode does not go in series with the pullup resistor to the base of the
transistor but in series with the D10 to connection of the base of the transistor.


--- bill


maybe now i have a bigger problem lol, so, in this case I have to connect the Anode to BT (D10) and the Catode to the the base of the transistor?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Jul 16, 2012, 11:21 pm
To be clear, something like this?  
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 16, 2012, 11:39 pm
Almost, The diode is flipped/reversed. (I think you would have quickly figured it out)
The diode is used to isolate D10 from the circuit when D10 is high.
The pullup resistor is used to turn on the transistor.
The backlight will be on if D10 is input or HIGH.
Setting D10 to low turns off the backlight.
The diode allows D10 to yank the pullup down to gnd to turn off the transistor when D10 is low.

It works but really isn't a good design, I wouldn't design a circuit like this.

I did it this way because I couldn't easily desolder the LCD on the shield I had to replace
the transistor with an FET. (The transistor was underneath the soldered LCD module)

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: CarlosGz on Aug 14, 2012, 01:41 am

Almost, The diode is flipped/reversed. (I think you would have quickly figured it out)
The diode is used to isolate D10 from the circuit when D10 is high.
The pullup resistor is used to turn on the transistor.
The backlight will be on if D10 is input or HIGH.
Setting D10 to low turns off the backlight.
The diode allows D10 to yank the pullup down to gnd to turn off the transistor when D10 is low.

It works but really isn't a good design, I wouldn't design a circuit like this.

I did it this way because I couldn't easily desolder the LCD on the shield I had to replace
the transistor with an FET. (The transistor was underneath the soldered LCD module)

--- bill


Hey, thanks for your help, now I understand the question.
I finally won't be able to fix my lcd because of the pcb design and the components placement, so I decided to buy a new one at http://www.electrofunltd.com/ and I have been testing the FMalpartida's library with nice results...
By the way, I would like to reupload the schematic with the diode in a correct placement in case it can help someone :)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: amadeus_z on Aug 30, 2012, 12:06 am
Hello,

Not quite sure how to pick the most appropriate diode here for the D10 fix, could somebody take a look at the following

http://www.maplin.co.uk/search?criteria=diode&page=1

and advise which would be a good choice?

Many thanks,

Amadeus
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: amadeus_z on Aug 30, 2012, 11:45 pm
To answer my own question, and to help other users, I found that the "1A Schottky Barrier Rectifiers" on that page, in particular a 1N5817
worked well. Trick was to cut the track after bugging the diode on.

Worked well until I got over-confident with the "brief" part below:

Quote
Briefly (and I mean just a brief touch) connect the wire from D10 to Vcc.


Cue smell of burning and a slighty dimmer backlight, no on/off control. I imagine the transistor went.

Oh well. You win some you lose some.......
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bwims on Sep 03, 2012, 01:43 pm


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


It looks like robotshop is not dfrobot.
No warning here, and the schematic has not changed...
http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_%28SKU:_DFR0009%29

Bummer...
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MichaelMeissner on Sep 03, 2012, 02:33 pm
[quote author=bwims link=topic=96747.msg912548#msg912548 date=134667261
It looks like robotshop is not dfrobot.
No warning here, and the schematic has not changed...
http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_%28SKU:_DFR0009%29

Bummer...
[/quote]
Yes, robotshop is a distributor for various parts manufactured by others (DFRobot in this case makes the lcd shield).  I've used them in the past rather than ordering straight from DFRobot because Robotshop is USA based and shipping times are much less.  As I mentioned upthread, evidently robotshop hasn't changed the warning, but when I ordered the lcd shield in May, it was the fixed version where button 10 does control the contrast.

IIRC, you can't use servos and the lcd shield together on UNOs because the servo library disables PWM on pins 9 and 10.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MichaelMeissner on Sep 03, 2012, 02:34 pm

It looks like robotshop is not dfrobot.
No warning here, and the schematic has not changed...

Bummer...

Yes, robotshop is a distributor for various parts manufactured by others (DFRobot in this case makes the lcd shield).  I've used them in the past rather than ordering straight from DFRobot because Robotshop is USA based and shipping times are much less.  As I mentioned upthread, evidently robotshop hasn't changed the warning, but when I ordered the lcd shield in May, it was the fixed version where digital pin 10 does control the contrast.

IIRC, you can't use servos and the lcd shield together on UNOs because the servo library disables PWM on pins 9 and 10.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: liuzengqiang on Sep 05, 2012, 05:08 am
FYI, I am working on my phi-3 shield design right now, a revision of my popular LCD keypad shield with lots of add-ons. It will have what these generic shields don't. You may choose which pin drives the LCD back light and only 3 resistors for 6 buttons on one analog input, of course compatible with phi-1 and phi-2 software and phi_prompt user interface library. I will be releasing the 20X4 version shield first. It will also feature a small proto area for and IC up to 16 pins, for example, shift registers etc can be used to sense/control multiple things via the RJ-45 ports. You can also use DAC or other stuff on the proto area.

Here is an idea:
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bwims on Sep 05, 2012, 12:33 pm


It looks like robotshop is not dfrobot.
No warning here, and the schematic has not changed...

Bummer...

Yes, robotshop is a distributor for various parts manufactured by others (DFRobot in this case makes the lcd shield).  I've used them in the past rather than ordering straight from DFRobot because Robotshop is USA based and shipping times are much less.  As I mentioned upthread, evidently robotshop hasn't changed the warning, but when I ordered the lcd shield in May, it was the fixed version where digital pin 10 does control the contrast.

IIRC, you can't use servos and the lcd shield together on UNOs because the servo library disables PWM on pins 9 and 10.


Hi,  I'm curious about this.

My understanding is that pin 10 would control the brightness on boards with this bug - just that it puts a high current on the pin with the danger of frying it.   Have you done the test to see if the problem exists on your board, as described by the original poster?

Otherwise, I cannot see why DFRobot would not have updated their schematic.  Could it be that you are just lucky?

Also, you say pin 10 controls the contrast - do you mean brightness?  I thought a VR controlled the contrast?

B.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: ringz on Sep 06, 2012, 06:47 pm
I've just received an LCD shield that came in a DFRobot branded box from this vendor on ebay:

http://www.ebay.co.uk/itm/LCD-Shield-Arduino-/320919256375?pt=LH_DefaultDomain_0&hash=item4ab8473d37

The circuit diagram, for the version 1.0 I have, has a 10K resistor between D10 and the base of the transistor. I haven't tried it yet but I would say that the board I have has been fixed.

Martyn.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MichaelMeissner on Sep 08, 2012, 05:46 am

Hi,  I'm curious about this.

My understanding is that pin 10 would control the brightness on boards with this bug - just that it puts a high current on the pin with the danger of frying it.   Have you done the test to see if the problem exists on your board, as described by the original poster?


No, I haven't done a detailed test.


Otherwise, I cannot see why DFRobot would not have updated their schematic.  Could it be that you are just lucky?

There are 2 schematics at DFRobot, one labeled V1.0 that has the 10k resistor on pin D10 and the other V0.01 that does not have the resistor.  So to me it looks like they have updated the schematic.  Robotshop.com also has both schematics, but it has a third that is essentially the same as V0.01, and it still has the warning.


Also, you say pin 10 controls the contrast - do you mean brightness?  I thought a VR controlled the contrast?

An onboard potentiometer on the LCD shield controls the contrast.  Pin 10 controls the brightness.  The LCD backlight is visible on the side, and when I set pin 10 to low numbers, I can see it visibly becoming less bright, in addition to the screen.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: GannonW on Sep 15, 2012, 04:50 am
Hi

Im new here and have only owned my Arduino Uno and SainSmart LCD keypad for 3 days, but in reading how to use it I came across this thread. It has been very enlightening.

Is it right to assume that if I can only see 1 resistor beside the transistor under the LCD that my board has the issue?

Will it be ok as long as I dont use D10 in my code for brightness?

I have only made a few sketches so far like the sample scrolling message and I modified the key grabber that goes with this board.

Cheers
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 15, 2012, 06:33 am

Hi
Is it right to assume that if I can only see 1 resistor beside the transistor under the LCD that my board has the issue?

It might or might not, it depends on the circuit.

Quote

Will it be ok as long as I dont use D10 in my code for brightness?

It should be ok. The cirsuits with the problem are ok when D10 is an input.
So as long as D10 remains an input (which it is by default after are reset) the backlight should be on and
should not create any issues.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: GannonW on Sep 15, 2012, 02:33 pm
Thankyou for the quick response.

Is it possible to remove the D10 pin from the LCD board and solder a pot on there to make the backlight adjustable like the contrast is?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dhenry on Sep 22, 2012, 03:09 am
This is really a non-issue.

It would have been nice if the resistor is on the transistor's base.

But even if it is not, you can still control the backlight via the pin (D10): first, clear D10. After that, if you wish to turn on the back light, turn D10 into an input - the pull-up resistor will now turn on the switch / led; if you wish to turn off the back light, turn D10 into an output - now, D10 will be cleared thus turning off the switch / led.

If you do that in a timer, you can do software PWM and control the backlight brightness continuously.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 22, 2012, 03:43 am

This is really a non-issue.

I disagree. If the shield is unmodified and you don't handle the output of D10 correctly it
is possible to damage the AVR.

Quote

It would have been nice if the resistor is on the transistor's base.

But there is a resistor on the transistors base. It pulls up the base to VCC to provide a default "on" state.
The problem is that D10 is directly connected to the base.
My guess is that the circuit was designed for an FET and in that case D10 would
connect directly to the gate and the circuit would work perfectly "as is".
Then somebody cost reduced the design a few pennies and changed it to
a NPN transistor, which doesn't work the same as an FET and creates a short when D10 goes high. - But that is just my guess.

Quote

But even if it is not, you can still control the backlight via the pin (D10): first, clear D10. After that, if you wish to turn on the back light, turn D10 into an input - the pull-up resistor will now turn on the switch / led; if you wish to turn off the back light, turn D10 into an output - now, D10 will be cleared thus turning off the switch / led.

If you do that in a timer, you can do software PWM and control the backlight brightness continuously.



From the original post:
Quote
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.

And also in reply #3.
Quote
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.

PWM above meaning hardware PWM or analogWrite().

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dhenry on Sep 22, 2012, 01:28 pm
AVR's output, even in the push-pull mode, isn't a strong voltage source in that it has substantial output resistance. So even if you short the output pin (in a logic 1), you don't get much current (40-50ma maybe) out of it. The design here isn't a great design but it is not a deadly design either.

One of the schematics linked here had the led between Vcc and the transistor, without a resistor. If that's really the design, the led can draw substantial current under a 5v rail. Leds are pretty good at taking abuses but it is wise to put a resistor in serial with the led.

Quote
But that is just my guess.


It could have been designed for an open - collector type of output pin.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 22, 2012, 06:55 pm

AVR's output, even in the push-pull mode, isn't a strong voltage source in that it has substantial output resistance. So even if you short the output pin (in a logic 1), you don't get much current (40-50ma maybe) out of it. The design here isn't a great design but it is not a deadly design either.


My real world measurements on an actual LCD shield using this circuit differ from your guess.
I measured 95ma being sourced from D10 when D10 is high.
That is well beyond the 40ma maximum rating for the m328 listed in the
Absolute Maximum Ratings table (28.1) in the Electrical characteristic section.
There is also a footnote with that table:
Quote
Stresses beyond those listed under "Absolute
Maximum Ratings" may cause permanent dam-
age to the device. This is a stress rating only and
functional operation of the device at these or
other conditions beyond those indicated in the
operational sections of this specification is not
implied. Exposure to absolute maximum rating
conditions for extended periods may affect
device reliability.


Also down in note 3 subnote 2: (Arduino D10 is AVR port B bit 2)
Quote
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150 mA.


Add some additional i/o to digital pins D11 (B3),D12 (B4) and D13 (B5) and you might even
unexpectedly exceed the 150ma rating.

I take the electrical characteristics from the manufacturer very seriously and from my real world measurements
the un-modified shield vastly exceeds the manufacturers absolute maximum ratings for an i/o pin.
That is the reason that I would say the design could cause damage to the part.

In my opinion it is not worth the risk. Either don't use backlight control, modify the board,
or use D10 as recommended in the OP or in response #3 to avoid the short.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dhenry on Sep 22, 2012, 08:36 pm
Quote
I measured 95ma being sourced from D10 when D10 is high.


Did  your Arduino die from that experiment?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: liuzengqiang on Sep 24, 2012, 03:58 am

AVR's output, even in the push-pull mode, isn't a strong voltage source in that it has substantial output resistance. So even if you short the output pin (in a logic 1), you don't get much current (40-50ma maybe) out of it.


Stop misleading forum readers.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MerwinPaterwin on Nov 07, 2012, 04:41 am
Hardware Problem Solved, Software Sucks
I just got a SainSmart Keypad Shield 1602 LCD from eBay because it was cheap and had US shipping.  After some diddling (I'm an Arduino newbie), I got the example to work, but: 1) I was momentarily blinded by the backlight; and 2) the display flickered when I pressed a button.  It seemed as if the shield was drawing too much current.  I goggled the problem and found this forum.  I thought that II had the problem as in the first post in this topic from bperrybap,

I decided to rectify it with a diode or resistor fix.  The schematics provided from SainSmart with the library were the same as posted by bperrybap, and  showed the same problem, but my board, marked "LCD Keypad Shield V1.0",  wasn't exactly the same, especially around the D10 pin.  I took off the LCD display using my trusty hot air rework gun and a solder sucker and found there was indeed, as ringz, aka Martin, noted a 10k resistor in series with  D10 and the base.  Problem #1, sucking current from the Arduino, solved. 

So why does the display flicker??  It's in the library driver DFR_Key.cpp, which is a very poor driver, and in the example program Key_Grab.ino, which is a very poor example.  If the call to keypad.getKey() returns with anything other than SAMPLE_WAIT, the whole display is cleared (which takes a lot of time), and then refreshed (which takes even more time), rather then just refreshing the single character that contains the button number.  Plus, the DFR_Key.cpp program thinks a button has changed a lot more than it should.  If the A/D result differs by only one bit from the previous reading due to jitter, even though there may be no change in the button state, the driver incorrectly thinks the buttons have changed, causing yet more extraneous refreshes.

That's my 2c worth.  Bye...
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: liuzengqiang on Nov 07, 2012, 05:54 am
The value of arduino rests on the community. Those that exploits profits without supporting the community will not get your money a second time, will they? (they are so cheap thou, for a reason).
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dudemaster on Apr 02, 2013, 08:25 am
Heads up to anyone else!!
First- THANK YOU Bill!!
Just bought a Button-LCD shield by SainSmart- was looking for example code and found this thread- LUCKY ME!!
April 2013 and STILL the same problem- except on this board there is a 1K resistor where there is a 4.7k on the schematic!!
(took the LCD off the shield to look)
Trying your test caused the Arduino to disconnect from usb so it definitely shorted!!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: DanBeno on May 26, 2013, 08:55 am
Hey

I'm really new to all this.

Please could you help me with the display. I've tried to enter the code as is displayed, when I press "right" right is displayed. Pressing "left" displays select. "up" displays down. "down" displays left. And "select" displays nothing at all. I have tried adjusting the numerical values and have got it working except for the "select" button which I cant get to show anything at all. Any ideas why or how to rectify this?

Thanks

Dan
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: adrianf on Jun 17, 2013, 04:55 am
I am happy I came across this post. I have a Robot LCD keypad shield that the backlight flashes when I tryto use it I thought it was ready for the bin. Will try the mod and see what happens:)

Adrian
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: IonutV on Jul 09, 2013, 03:36 pm
Hy DanBeno! Have you tried the following configurations?

Code: [Select]

#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5

int read_LCD_buttons()
{
  x = analogRead(0);      // read the value from the sensor
  delay(5); //switch debounce delay. Increase this delay if incorrect switch selections are returned.
  int k = (analogRead(0) - x); //gives the button a slight range to allow for a little contact resistance noise
  if (5 < abs(k)) return btnNONE;  // double checks the keypress. If the two readings are not equal +/-k value after debounce delay, it tries again.
  // my buttons when read are centered at these values: 0, 144, 329, 504, 741
  // we add approx 50 to those values and check to see if we are close
  if (x > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
  if (x < 50)   return btnRIGHT; 
  if (x < 195)  return btnUP;
  if (x < 380)  return btnDOWN;
  if (x < 555)  return btnLEFT;
  if (x < 790)  return btnSELECT;   
  return btnNONE;  // when all others fail, return this…
}

lcd_key = read_LCD_buttons();
    checkBtns = false;
    switch(lcd_key){
    case btnRIGHT:
        Serial.println("btnRight");
        break;
      case btnLEFT:
        Serial.println("btnLeft");
        break;
    case btnUP:
        Serial.println("btnUp");
        increment = 1;
        break;
    case btnDOWN:
        Serial.println("btnDown");
        increment = -1;
        break;
    case btnSELECT:
        Serial.println("btnSelect");
        data_item++;
        break;
    default:
        break;
    }
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: cferrarini on Sep 06, 2013, 01:39 am
I Made the Diode Repair proposed by dweston and the keypad is perfect now!
The background led is dimming perfectly! I was lucky finding the diode 1N5817 in an old ethernet pci board!
Later I could measure the consumption through pins Vin and ground and the multimeter in amperes in series and 9v power source.
It can be measured also from the keypad itself. Then I uploaded the thest sketch on page 1, to test the dimming of backlight.

Only the arduino consumes 46 mA, with the Lcd Shield modified by the diode around 67mA and adding a jumper to it (original circuit) it consumes 150mA! I wonder all the lcd shields being sold will end up burning port 10 on the arduinos!
I received my arduino for less than a week and I´m loving it! I assume it is safe to let it plugged directly on the usb port since it is consuming far less than 500mA.

I Installed the IDE interface on Mageia Linux 3 and it worked without effort, http://forum.arduino.cc/index.php?topic=172877.0

Celso Ferrarini
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 06, 2013, 02:06 am

Only the arduino consumes 46 mA, with the Lcd Shield modified by the diode around 67mA and adding a jumper to it (original circuit) it consumes 150mA! I wonder all the lcd shields being sold will end up burning port 10 on the arduinos!

Probably not, since I'm guessing that most users are not even aware that their shield "supports dimming"
and even then they are using the stock LiquidCrystal library which does not support dimming.
And as long as they don't mess with the pin that is connected to the transistor, not bad happens and the backlight
is on


I received my arduino for less than a week and I´m loving it! I assume it is safe to let it plugged directly on the usb port since it is consuming far less than 500mA.

I use the USB port directly. Excess USB power shouldn't be an issue, but not everyone does things properly.
However, the small little USB extern USB  type drives pull up to 1 amp as they start up and most
USB ports can run them, so under 500ma will be fine.


I Installed the IDE interface on Mageia Linux 3 and it worked without effort, http://forum.arduino.cc/index.php?topic=172877.0

Celso Ferrarini


BTW, if you switch to fm's LiquidCrystal library, it is faster and has backlight support
including dimming:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home (https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home)
Title: Here is two more ways to fix this:
Post by: SuperLAVA on Sep 06, 2013, 03:31 am
This problem is real and my LCD branded Deekbot off eBay has same issue.

I think replacing bipolar transistor with FET is the cleanest solution, but I don't have suitable FET around and I'm not looking to procure it.

I hate to take LCD out of the shield to reach transistor or resistor and my hands too shaky to cut trace and solder diode, and I hate to look for additional parts like shottky ot germanium diode, but I can do two other things that do not require additional parts:

1. Pluck pull-up resistor from underneath LCD and run backlight control D10 as INPUT only. If you really up to it you may put  100K resistor from D10 to ground to prevent base from floating, but I don't think it's necessary.

2. Pluck transistor out from underneath LCD and connect D10 directly to LCDs pin 16. Resistor is irrelevant. D10must be an output, but control will be inverted - full bright will be 0 and dim 255. Outputs are plenty strong to drive LED directly.

These are two separate options, not two steps for same one!

Use something like small watch screwdriver to pluck part of your choice. If trace start delaminating - just cut it with same screwdriver.

I think these fixes are easier than others.

I just did second option - works as expected. Took 20 seconds + iron heating time. See attached pictures. Second picture is half -plucked transistor standing on it's hind (BE) legs before final termination.

Cheers y'all!

Title: Re: Here is two more ways to fix this:
Post by: bperrybap on Sep 06, 2013, 04:33 am

This problem is real and my LCD branded Deekbot off eBay has same issue.
Sure it is, which is why I created the thread.

I think replacing bipolar transistor with FET is the cleanest solution, but I don't have suitable FET around and I'm not looking to procure it.

I hate to take LCD out of the shield to reach transistor or resistor and my hands too shaky to cut trace and solder diode, and I hate to look for additional parts like shottky ot germanium diode, but I can do two other things that do not require additional parts:
Removing the LCD is quite difficult. I tried it. Getting all the pins cleanly de-soldered is a real pain
even with a de-soldering tool. The mod for the diode was actually much less work.


1. Pluck pull-up resistor from underneath LCD and run backlight control D10 as INPUT only. If you really up to it you may put  100K resistor from D10 to ground to prevent base from floating, but I don't think it's necessary.
Are you saying leave D10 connected to the transistor base? And then set D10 to INPUT to
turn on the backlight?
If so, that doesn't solve the problem since if you set D10 to HIGH you still have the "short".
The problem isn't the resistor between d10 and VCC it is that there is no resistor
between D10 and the base.
If using this "INPUT only" option, there is no need to remove the resistor.
since if you don't mess with D10, D10 will default to input and the resistor
will turn on the transistor so the backlight is on.
The problem is only if D10 is ever set to HIGH which also happens during PWM.
With the resistor removed, there may also be an issue with the transistor
turning on enough to fully light the backlight since the internal pullup on the AVR
(assuming it is enabled) won't provide much current to feed into the base.

There is a s/w approach mentioned at the bottom of response #3:
http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042 (http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042)
which didn't remove the resistor.
The limitation is that you can't do PWM to dim the backlight
and this method doesn't work with libraries like fm's library that assume
you set the output to HIGH or LOW  or can use PWM to control the backlight.



2. Pluck transistor out from underneath LCD and connect D10 directly to LCDs pin 16. Resistor is irrelevant. D10must be an output, but control will be inverted - full bright will be 0 and dim 255. Outputs are plenty strong to drive LED directly.
Disconnecting D10 from the transistor and driving the backlight directly might work.
I haven't measured the current on these backlights but many of the 16x2 backlights only
use a few milliamps.
Libraries like fm's allow configuring the polarity of the backlight control and will take care
of inverting the signals including with PWM.


These are two separate options, not two steps for same one!
Use something like small watch screwdriver to pluck part of your choice. If trace start delaminating - just cut it with same screwdriver.

I think these fixes are easier than others.

Cheers y'all!
Title: Re: Here is two more ways to fix this:
Post by: SuperLAVA on Sep 06, 2013, 05:52 am


This problem is real and my LCD branded Deekbot off eBay has same issue.
Sure it is, which is why I created the thread.

I think replacing bipolar transistor with FET is the cleanest solution, but I don't have suitable FET around and I'm not looking to procure it.

I hate to take LCD out of the shield to reach transistor or resistor and my hands too shaky to cut trace and solder diode, and I hate to look for additional parts like shottky ot germanium diode, but I can do two other things that do not require additional parts:
Removing the LCD is quite difficult. I tried it. Getting all the pins cleanly de-soldered is a real pain
even with a de-soldering tool. The mod for the diode was actually much less work.


1. Pluck pull-up resistor from underneath LCD and run backlight control D10 as INPUT only. If you really up to it you may put  100K resistor from D10 to ground to prevent base from floating, but I don't think it's necessary.
Are you saying leave D10 connected to the transistor base? And then set D10 to INPUT to
turn on the backlight?
If so, that doesn't solve the problem since if you set D10 to HIGH you still have the "short".
No, you don't. If set as INPUT then High will be driven with 20K to VCC. See http://arduino.cc/en/Reference/digitalWrite (http://arduino.cc/en/Reference/digitalWrite)
When writing Low to input it will be left floating. Leaving original transistor pull-up will prevent it from going low, this is why it have to be removed
The problem isn't the resistor between d10 and VCC it is that there is no resistor
between D10 and the base.Only if driven with high current. Setting D10 as Input will drive base through 20K internal pullup only, not through output mode PUSH wich can blow transistor or micro's output.
If using this "INPUT only" option, there is no need to remove the resistor.Wrong. With resistor present it would never go LOW. Removing it or even adding weak pull down will assure low potential on base and closing of transistor.
since if you don't mess with D10, D10 will default to input and the resistor
will turn on the transistor so the backlight is on.Correct, but you can't drive it low without setting as output. Unless, once again, you remove resistor.
The problem is only if D10 is ever set to HIGH which also happens during PWM.
With the resistor removed, there may also be an issue with the transistor
turning on enough to fully light the backlight since the internal pullup on the AVR
(assuming it is enabled) won't provide much current to feed into the base.20K pullup is plenty to drive this transistor.

There is a s/w approach mentioned at the bottom of response #3:
http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042 (http://forum.arduino.cc/index.php?topic=96747.msg739042#msg739042)
which didn't remove the resistor.
The limitation is that you can't do PWM to dim the backlightYep, same as here, but for different reason.
and this method doesn't work with libraries like fm's library that assume
you set the output to HIGH or LOW  or can use PWM to control the backlight.
Analog write will automatically make pin output (I think so), so yes, you can't do dimming with it, but you still can control on/off. Depending on your application (library reuse?) some might prefer it. Just another available option.


2. Pluck transistor out from underneath LCD and connect D10 directly to LCDs pin 16. Resistor is irrelevant. D10must be an output, but control will be inverted - full bright will be 0 and dim 255. Outputs are plenty strong to drive LED directly.
Disconnecting D10 from the transistor and driving the backlight directly might work.
I haven't measured the current on these backlights but many of the 16x2 backlights only
use a few milliamps.Correct. As I.ve mentioned I already did it and it works. Definitely less stress for chip than driving straight base-emitter junction.
Libraries like fm's allow configuring the polarity of the backlight control and will take care
of inverting the signals including with PWM.
I just did conversion in my code : 255-backlight

These are two separate options, not two steps for same one!
Use something like small watch screwdriver to pluck part of your choice. If trace start delaminating - just cut it with same screwdriver.

I think these fixes are easier than others.

Cheers y'all!



GOOD TALK!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 06, 2013, 07:05 am
We are in general agreement and I think both of us
misunderstood each other.
We have two different approaches for avoiding the D10 output HIGH
issue when offering backlight on/off control.
One method involves a hardware mod and s/w while the other is s/w only.

Your first explanation was not clear enough to me to be able to tell how you were intending
to use the output pin since you didn't fully describe it.
From your first description it appeared that you were just setting the pin to INPUT
and nothing else.
I now see that you intended to control the backlight on/off.


However, this approach and the s/w only approach from response #3 both
have the same issue of a "short" when D10 is an output and driven HIGH.
The reason is exactly the same whether the resistor is present or not.
(No current limiting from D10 into the base).

i.e. if s/w is loaded into the board that programs D10 as output and drives it high
BOOM... There is a problem - regardless of whether the resistor is removed.

So while either method can offer on/off backlight control,
neither protects the hardware from damage and
neither can support PWM because the first thing analogWrite() does is
make the pin an output as it turns on PWM which will
be driving the pin high.

The difference between the two
is that one requires a hardware mod AND special/odd s/w
and the other is only special/odd s/w.



The h/w and s/w method:

- cut/remove resistor under LCD
- possibly add weak pulldown resistor to D10

- set D10 to INPUT
- turn on pullup to turn on backlight
(AVR m328 spec says 20k to 50k, worst case of 50k is that enough to turn on the transistor for backlight? .1ma ?)
- turn off pullup to turn off backlight.

Alternatively with IDE 1.0.1 and beyond the s/w part reduces to be:
(with no initial setting of D10 to any state or level)
Code: [Select]

pinMode(D10, INPUT); // turn off backlight
pinMode(D10, INPUT_PULLUP); //turn on backlight





The s/w only method:
- set D10 to LOW (only once)
- set D10 to OUTPUT for backlight off
- set D10 to INPUT for backlight on

Alternatively, with any version of IDE this reduces to:
(with no initial setting of D10 to any state or level)
Code: [Select]

pinMode(D10, OUTPUT); // turn off backlight
pinMode(D10, INPUT); // turn on backlight


This works because OUTPUT sets the output of the pin to LOW as well
which will pull the transistor base down which will turn off the backlight.
Since the pullup still in place on the LCD shield, there is no need
to turn on the D10 pullup, just setting it to INPUT mode will allow the shield pullup to drive
the transistor to turn on the backlight.



Given both methods have the same limitations
and they both reduce down to very similar s/w operations to control the backlight,
my preference would be for a s/w only solution.

I had talked to fm just after I started this thread
about adding support for this s/w only method to the lcd library
as an option but we came the conclusion that there is no guarantee that the user will
provide the correct information to the constructor.
And since you really can't tell things are broken, because it seems to work,
when you are shorting out the D10 pin by driving it HIGH, we opted not to provide it.
(Its also a  strange and very narrow usage case as well)


--- bill






Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: SuperLAVA on Sep 06, 2013, 07:42 am

We are in general agreement and I think both of us
misunderstood each other.
We have two different approaches for avoiding the D10 output HIGH
issue when offering backlight on/off control.
One method involves a hardware mod and s/w while the other is s/w only.

Your first explanation was not clear enough to me to be able to tell how you were intending
to use the output pin since you didn't fully describe it.
From your first description it appeared that you were just setting the pin to INPUT
and nothing else.
I now see that you intended to control the backlight on/off.


However, this approach and the s/w only approach from response #3 both
have the same issue of a "short" when D10 is an output and driven HIGH.
The reason is exactly the same whether the resistor is present or not.
(No current limiting from D10 into the base).

i.e. if s/w is loaded into the board that programs D10 as output and drives it high
BOOM... There is a problem - regardless of whether the resistor is removed.

So while either method can offer on/off backlight control,
neither protects the hardware from damage and
neither can support PWM because the first thing analogWrite() does is
make the pin an output as it turns on PWM which will
be driving the pin high.

The difference between the two
is that one requires a hardware mod AND special/odd s/w
and the other is only special/odd s/w.



The h/w and s/w method:

- cut/remove resistor under LCD
- possibly add weak pulldown resistor to D10

- set D10 to INPUT
- turn on pullup to turn on backlight
(AVR m328 spec says 20k to 50k, worst case of 50k is that enough to turn on the transistor for backlight? .1ma ?)So average LED run at 20mA, 10 typical. You need gain of 200+. Most of these small transistors have current gain of 200-500 on average. I think it is sufficient.
- turn off pullup to turn off backlight.

Alternatively with IDE 1.0.1 and beyond the s/w part reduces to be:
(with no initial setting of D10 to any state or level)
Code: [Select]

pinMode(D10, INPUT); // turn off backlight
pinMode(D10, INPUT_PULLUP); //turn on backlight


Correct. Or after initial setup as input just do regular digital write (but not PWM!).





The s/w only method:
- set D10 to LOW (only once)
- set D10 to OUTPUT for backlight off
- set D10 to INPUT for backlight on

Alternatively, with any version of IDE this reduces to:
(with no initial setting of D10 to any state or level)
Code: [Select]

pinMode(D10, OUTPUT); // turn off backlight
pinMode(D10, INPUT); // turn on backlight

Correct. But you have to be careful and assure not to set output High.

This works because OUTPUT sets the output of the pin to LOW as well
which will pull the transistor base down which will turn off the backlight.
Since the pullup still in place on the LCD shield, there is no need
to turn on the D10 pullup, just setting it to INPUT mode will allow the shield pullup to drive
the transistor to turn on the backlight.



Given both methods have the same limitations
and they both reduce down to very similar s/w operations to control the backlight,
my preference would be for a s/w only solution.

I had talked to fm just after I started this thread
about adding support for this s/w only method to the lcd library
as an option but we came the conclusion that there is no guarantee that the user will
provide the correct information to the constructor.
And since you really can't tell things are broken, because it seems to work,
when you are shorting out the D10 pin by driving it HIGH, we opted not to provide it.
(Its also a  strange and very narrow usage case as well)


--- bill




Bill,

Good points, no other arguments. It is good drill for crowd to understand all options. And yes, software only fix is better, or rather more convenient but it is still short of full functionality and compatibility. I believe, and this is why I did  implement my option 2 - removing transistor. It is safe, no additional parts required, full functionality preserved, tho some software adaptations of existing code might be necessary.

Best regards!

Sal
Title: Some observations - and what a relief!
Post by: Paul__B on Oct 29, 2013, 02:47 pm
As I came to this thread, I was most concerned because I had been running a shield for some weeks, just to see how high the seconds counter would go.  In the event, the thunderstorm came first (and we had more today).

I was not quite sure how to determine whether this was a faulty or "fixed" board, so to test it I used the "Diode Test" range on the meter to test between D10 and ground on the shield - sure enough, it read 0.7V.

OK, I'm not happy.  My solution?  Well, I note that the holes on the LCD panel itself are unusually big, and it is relatively easy to suck out the solder on the top side (partially as it turns out that there is only solder on the top side anyway, it has not fully filled the holes).  Where pins were still "tacked" to the sides of the holes after a second suck (it is often useful to put more solder on the connection for a second suck, so that it is all liquefied by adequate contact with the iron), they could generally be released by warping or twisting the pin with tweezers (that is a pair of epilation tweezers in the photo!).

Now revealed is R7 and the transistor.  I don't know about the original, but R7 on this specimen (note all the spelling mistakes) is not 10k, it is actually 1k!  What I did was to shave out the track between R7 and the transistor and move it over this gap - the pads already suited the purpose.

Many other alterations are possible but I did not fancy finding my SMD stocks, so now D10 connects to the transistor via 1k and nothing else.

Next I mounted the shield and plugged in power.  Nothing appeared.  Until at least, I looked closer.  In fact, the test sketch was running as before, but no light.  No voltage (at all!) on D10 either, unless I put the multimeter on low volts between D10 and Vcc, when I saw some light.

Had I fried a pin on a Mega2560?  Well, no.  The sketch is Mark Bramwell's July 2010 LCD panel test which uses the six-argument LiquidCrystal lcd constructor which makes no reference to port 10, thus it remains an input.  Adding the lines
Quote

pinMode(10, OUTPUT);
digitalWrite(10, HIGH);        // set the LED on
brings up the LED illumination and in fact, commenting out the first so that port 10 remains an input, makes virtually no difference though the voltage on D10 is only about 0.8V rather than near Vcc.

So I have a shield which is (now) safe, but expects D10 to be activated, if only using the internal pull-up.

A thought - if the digitalRead() call actually reads the pin state, then it would be possible to set it high as an output, then immediately test it to see if it is actually high, and if not, deem it to be shorted and alter the sketch behaviour accordingly.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Oct 29, 2013, 06:38 pm
Paul_B,
I really like the idea of testing/reading the D10 pin state after setting the pin HIGH.
Luckily the digitalRead() code reads the PINx register vs the PORTx register so this is possible.
What I'm not sure of is how much the output pin droops. If it droops enough
to be read as a LOW (which I'm assuming that it does given the "short"), then it
could be used to make a great little test sketch to tell people if their
shield has this issue.



On an actual "fix"
A better alternative  to moving the resistor would be to replace the transistor
with an FET like a 2n7000.
That way you can still leve the pullup resistor in place to ensure the backlight
is on by default and there is no issue of shorting out D10  like with a NPN transistor
since the FET gate doesn't draw/sink current like the NPN base does.


--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Paul__B on Oct 29, 2013, 10:44 pm

What I'm not sure of is how much the output pin droops. If it droops enough to be read as a LOW (which I'm assuming that it does given the "short")

With the base-emitter junction of a transistor pulling it down, it will droop, make no mistake!  The technique would not be so useful to detect for example, being connected to the backlight LED with no series resistor.


A better alternative  to moving the resistor would be to replace the transistor with a FET like a 2n7000.

Presupposing you have a drawer full of surface-mount FETs.  I do not, and being late at night, I did not feel like exhuming my SMD resistor stock from the garage either.  XD




I asked Nick to make this a "sticky" as the matter is to my mind, just so important (with the clear risk of damage to MCU boards).
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Oct 30, 2013, 12:39 am
The backlight pin output does seem to droop low enough on an unmodified shield
when attempting to turn on the backlight.
I created a sketch that will automatically detect if the shield
has a backlight circuit issue.
It will display results on the LCD.
See the sketch for full details.
It is attached.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: wmassey on Nov 24, 2013, 04:33 am
I decided to bite the bullet and separate the LCD module from the LCD/keypad shield I have. Unsoldering 16 pins simultaneously is a challenge but it can be done if most of the solder is sucked out of the holes and then you wiggle the two boards relative to each other and also wiggle each pin in each hole for a while to break loose any solder that does remain.  I found an SOT-23-3 transistor labeled AM1 (like this one http://www.digikey.com/product-detail/en/SMMBT3904LT1G/SMMBT3904LT1GOSTR-ND/3062754 (http://www.digikey.com/product-detail/en/SMMBT3904LT1G/SMMBT3904LT1GOSTR-ND/3062754) ) installed on the lower board.  I got this 2N7002 FET as a replacement for the transistor: http://www.digikey.com/product-detail/en/2N7002,215/568-1369-1-ND/763366 (http://www.digikey.com/product-detail/en/2N7002,215/568-1369-1-ND/763366). Soldering something that is as tiny as one of these is also a challenge and you need to have a good soldering iron with a needle tip to attempt it. After connecting everything back together it works.

I found that the following code could be used to turn the backlight on or off or any value in between.

  pinMode ( BACKLIGHT_PIN, OUTPUT );
  analogWrite ( BACKLIGHT_PIN, 64);        // a value of 000  (off) to 255 (on) controls PWM%
  //digitalWrite ( BACKLIGHT_PIN, HIGH );  // turn on backlight
  //digitalWrite ( BACKLIGHT_PIN, LOW );   // turn off backlight

  lcd.begin(16, 2);              // start the lcd object
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: C2 on Dec 25, 2013, 10:33 pm
Hi All,

Just discovered this issue in my LCD shield.

[edit: I just replaced the transistor with a 2n7002 (marked 702  3d salvaged from a random PCB), since I shorted the transistor that was in there trying one of the earlier suggestions. Whew!]

[edit2:  that lasted a few minutes. I had a simple timer to turn off the backlight after 60 seconds. After a few cycles, instead of going off, the backlight flickered and then went off permanently. I've now cut the trace to D10, the gate voltage is 0.34V, 2.4V on LCD pin 15. I can jump the gate voltage to 5V and measure about 40mA, and the backlight will then go on. So the mosfet seems to be working. Seems like the 4.7K resistor is open or maybe there is not enough to drive the mosfet?]



I have these small signal diodes: PMBD914
datasheet: http://www.nxp.com/documents/data_sheet/PMBD914.pdf

Will that diode work here?

If so, I can cut the trace from arduino pin 10 on the shield. Do I solder pin 3 of the diode to arduino side pin 10?

Thanks!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: AJITnayak on Dec 26, 2013, 11:52 am
Is there any supplier in INDIA
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dhalbert on Jan 21, 2014, 02:07 am
I bought an OSEPP 16x2 LCD display shield today (16X2SHD-01 (http://osepp.com/products/shield-arduino-compatible/16x2-lcd-display-keypad-shield/)) and found it has the same issue. The test sketch posted here reports it as "BAD". There is a 1K pullup resistor and no base resistor (schematic from OSEPP (http://osepp.com/wp-content/uploads/2013/06/OSEPP_LCD_Keypad_Shield_V1-0-SCH1.pdf)). Intriguingly, I can just barely see an empty SMD outline next to the 1K resistor. I tried removing the display to see how easy it would be to add a base resistor, but failed: my only desoldering tool is a solder sucker and some pads were starting to lift.  So I'll live with it for now: I don't really need to control the brightness for the simple projects I have in mind.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 21, 2014, 02:14 am
dahlbert,
I'd recommend reporting the issue to them.
Maybe post a thread on their support forum.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dhalbert on Jan 21, 2014, 02:21 am
I'd recommend reporting the issue to them.
Maybe post a thread on their support forum.

Will do. I am now awaiting registration approval on their forum.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: flyingfish on Jan 24, 2014, 10:20 am
Hi All, This is my first post and I hope I have not broken any rules unknown to me. Thank you for the heads up on the backlight D10 NPN issue and the work-arounds. Well done to all. In my case I am using the PCF8574 Remote 8-bit I/O expander for I2C-bus LCD 'backpacks' and am wondering if the same issue is at hand when the 8574 drives the J3Y S8050 NPN transistor on those particular boards. They seem to have the same LED circuit as the LCD shields. See attached. Kind Regards to all.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 24, 2014, 10:16 pm
Good catch and great question.
Slightly off topic, but still a bit relevant.
The PCF8574 uses quasi bi-directional i/o pins.
This is done by using the data in the port register as the direction bits.
If the bits are a 0, the pin is an output as driven low.
If the bits are 1, then the pin is an input and a pullup is turned on.
The result is that PCF8574 can only sink current or drive pins low.
When the bit is 1, then the pin becomes an input with a pullup resistor
so it can't source much current.

The "short" issue in this circuit is when the base of the transistor is high.
Since the PCF8574 can't really drive current with a high output signal, (it only turns on a pullup),
it doesn't create an issue since there is no "short".
Essentially the circuit is taking advantage of the internal design of the PCF8574.
That said, do I think the designers of this board intentionally did this?
Probably not,  I think more than likely they got lucky.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: flyingfish on Jan 25, 2014, 11:37 am
Dear Bill, Your explanation regarding the I2C PCF8574  backpack is well put indeed.  The PCF8574 datasheet mentions 'Latched outputs with high current drive capability for directly driving LEDs.' But closer reading reveals that this relates to current sink of 25mA and current source of up to 300uA with a 1mA transient pull-up current for one clock pulse only.  I was worried as I have a system in the tropics that uses both the LCD shield and I2C backpacks. My concern was that the operating temperature peaks around 58degC (136degF) and I was worried that I may cook the D10 pin at elevated operating temps. Luckily, the PWM LED dimming function has not been selected yet...

May I say this entire thread has been most helpful and I thank all who have contributed.  I do hope I will be able to provide some assistance with regard to aspects of my arduino system applications in the future.

F.Y.I. my LCD shields (varying designs old and new) all fail the backlight test, and on pcb inspection reveal direct connection to D10. I will be installing FETs on all shields. Bill, thank you for your time to respond so quickly.

- Gary
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Rocketeer503 on Jan 26, 2014, 12:56 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Reb9 on Jan 29, 2014, 11:31 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 30, 2014, 12:44 am
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 (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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Reb9 on Jan 30, 2014, 06:51 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Ceramiclover on Feb 16, 2014, 03:47 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Feb 16, 2014, 08:30 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jerrybass1955 on Feb 25, 2014, 08:55 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Feb 25, 2014, 09:07 pm

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jerrybass1955 on Feb 26, 2014, 08:30 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: drdanielfc on Apr 03, 2014, 05:51 am

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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 17, 2014, 06:38 am

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:

Quote
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
.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nicw on Apr 19, 2014, 08:33 am
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.
(http://www.dvdinfopro.com/images/digitalpins.jpg)

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..




Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 19, 2014, 08:46 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nicw on Apr 20, 2014, 12:17 am
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  ;)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 20, 2014, 05:14 am

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nicw on Apr 20, 2014, 08:37 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 20, 2014, 07:49 pm

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:
Quote
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

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MichaelMeissner on Apr 20, 2014, 08:02 pm

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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nicw on Apr 21, 2014, 05:28 am
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.  ;)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: drdanielfc on Apr 22, 2014, 12:24 am

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  :smiley-red:
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 22, 2014, 12:52 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: drdanielfc on Apr 22, 2014, 12:56 am

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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 22, 2014, 08:27 pm

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.
Title: Thanks for the fix!
Post by: sunglint on May 07, 2014, 02:33 am
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!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on May 07, 2014, 02:37 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: whiteglint143 on May 08, 2014, 09:37 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Fyod on May 21, 2014, 01:25 am
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!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on May 21, 2014, 01:59 am

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.


Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: whiteglint143 on May 21, 2014, 09:28 am

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: https://www.sparkfun.com/products/10926


Hope this helps!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: scott-nightingale on Aug 03, 2014, 05:19 am
OP I just tested your sketch and it's fried my brand new Leonardo board :smiley-eek:

Looks like I've got the same LCD keypad shield as you.  I brought it ages ago here http://www.dx.com/p/lcd-keypad-shield-for-arduino-duemilanove-lcd-1602-118059#.U92lVXWj23A  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 http://www.dx.com/p/diy-eduino-leonardo-module-blue-black-213956#.U92p13Wj23A

Still I just thought I'd warn anyone else of the potential danger of running the sketch.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Aug 03, 2014, 06:34 pm

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

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: scott-nightingale on Aug 03, 2014, 11:31 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Aug 04, 2014, 01:14 am

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: phoenixcomm on Aug 15, 2014, 01:57 pm
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...
???
:smiley-roll-blue:
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Aug 15, 2014, 06:19 pm

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...
???
:smiley-roll-blue:

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

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: twallace51 on Sep 14, 2014, 11:17 pm

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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 15, 2014, 12:09 am
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.
Quote

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



Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: KenF on Jan 04, 2015, 08:42 am
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.)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: tvcsantos on Jan 22, 2015, 04:12 pm
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 (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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: KenF on Jan 22, 2015, 08:00 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: --EasY-- on Feb 05, 2015, 09:39 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Feb 12, 2015, 11:12 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: PilotPhil on Feb 14, 2015, 06:35 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: KenF on Feb 14, 2015, 07:39 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: ShapeShifter on Feb 14, 2015, 09:35 pm
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:
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Wile on Apr 01, 2015, 02:11 am
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 ?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Wile on Apr 01, 2015, 09:38 am
I had a response from DFRobot. I paste it here.

Quote from: 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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: scrungy_doolittle on Jun 03, 2015, 03:49 pm
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.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: ShapeShifter on Jun 03, 2015, 05:04 pm
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 (http://mayhewlabs.com/products/go-between-shield)? It lets you rearrange any and all pins as needed.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jun 03, 2015, 07:31 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: LMI1 on Aug 19, 2015, 09:24 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: tmd3 on Aug 20, 2015, 12:03 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: LAectronic on Sep 19, 2015, 06:05 am
I can not believe that this is still a problem after 2½ years.

Not having the confidence to seperate the LCD from the board (and wanting a permanent solution) I am going to make a shield board that goes between the LCD shield and the UNO. This will allow me to add the components between the shield and UNO and give me a permanent protection. I may even add a variable resistor to give some control over LCD brightness.
This is not an asthetic solution but should protect the UNO from any damage.

It would be good to have a record of which shields by manufacturer (both official and clone) that actually work out of the box and those that definately have the problem. This has certainly convinced me to look at the official boards next time rather than the cheaper cloned boards.

My shield is a "DFRobot eBay clone" with identifying codes on the shield board - B74493  120900393


-- Lance
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2015, 07:46 pm
I can not believe that this is still a problem after 2½ years.
The world is full of faults. They are everywhere once you start to look around.

Quote
Not having the confidence to seperate the LCD from the board (and wanting a permanent solution) I am going to make a shield board that goes between the LCD shield and the UNO. This will allow me to add the components between the shield and UNO and give me a permanent protection.
Lance,
When necessary, I think it is easier and cheaper to modify the LCD shield rather than create a intermediate shield.
It is a pretty simple and inexpensive modification that in most cases does not require removing the LCD from the shield.
Don't forget that do to a screw-up many years ago by the Arduino team, Arduino shields use a non standard pin spacing so you can just use a protoboard with headers on it for your intermediate shield. You either have to buy a pre-made shield or use stacking headers and bend them to get them to get them to align with the non standard spacing.
Bent stacking headers do "work",  but mechanically, they don't fit all that great and may eventually have electrical connection issues especially after many insertions.

If you don't really need backlight control (a feature that I think is a bit over rated anyway), a quick and easy solution would be to simply cut the D10 header pin on the LCD shield. The backlight will be permanently on but there will be no over current issue.
The standard LiquidCrystal library that comes with the IDE doesn't even support backlight control, so for the most part the issue is only for those that either change the library for a 3rd party library or are attempting to write their own s/w to control the backlight.

--- bill

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: LAectronic on Sep 20, 2015, 03:39 am
Don't forget that do to a screw-up many years ago by the Arduino team, Arduino shields use a non standard pin spacing so you can just use a protoboard with headers on it for your intermediate shield. You either have to buy a pre-made shield or use stacking headers and bend them to get them to get them to align with the non standard spacing.



You are right Bill, I have a stack of UNO proto boards and was going to use one of those. But after relooking at all the pics and identifying the pic that appears to match mine, it does seem to be an easy fix. My trace is on top of the board and easy to get to.
I shall place a diode across the trace. (It really does seem to be the easier option)

Now the second queery:
          I have some 1n4148  with some 1n34A coming. Is the 1n4148 sufficient
    or   should I opt to wait for the 1n34A to arrive?


Thankyou to everyone who has added to this thread. It is heartening to know that so many are prepared to share their knowledge and experiences to those of us who would have blundered around blindly unaware.

--  Lance
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Sep 23, 2015, 12:33 am
A 1N4148 should be fine. The current is a little over
one milliamp for a 5V VCC.
As I recall, these are rated at something in the 10's of milliamps.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: tmd3 on Sep 23, 2015, 01:29 am
The original post notes a problem with using a silicon diode, like the 1N4148, for this fix:
... 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 ...
To get the LED all the way off, the voltage on the transistor base has to be less than the forward voltage of the base-emitterjunction.  That's about the same as the voltage across a silicon diode.  It's not certain that the LED will go fully dark with a silicon diode.  With the lower forward voltage of a germanium diode, the base voltage will be lower than the voltage across a silicon junction, and the transistor will be reliably cut off.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Sep 24, 2015, 12:16 am
Thanks tmd3 for noting that.
I'd forgotten that the 1N34A was a germanium.
An option for using the 1N4148 would be to add
a power diode between the display and ground.
The drop across the power diode should safely turn off
the transistor.
It shouldn't be enough to keep the other parts from not
working.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: tmd3 on Sep 24, 2015, 01:20 am
I'm not sure that I know exactly where you contemplate adding a power diode in series with ground.  If it's between the overall ground for the board and the Arduino's ground, then that will reduce the supply voltage as seen by the LCD board, and it will also make the Arduino signals drive to a negative voltage, as seen by the LCD board.  It might work, or it might blow something up.

If the diode goes between the transistor's emitter and the board's ground, that bodes better.  The LED won't get quite as bright.  The base emitter junction may see a wee negative voltage, but not more than it can stand up to.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Sep 24, 2015, 05:37 am
No, two diodes. One from the displays ground to the arduinos ground.
That one is a power diode. A schottky would be best to keep the voltage to the display
from being to low. The other a silicon diode, such as a 1N4148. There won't be any
blowing up. There isn't enough voltage or current involved.
Germanium diodes age with time.
Dwight
 
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: tmd3 on Sep 24, 2015, 08:35 am
I still don't get it.  The Arduino has several digital outputs that connect directly to the display.  If you raise the level of the display's ground by a big diode forward drop, what keeps the Arduino outputs from going negative, relative the the display's ground? 

Maybe the display claims its inputs can tolerate that; I don't know.  But, if I'm understanding the notion correctly, I'm a bit leery.

Germanium diodes age with time.
Me, too.

[ Edit: spelling ]
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Sep 24, 2015, 03:55 pm
Most part use a diode on the input that clamps it. If you go below
its ground you'll turn on the diode.
Note I said to use a Schottky power diode. Its voltage drop is less
than a normal silicon diode.
Also look at the drive ability of the computer when close to the rail.
You'll see that it is no longer 20ma.
I doubt that you'll have any problem. It is not good design but it
would likely work without problem and would completely turn off the
transistor.
I wouldn't make a product like that but to fiddle with the display and
its bad design, it is not going to blow up the world.
If it really makes you squeamish, use a mos nfet transistor to ground
and you can then control it directly to the gate of the fet.
It is inverted but that shouldn't be an issue.
Using a low voltage fet will easily shunt the current of the 4k3 resistor.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Sep 24, 2015, 08:39 pm
I was looking and a typical nfet that would work is the
2N7002 that seems to be quite common.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jixe on Nov 14, 2015, 01:37 pm
Hello guys,
If anyone still reads this topic.. as an arduino newbie, can I ask a possibly silly question ?
I have just bought this LCD shield for messing about as it was cheap and plug and play.
Can I not just cut the pin 10 header pin at the LCD shield so there is no connection to the arduino. I understand that might mean the backlight is permanently on or off , but if that is the only problem and the
LCD is still fully usable apart from backlight adjustment that would be OK for me. I can't imagine the arduino would insist on something  being connected to that pin would it ?  I don't want to stack shields
or anything like that
Thanks

PS update - I just read bperrybap's previous post where he suggests the same.
I should be more careful.
Thanks anyway

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jixe on Nov 14, 2015, 04:13 pm
Hi again,

Just did the above i.e. cut pin 10 and with the lcd pins set to 8,9,4,5,6,7 in the sketch, it runs the
scrolling sketch just fine.Backlight full brightness. What more can I ask for 7 quid?
I guess I can still stack shields, it's just that the lcd will have to be on top, but then it would be
anyway if it's to be visible.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MAS3 on Nov 14, 2015, 04:21 pm
Hi and welcome.

It's silly to not ask questions that may rise.
But it's always a good idea to read an entire thread that is on topic, even if it has a large number of posts.
As you can see, this thread is still read when new posts are made.
Stacking shields still should be possible, but stacking a shield on top of a display shield (if possible at all) would be a bit silly.
If you would cut the pin off of the display shield, then pin 10 can be very well used by any shield between the Arduino and that display shield.
It takes some guts and some soldering skills, but in a later stage you could also repair the cut pin by replacing it by some other pin.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Dec 23, 2015, 11:42 pm
If you heat the soldered end of the pin on the shield, you can
pull it out. It doesn't take that much to pull it put.
That leaves a space between the shield and the arduino to
put a short pin and a wire to bring pin 10 out. A piece of tape between
on the shield to keep the end of the pin from shorting to the pad on the
shield as well.
One can then add the 1N34 or use a 2N7000 as I described ( it does
invert the pulse width control but that is just a software patch.
I just did this on my boards. It works fine.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: richard1899 on Jan 13, 2016, 09:23 pm
I am a robotics guy and a retired electronics engineer.  While I have used the Arduino for only about 3 years,I am new to this forum.

I have 12 of the very versatile DF Robot keypad 2X16 display shields (blue background-white characters only).  I have modified all of them for my use for over a year or two.

I don't care, nor have I ever cared, about adjusting backlight brightness.  As a roboticist I am far more concerned about having usable pins.  I use only the Uno rev 3 boards and after development use the $4.95 enhanced pro-mini (Marlin P Jones), as a replacement for the UNO in the final system, thereby getting the UNO back for future use.

By merely cutting the trace to pin 10 on the DF robot board, as in post #1, the LED lights to full brightness and the entire shield draws only 24.5 ma from a 5 volt supply....PLUS... I get pin D10 available for doing real important stuff rather than the mundane task of controlling backlight brightness which I want on full blast, anyway.

The display board has a natural current limit resistor on the back in series to limit current this is why the entire Df Robot board draws no more than 24.5ma at full brightness.

If you have a small system with a necessarily small and weak battery and need the dimming or complete blackout to save the milliamps, that is different.  I just leave mine on forever as long as the project is powered up as I choose sufficient battery capacity for this purpose and none of my stuff is miniature, limiting battery size.


A solution for those who want a lot of brightness and the extra digital/PWM pin.  Sure, not for everyone but very easy and you get the free pin.

Richard
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 13, 2016, 09:57 pm
On some lcd keypads, D10 is not accessible from the shield since they don't have female headers on the top side of the shield. In those cases, if you don't want/need backlight control, cutting the D10 header pin from the lcd/keypad shield might be easier than finding and cutting a trace on the PCB.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: dwightthinker on Jan 14, 2016, 11:30 pm
It is possible to do brightness from code without any parts.
In from an interrupt ( possibly feedback of a PWM signal ),
turn D10 from pinMode() input to output with the static
value of 0 as an output.
This way you never drive the pin high ( the condition that
over currents ). You still get brightness control.
Dwight
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 15, 2016, 12:26 am
It is possible to do brightness from code without any parts.
In from an interrupt ( possibly feedback of a PWM signal ),
turn D10 from pinMode() input to output with the static
value of 0 as an output.
This way you never drive the pin high ( the condition that
over currents ). You still get brightness control.
Dwight

The s/w work around of using input mode  and output LOW is mentioned in the first post and documented with some example code in a zip file in the second post.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Oscarko on Apr 14, 2016, 07:08 am
I read the beginning of the thread, then did some tests with my LCD shield (wow!) and figured out that the absolutely best and fastest way to deal with this small design oversight is to simply clip the D10 from every LCD shield. I am sure at some point a software fix will come back to hunt me, so this way I remember, LCD shield, clip 10th pin. 2sec fix and visible to naked eye if the fix is in.
Other permanent solution if power consumption is really big issue is to hardwire the shield bg led to ground through some resistor and effectively lower the backlight to 50 % or so where it is still visible.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Apr 14, 2016, 07:56 am
I am sure at some point a software fix will come back to hunt me,
You can't ever fix this h/w problem in s/w.
You have to fix or alter the h/w to completely eliminate the potential problem.
That said, there were some s/w work arounds proposed that can be used to offer backlight on/off control
(no dimming) without modifying the h/w. However, those s/w work arounds only avoid the problem and so the actual problem still exists and can cause issues when other s/w is used.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Nipper on Jun 01, 2016, 10:31 am
Thanks, great intel!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jazreenZIA88 on Jul 13, 2016, 07:52 pm
hmmm.... i'm not sure but i just had my 16x2 lcd keypad. and i use:

analogWrite(10,0); //to turn OFF the backlight

and even dim the backlight with:
analogWrite(10,50); // 0=OFF; 255=MAX power.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 13, 2016, 09:43 pm
hmmm.... i'm not sure but i just had my 16x2 lcd keypad. and i use:

analogWrite(10,0); //to turn OFF the backlight

and even dim the backlight with:
analogWrite(10,50); // 0=OFF; 255=MAX power.
Did you run the diagnostic test sketch to check to see if your shield has the h/w issue?

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jazreenZIA88 on Jul 13, 2016, 11:13 pm
no.

maybe they already fixed it. I just had the 16x2 lcd with keypad recently.
lucky me  :)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 13, 2016, 11:51 pm
no.

maybe they already fixed it. I just had the 16x2 lcd with keypad recently.
lucky me  :)
Maybe? I like to deal with certainties.
Unless you visually inspected it, used an ohm meter to verify it, or ran the diagnostic sketch, you can't know if it has been fixed or not.

Using analogWrite() and seeing dimming is no verification that it works as the broken hardware will also appear to work when used that way.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: jazreenZIA88 on Jul 14, 2016, 01:56 pm
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  :D
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 14, 2016, 05:33 pm
my 1602 lcd keypad shield have "D1 ROBOT" markings.
Irrelevant. What matters is the circuit design.
Quote
when you say "visually inspecting" it, does it translate to my shield and/or uno board getting fried?
I mean: Did you visually look at the board close enough to follow all the traces in the etch in the PCB to verify the circuit does not have the design with the issue.
From your comments so far it sounds like you did not do this.

Quote
i let it run for more than 30 minutes already using analogWrite and it appears okay to me.
That means nothing. Like I have said and stressed in the first post of this thread,
the broken h/w will appear to work.
Keep in mind that there is a big difference between something that "appears ok" and actually verifying that it truly does work correctly without issues.

Quote
i'm into software and noob in arduino  :D
Just run the diagnostic sketch I provided. It will tell if if your h/w has this issue.
You could have downloaded and run the diagnostic sketch in much less than 30 minutes.
Why continue down paths that won't provide the answer you need?

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: ngant17 on Nov 09, 2016, 04:08 am
Warning arrived a little too late for me.  I just plugged in a new DF Robot LCD shield and I'm pretty sure it fried some of the hardware components on my Arduino Uno.  I can use some real basic sketches on the Arduino but I suspect it did real damage internally as I can no longer run some of my most current sketches which were fine up until I plugged in the DF Robot LCD.

I'm staying away from this product for sure.  It's was a jinx or worse for my Uno.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Nov 13, 2016, 04:28 am
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  :D

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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Nov 13, 2016, 04:40 am
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: https://github.com/duinoWitchery/hd44780 (https://github.com/duinoWitchery/hd44780)

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

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: DrBockel on Dec 31, 2016, 03:26 pm
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

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: chopsuwe on Jan 11, 2017, 08:46 am
The DF Robot shield I got from Deal Extreme (http://www.dx.com/p/lcd-keypad-shield-for-arduino-duemilanove-lcd-1602-118059) 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 (http://www.dx.com/p/xd-05-arduino-arduino-data-logging-shield-module-244273). 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.

Code: [Select]

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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 11, 2017, 05:56 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: chopsuwe on Jan 12, 2017, 10:47 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 12, 2017, 06:38 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: masbass on Mar 03, 2017, 10:14 am
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: mrred128 on Mar 15, 2017, 02:34 am
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jun 01, 2017, 10:22 pm
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: mrred128 on Jun 02, 2017, 05:19 pm
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.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: GlennHarber on Sep 07, 2017, 01:57 pm
@pberrybap

Good job for supporting some users. 
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: queenbey on Nov 05, 2017, 07:49 pm

Please, DO NOT do this stupid thing.

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



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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Nov 05, 2017, 11:23 pm
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 (http://forum.arduino.cc/index.php?topic=96747.msg725978#msg725978).
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 (http://forum.arduino.cc/index.php?topic=96747.msg725978#msg725978).
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MTWallet on Jan 28, 2018, 07:04 pm
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!
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 28, 2018, 08:06 pm
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





Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MTWallet on Jan 28, 2018, 08:37 pm
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?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 28, 2018, 09:05 pm
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


Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MTWallet on Jan 28, 2018, 09:37 pm
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?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 28, 2018, 10:07 pm
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:
Quote
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 (http://forum.arduino.cc/index.php?action=dlattach;topic=96747.0;attach=243072)
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
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MTWallet on Jan 28, 2018, 11:48 pm
Thanks for helping me get my head wrapped around the correct interpretation of that schematic. Got it working with backlight control now and a good report from the test sketch.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 29, 2018, 12:05 am
Thanks for helping me get my head wrapped around the correct interpretation of that schematic. Got it working with backlight control now and a good report from the test sketch.
Cool! That is great.
Did you end up increasing the resistor values?
It isn't necessary but it would reduce the wasted power a bit.

I'm curious what did you use to remove the solder on the LCD pins?
I have a desoldering iron with a vacuum pump but it wasn't good enough for the job.

Are you using the hd44780 library which supports backlight control and auto-detects the keypad shield backlight circuit issue and does a s/w work around automatically if necessary?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MTWallet on Jan 29, 2018, 12:55 am
I went with the 10K Ohm resistor as that was what was listed in the other post about R7 being 1K (also it was what was on the new schematic.)

As to removal, I had to remove it twice. The first time I flush cut all the pins sticking through the bottom of the main board, then I added a good bit of solder to all those connections, not enough to bridge them, but pretty good blobs. Then I used my soldering station with a large tip on the iron and set it to about 450C and then ran that back and forth along the bottom of all the pins while pulling the LCD from the other side. This eventually liquified all the blobs enough for the pins to pull through. Then I cut the plastic pin holders on the bottom of the LCD so that each pin was separated and pulled them through the LCD while heating the other side with the iron at a more normal temperature. A little cleanup of the holes with some solder wick, and back in business. The raking did bang up the solder pads a little bit though. No serious damage, but they weren't so pretty anymore.

The second time I didn't want to accidentally kill any of the solder pads on the bottom with the raking, so I used my hot air rework gun on the top next to the LCD while pulling the LCD away from the bottom board. I wasn't too keen to do this as I was afraid the heat might damage the LCD panel, but it ended up being OK. Then I did the same cut pins and pull separately through the bottom board and clean holes with wick like I had done the first time. Once I got it all back together, I thought I had killed the LCD because the top 1/4 of it wasn't displaying, but fortunately it was just some flux that had wicked under the panel connector so after I took the display apart and cleaned up with some alcohol all was fine. (The 2nd time I put it back together I used some pin sockets on the main board instead of directly soldering the display to the board as I'm not concerned about depth.) So it was easy to get to the back of the LCD that time. Also I could get back to the resistors if the 10K didn't work out.

As for libraries, I haven't started using that yet. I am a complete newbie to arduino and honestly, right now I wouldn't even know what to do with the library if I added it.

Sorry for the long descriptions of desoldering, but maybe it will help someone in the future. And thanks again for the responses to help get me straightened out.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jan 29, 2018, 01:05 am
Very nice write up.
I didn't ever think of flush cutting the pins. I think that would be a big help.

For the library - called hd44780, it is noted in the first post and available in the IDE library manager.
It provides API functions to control the backlight, whereas the IDE bundled LiquidCrystal does not.
It is also much faster than the bundled LiquidCrystal library.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: fish118676 on Mar 24, 2018, 07:08 am
.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: HaplessDIY on Jul 24, 2018, 01:45 am
I cannot tell from all the postings if this shield is totally  dead ie not useable  unless this backlight  problem is resolved or are  there just some undesirable backlighting effects.  In the one I have I can turn the backlight down but all I see is  small  rectangles for where "hello world" should appear.



See attached photograph.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 24, 2018, 01:49 am
Did you run the diagnostic tool included in the hd44780 library to test the shield?
--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: HaplessDIY on Jul 24, 2018, 01:58 am
No I didn't.  I was hopping around from post to post and I saw something about someone blowing their board due to some test code.  If that test code is indeed valid and safe then I'll give it a try. 
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 24, 2018, 02:06 am
Well, if the shield has the backlight design flaw, then there is always the possibility of an issue.
However, the test code minimizes the amount of time that the Arduino pin is driven to try to avoid any issue.
The amount of time will be in milliseconds.
In real life I've done testing on my shield and have had the backlight control pin driven high for a minute or more without issue.

I've only heard of an issue from one person (earlier in this thread), and when I tried to contact them for more information as to what they had done, they didn't respond with they actually did so I have no idea what he really did to blow his Arduino board.

So far over the course of several years I've not heard anyone saying that running the diagnostic test sketch I provided damaged their Arduino.


--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: HaplessDIY on Jul 24, 2018, 02:31 am
OK, I understand that was "fake news" :smiley-confuse:
Anyway, if it has the design flaw does the display still work at all, should I be able to see some characters?  Does that bad design keep the screen from showing characters?
If the answer is that it only affects backlighting then there's no point in me trying test code.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 24, 2018, 03:00 am
OK, I understand that was "fake news" :smiley-confuse:
Anyway, if it has the design flaw does the display still work at all, should I be able to see some characters?  Does that bad design keep the screen from showing characters?
If the answer is that it only affects backlighting then there's no point in me trying test code.
Fake news? I have no clue what you were tying to say.

With these comments it sounds like you didn't read the initial post in this thread.
It describes the issue. It is a backlight control issue.
If the Arduino drives the pin connected to the backlight circuit on the shield, there is the potential to damage the AVR processor since the backlight circuit is pulling way over the allowed current that an AVR pin can safely supply. (and  other processors too)

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: HaplessDIY on Jul 24, 2018, 04:27 am
Fake news? I have no clue what you were tying to say.

With these comments it sounds like you didn't read the initial post in this thread.
It describes the issue. It is a backlight control issue.
If the Arduino drives the pin connected to the backlight circuit on the shield, there is the potential to damage the AVR processor since the backlight circuit is pulling way over the allowed current that an AVR pin can safely supply. (and  other processors too)

--- bill

Sorry Bill, I was trying to be funny about "fake news".  I suppose you don't follow politics much.  Good for you.

I did go back to the original post, download, and ran the code, sure enough BL Circuit BAD.  So now I have many answers if not all.  I just need to sort out the details.  In the meantime I will enjoy the flashing bad message.

If I can be so humble as to suggest, your original post should be in a "sticky" with no responses allowed. 
My problem was that I read your post and I decided, well, I better read all the next posts because there is obviously more to the story.  The more I read the more confused I got.  I am an EE and I have a garage full of 1n34 to schottky diodes maybe even gaas  its just that I got tangled up in a long thread  of suggestions and counter suggestions and I couldn't tell who or what to believe.

I think I read somewhere in the threads that a workaround can be had by just not connecting pin10.  I'll look into that one.  Somewhere I saw mention of a schematic but then it wasn't clear that it was an accurate schematic.

The only other comment I would make is that while it is a "backlight control" problem it will make it look like the LCD  doesn't work at all.

Thanks for writing that code.  Its a nice piece of work.  I will dig into it.

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 24, 2018, 05:07 am
The LCD should be working. The images that you posted looked like an LCD that was not initalized properly.
Perhaps you were not initializing what ever library you were using correctly.
i.e. if you used the HelloWorld sketch from the LiquidCrystal library "as shipped" it will not work with that shield as it uses different pins to control the LCD than the shield uses.

The backlight issue is actually a simple error in the design. They did not put a current limiting resistor in series with the Arduino pin driving the base of the transistor to limit the current being fed into the transistor. The transistor acts like a short to ground and allows more current to pass through it than the AVR pin is rated for.

The solution would be simple if you could get to the PCB area to add a resistor but on most shields the area you need to get to is underneath the LCD panel and desoldering it is pretty difficult.

There are several options in both s/w and h/w to deal with it.
You could use the hd44780 library instead of LiquidCrystal as it will check for the issue and work around it in s/w.
Or you could do a h/w mod to actually fix the h/w.
Or you could just make sure to never drive pin 10 high and let the backlight remain in its default state which is on when the Arduino pin is an input.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: HaplessDIY on Jul 24, 2018, 05:52 am
.e. if you used the HelloWorld sketch from the LiquidCrystal library "as shipped" it will not work with that shield as it uses different pins to control the LCD than the shield uses.

you are correct I was using the library "as shipped" so your code fixed that problem.  I would have never figured this out unless I would have dragged out a logic analyzer and captured the data and then studied the controller spec etc.  or I suppose followed all those circuit traces.  No way would I have spent that much effort.

Who figured out that the pin assignments were wrong?  Was that in the Shield information from these different suppliers?

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Jul 24, 2018, 06:04 am
Was that in the Shield information from these different suppliers?
A schematic...  ;)
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Aug 03, 2018, 01:44 am
And a drawing...
A schematic is a drawing.
No fancy tools are needed to see the pin connections. Just look at the schematic.
It was attached in the very first post of this thread.
And even if a schematic wasn't available, it would only take a few minutes to figure out the Arduino pins being used to control the LCD by using an ohm meter.


--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nielyay on Sep 12, 2018, 02:14 am
Hello,
Thank you for sharing :)
Title: Damage to LCD shield by manually wiring?
Post by: bumblepom on Sep 18, 2018, 01:12 am
My shield in duinotech XC-4454 2x16.
I've attached it to a Sainsmart UNO with the sketch below and it worked fine with good brightness.
Then, because I want to be using the Arduino without the shield actually pressed on, to free access to other pins, I reconnected it with jumpers, eyeballing the matching connections.  I initially connected just D4-9 plus 5v, gnd and A0.  I also experimentally connected other (matching I believe) pin with jumpers.
The display still works, i.e. gives the correct output w.r.t. button presses but the screen is very dim.  I'm not sure the backlight is on at all.
I pressed the shield back onto the UNO and still dim. I connected a 9v supply - no change.  I uploaded the sketch to a genuine Mega 2650 R3, pressed on the shield, and get the same result.

Is it possible/ likely I damaged the LCD (there is a transistor I read can be damaged?) by manually connecting pins?

Code: [Select]
// sketch 09-01 USB Message Board

#include <LiquidCrystal.h>

// lcd(RS, E, D4, D5, D6, D7)
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int numRows = 2;
int numCols = 16;
int sensorPin = A0;
int boo = 0;



void setup()
{

  Serial.begin(9600);
  lcd.begin(numRows, numCols);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Arduino");
  lcd.setCursor(0,1);
  lcd.print("Rules");
}

void loop()
{
  if (Serial.available() > 0)
  {
    char ch = Serial.read();
    if (ch == '#')
    {
      lcd.clear();
    }
    else if (ch == '/')
    {
      // new line
      lcd.setCursor(0, 1);
    }
    else
    {
      lcd.write(ch);
    }
  }
  testfunction();
}

//======

void testfunction()
{
boo = analogRead (sensorPin);
lcd.clear();
   lcd.setCursor(0, 0);
lcd.print (boo);
Serial.println (boo);
 delay (5000);
}
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 18, 2018, 11:20 pm
So, using the hd44780.h library and this sketch:

// LCDKeypadCheck - LCD keypad shield backlight circuitry test
// Copyright 2013-2016 Bill Perry

I get "BL circuit bad"  so I guess something has happened to damage the LCD circuits.  I've got another LCD 2 x 16 on order, this time not a shield (I don't want it clamped to the other board), and with the I2C backpack.  So  think I'll just move on.

EDIT: Does "BL circuit bad" refer only to the LCD shield itself or can it mean a damaged i/o pin on the AVR?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2018, 01:41 am
EDIT: Does "BL circuit bad" refer only to the LCD shield itself or can it mean a damaged i/o pin on the AVR?
It means the BL circuit on the shield is a bad design and has the short circuit issue on digital pin 10.
Which means that you need to be careful not to set D10 to HIGH as the high current draw could potentially damage the AVR.

I'll update the message to be a little clearer.
It will be in the next release of the code.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 19, 2018, 01:51 am
It means the BL circuit on the shield is a bad design and has the short circuit issue on digital pin 10.
Which means that you need to be careful not to set D10 to HIGH as the high current draw could potentially damage the AVR.

I'll update the message to be a little clearer.
It will be in the next release of the code.

--- bill
Thanks Bill
Pin 10 seems still OK (led flash output OK).  Is there an alternative pin-to-pin I can jump to turn on the backlight or is it likely to be permanently dead?
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2018, 02:04 am
The message display on the LCD by LCDKeypadCheck was left alone.
The comments in the sketch were updated to better explain what "BL circuit bad" means.
It will be in the next release of the library.
--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2018, 02:07 am
Thanks Bill
Pin 10 seems still OK (led flash output OK).  Is there an alternative pin-to-pin I can jump to turn on the backlight or is it likely to be permanently dead?
Not sure what you mean by "led flash output OK". The led on the Arduino board is pin 13.


If you use the hd44780 library, you don't have to worry about it. You can use the backlight control API functions to turn the backlight on/off as the library auto detects the issue and works around it to protect the Arduino.
If you try to use dimming [ the setBacklight() ] function, the library will disable dimming and revert to safe on/off only as dimming can't be done safely with that backlight circuit.

If you don't use the hd44780 library, don't manually control the backlight using digital pin 10 or attempt to use PWM on digital pin 10.
While it may appear to work, it can potentially damage the Arduino processor.

And no matter which library you use, don't ever set D10 to high unless you hardware modify your shield.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 19, 2018, 04:24 am
Not sure what you mean by "led flash output OK". The led on the Arduino board is pin 13.


If you use the hd44780 library, you don't have to worry about it. You can use the backlight control API functions to turn the backlight on/off as the library auto detects the issue and works around it to protect the Arduino.
If you try to use dimming [ the setBacklight() ] function, the library will disable dimming and revert to safe on/off only as dimming can't be done safely with that backlight circuit.

If you don't use the hd44780 library, don't manually control the backlight using digital pin 10 or attempt to use PWM on digital pin 10.
While it may appear to work, it can potentially damage the Arduino processor.

And no matter which library you use, don't ever set D10 to high unless you hardware modify your shield.

--- bill
I connected LEDS to pins D8 -13 (a clip-on mini shield) and No 10 functioned normally.

I added " setBacklight (255); "  within the setup of LCDlibTest but got "'setBacklight' was not declared in this scope".  I'll be talking to an experienced user later today so will try to sort it out with him.  But I'm still trying to understand: If it is most likely the circuitry within the shield is damaged, maybe it is impossible to turn on the backlight regardless of the SW.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2018, 04:54 am
It doesn't sound like anything is broken. The shield you have has a design flaw.
To really fix it requires a h/w modification. hd44780 can detect it and work around it but you will loose dimming capability
as dimming requires using the pin in way that could damage it with the shield you have.

The API functions are methods within the lcd object. So if your lcd object is named "lcd",
you would use lcd.backlight() or lcd.noBacklight() to turn the display on/off.

setBacklight(dimvalue) is for dimming, and while you could use that, dimming won't work if the shield has the BL circuit issue.
If the BL circuit is detected by hd44780, all values other than setBacklight(0) will turn on the backlight with no dimming supported.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 19, 2018, 05:07 am
Ok thanks.   So I added lcd.backlight(); as shown below (I temporarily stripped out a lot of text).  Now, the backlight has turned off completely.  It must have been on very dim before - I'm new to these displays so did not know.  But it was certainly a lot brighter the first time I tried it.

Code: [Select]
//
// vi:ts=4
// ----------------------------------------------------------------------------
// LCDKeypadCheck - LCD keypad shield backlight circuitry test
// Copyright 2013-2016 Bill Perry
// bperrybap@opensource.billsworld.billandterrie.com
// ---------------------------------------------------------------------------
//
// 2016.11.08 bperrybap  - updated for inclusion in hd44780 library
// 2013.10.29 bperrybap  - Original creation
//
// ---------------------------------------------------------------------------

#include <hd44780.h>
#include <hd44780ioClass/hd44780_pinIO.h> // Arduino pin i/o class header

// initialize the library with the numbers of the interface pins
// note that ESP8266 based arduinos must use the Dn defines rather than
// raw pin numbers.
#if defined (ARDUINO_ARCH_ESP8266)
const int rs=D8, en=D9, db4=D4, db5=D5, db6=D6, db7=D7; // for esp8266 devices
const int pin_BL = D10; // arduino pin wired to LCD backlight circuit
#else
const int rs = 8; // arduino pin wired to LCD RS
const int en = 9; // arduino pin wired to LCD EN
const int db4 = 4;// arduino pin wired to LCD db4
const int db5 = 5;// arduino pin wired to LCD db5
const int db6 = 6;// arduino pin wired to LCD db6
const int db7 = 7;// arduino pin wired to LCD db7
const int pin_BL = 10; // arduino pin wired to LCD backlight circuit
#endif

hd44780_pinIO lcd( rs, en, db4,  db5,  db6, db7);


/*
 * Macros to safely turn on the backlight even with back BL hardware
 * These assume that the BL pin is not touched or used after RESET other
 * than by these macros.
 */

#define SafeBLon(pin) pinMode(pin, INPUT)
#define SafeBLoff(pin) pinMode(pin, OUTPUT)

int status;

void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
  lcd.backlight();         //I ADDED THIS   
status = pinTest(pin_BL); // only run the actual test once

}

void loop()
{

lcd.clear();
if(status)
{
/*
* Shield has BL circuit issue
*/
lcd.print("BL Circuit BAD");
safeBlink(pin_BL, 5); // safely blink the backlight
}
else
{
/*
* Shield is OK (no BL circuit issue)
*/
lcd.print("BL Circuit GOOD");
softBlink(pin_BL, 2); // soft blink the backlight (uses PWM)
}

delay(1000);
}

/*
 * Function to test a backlight pin
 * Returns non-zero if test fails (bad circuit design)
 */
int pinTest(int pin)
{
int val;

/*
* Check to see if there
* is a problem in the backlight circuit
* So far, the "broken" designs connected D10
* directly to the base of a NPN transistor,
* this will cause a short when D10 is set to HIGH
* as there is no current limiting resistor in the path
* between D10 to the base and the emitter to ground.
*/

/*
* Set the  pin to an input with pullup disabled.
* This should be safe on all shields.
* The reason for the digitalWrite() first is that
* only the newer Arduino cores disable the pullup
* when setting the pin to INPUT.
* On boards that have a pullup on the transistor base,
* this should cause the backlight to be on.
*/
digitalWrite(pin, LOW);
pinMode(pin, INPUT);

/*
* Set the backlight pin to an output.
* since the pullup was turned off above by
* setting the pin to input mode,
* it should drive the pin LOW which should
* be safe given the known design flaw.
*/
pinMode(pin, OUTPUT);


/*
  * Set the backlight pin to HIGH
* NOTE: This is NOT a safe thing to do
* on the broken designs. The code will minimize
* the time this is done to prevent any potential damage.
*/

digitalWrite(pin, HIGH);


/*
* Now read back the pin value to
* See if a short is pulling down the HIGH output.
*/

delayMicroseconds(5); // give some time for the signal to droop

val = digitalRead(pin); // read the level on the pin

/*
  * Restore the pin to a safe state
* Input with pullup turned off
*/
digitalWrite(pin, LOW);
pinMode(pin, INPUT);

/*
* If the level read back is not HIGH
* Then there is a problem because the pin is
* being driven HIGH by the AVR.
*/
if (val != HIGH)
return(-1); // test failed
else
return(0); // all is ok.
}

void safeBlink(int pin, int count)
{
/*
* Safely blink the backlight on LCD shields that have
* broken BL hardware
* Uses the SafeBL macros defined above.
*/

while(count--)
{
delay(200);
SafeBLoff(pin); // turn on the backlight (safe to use for all shields)
delay(50);
SafeBLon(pin); // turn off the backlight (safe to use for all shields)
}
}

/*
 * soft blink the backlight.
 * NOTE: this should not be used on a shield
 * with a bad backlight circuit
 */
void softBlink(int pin, int count)
{
// soft blink the backlight by ramping down then back up
pinMode(pin, OUTPUT);
for(int times = 0; times < count; times++)
{
for(int x = 1; x < 16; x++)
{
analogWrite(pin, 256-x * 16);
delay(50);
}
for(int x = 1; x < 16; x++)
{
analogWrite(pin, x * 16);
delay(50);
}
}
}
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 19, 2018, 11:15 am
Ha...
With the LCD shield in place over the UNO, I tried shorting the solder terminal labelled "K" (next to "A" at the end of the row on top of the LCD board) to ground (next to 5v on the other lower shield surface) and the back light comes on with full brightness.  This is while the above sketch is running (i.e. displaying "BL circuit BAD").
So, the back light itself is not destroyed.

Edit:  And it draws 20 mA    "K" to ground.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 19, 2018, 09:13 pm
bumblepom,
What you have done will not work.
The diagnostic sketch is doing lots of things that are not typical/normal.
Do not try to use that code as an example of how to do things.
The diagnostic code tells the library that there is no backlight but then tries to control the backlight circuitry directly rather than let
the hd44780 library code handle it.
It must do it this way to get access to the information it needs to check and report about the backlight circuit.

You can't just try to throw in a backlight control call.
You are attempting to bypass certain things so it will not work.

You should run the diagnostic sketch "as is" to detect if there is an issue.
If there is an issue, the normal hd44780_pinIO code will detect it and work around it if you have told it you have backlight circuitry.
You do that by the information you put in the constructor.
See the HelloWorld sketch included in the hd44780_pinIO examples. It shows an example of using backlight control.

Now that hd44780_pinIO works around the h/w issue. You really don't have to worry about the h/w issue.
Just configure your lcd object constructor to include backlight parameters and all backlight API calls will work.
If the h/w has issues, the backlight will still work, but dimming will not work as you will get either full on or full off with no dimming.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 19, 2018, 11:11 pm
Bill:  Is this "configur(ing) your lcd object constructor to include backlight parameters"?
I just added and removed some // to expose the BL control lines.  BL remains off.

Code: [Select]
// vi:ts=4
// ----------------------------------------------------------------------------
// HelloWorld - simple demonstration of lcd
// Created by Bill Perry 2016-07-02
// bperrybap@opensource.billsworld.billandterrie.com
//
// This example code is unlicensed and is released into the public domain
// ----------------------------------------------------------------------------
//
// This sketch is for LCDs that are directly controlled with Arduino pins.
//
// Sketch prints "Hello, World!" on the lcd
//
// See below for configuring the Arduino pins used.
//
// While not all hd44780 use the same pinout, here is the one that most use:
// pin 1 is the pin closest to the edge of the PCB
//  1 - LCD gnd
//  2 - VCC (5v)
//  3 - Vo Contrast Voltage
//  4 - RS Register Select (rs)
//  5 - Read/Write
//  6 - Enable (en)
//  7 - Data 0 (db0) ----
//  8 - Data 1 (db1)     |-------- Not used in 4 bit mode
//  9 - Data 2 (db2)     |
// 10 - Data 3 (db3) ----
// 11 - Data 4 (db4)
// 12 - Data 5 (db5)
// 13 - Data 6 (db6)
// 14 - Data 7 (db7)
// 15 - Backlight Anode (+5v)
// 16 - Backlight Cathode (Gnd)
//
// ----------------------------------------------------------------------------
// LiquidCrystal compability:
// Since hd44780 is LiquidCrystal API compatible, most existing LiquidCrystal
// sketches should work with hd44780 hd44780_pinIO i/o class once the
// includes are changed to use hd44780 and the lcd object constructor is
// changed to use the hd44780_pinIO class.

#include <hd44780.h>
#include <hd44780ioClass/hd44780_pinIO.h> // Arduino pin i/o class header

// declare Arduino pins used for LCD functions
// and the lcd object

// Note: this can be with or without backlight control:

// without backlight control:
// The parameters used by hd44780_pinIO are the same as those used by
// the IDE bundled LiquidCrystal library
// note that ESP8266 based arduinos must use the Dn defines rather than
// raw pin numbers.
//#if defined (ARDUINO_ARCH_ESP8266)
//const int rs=D8, en=D9, db4=D4, db5=D5, db6=D6, db7=D7; // for esp8266 devices
//#else
//const int rs=8, en=9, db4=4, db5=5, db6=6, db7=7;       // for all other devices
//#endif
//hd44780_pinIO lcd(rs, en, db4, db5, db6, db7);

//with backlight control:
// backlight control requires two additional parameters
// - an additional pin to control the backlight
// - backlight active level which tells the library the level
// needed to turn on the backlight.
// note: If the backlight control pin supports PWM, dimming can be done
// using setBacklight(dimvalue);
//
// WARNING: some lcd keypads have a broken backlight circuit
// If you have a lcd keypad, it is recommended that you first run the
// LCDKeypadCheck sketch to verify that the backlight circuitry
// is ok before enabling backlight control.
// However, the hd44780_PinIO class will autodetect the issue and
// work around it in s/w. If the backlight circuitry is broken,
// dimming will not be possible even if the backlight pin supports PWM.
//
      #if defined (ARDUINO_ARCH_ESP8266)
      const int rs=D8, en=D9, db4=D4, db5=D5, db6=D6, db7=D7, bl=D10, blLevel=HIGH;
      #else
      const int rs=8, en=9, db4=4, db5=5, db6=6, db7=7, bl=10, blLevel=HIGH;
      #endif
    hd44780_pinIO lcd(rs, en, db4, db5, db6, db7, bl, blLevel);

// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;

void setup()
{
// initialize LCD with number of columns and rows:
//
// note:
// begin() will automatically turn on the backlight if backlight
// control is specified in the lcd object constructor
//
lcd.begin(LCD_COLS, LCD_ROWS);
// if backlight control was specified, the backlight should be on now

// Print a message to the LCD
lcd.print("Hello, World!");
}

void loop() {}
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 20, 2018, 12:49 am
Bill:  Is this "configur(ing) your lcd object constructor to include backlight parameters"?
Yes
See the extra two parameters in the constructor?
The back light pin and the active level.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 20, 2018, 01:13 am
Yes
See the extra two parameters in the constructor?
The back light pin and the active level.
But the BL stays off.

Is it not possible, regardless of the SW work-around, that there is no connection between the BL and the pins to the Arduino (e.g. due to blown transistor)?  I can detect no continuity between terminal K and any of the pins that connect the shield to the Arduino.

Since I do not want to plug the Shield into the Arduino anyway (I didn't realise the shield blotted out all the pins before I bought it - yes I'm new to Arduino but have been coding off and on since 1970 and worked with Picaxe).  I will be using a free-standing LCD display for my real project and in the meantime for learning I've soldered a jumper to LCD terminal K which when earthed on the Arduino board works just fine.  I guess, despite pin D10 working OK as an LED output, there may have been some damage between when the BL worked and when it didn't.  I'll see.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 20, 2018, 02:40 am
But the BL stays off.
Looks like you fixed the small coding error in the constructor.  (blLevel misspelled - that will be fixed in next release)
That should have turned on the backlight when begin() is called.

Quote
Is it not possible, regardless of the SW work-around, that there is no connection between the BL and the pins to the Arduino (e.g. due to blown transistor)?  I can detect no continuity between terminal K and any of the pins that connect the shield to the Arduino.
If your shield is the same design as the other ones we have seen, then you won't see any continuity between the LCD K pin and any Arduino pin because it isn't wired up that way.
The K pin is wired to the collector of an NPN transistor and D10 is wired to the base.
The issue is there there is no series resistor between D10 and the base of the transistor.
See the schematic in the 1st post.
The datasheet from the product link you provided: https://www.jaycar.com.au/medias/sys_master/images/9133746290718/XC4454-dataSheetMain.pdf (https://www.jaycar.com.au/medias/sys_master/images/9133746290718/XC4454-dataSheetMain.pdf)
does not mention using D10.

However the LCDKeypadCheck test would seem to indicate otherwise.
It sets D10 to HIGH and then reads the pin. If the shield has an issue, D10 will not be HIGH because of a short through the
transistor and the D10 signal is being yanked back low even though the AVR is trying to drive the pin high.
Reading a LOW instead of a HIGH is what causes the LCDksypadCheck sketch to report a bad BL circuit.
This is because something is yanking the D10 pin down and that shouldn't be happening.
This can damage the AVR.
The output of bad BL circuit on the LCD means the sketch has determined there is a short on D10 and concluded that
the BL circuit is bad, not that any of damage has necessarily occurred.


Does the backlight blink when the diag test is run when the shield is plugged directly into the Arduino?
If it reports a bad BL circuit but the backlight does not blink you have some other kind of actual h/w issue - beyond just the shield backlight circuit design issue.

It isn't clear how you have wired things up or if there were any temporary miswirings.
It is possible that something done has damaged something.
It is possible that the transistor has been blown by shorting K to ground.
While shorting K to ground will light the backlight, it also puts a hard ground to the transistor collector
since the K signal of the LCD is connected directly to the collector of the transistor.

D10 is connected directly to the base.
If you shorted K to ground while D10 was high,
then the transistor would be 100% on due to the short from D10 into the base through the transistor to the emitter.
With K grounded which also grounds the collector you now have an infinite current load flowing through collector to the emitter.
This might blow the transistor or perhaps even a trace on the PCB.

Unfortunately, that transistor is in a location under the LCD so you can't get to it without removing the LCD.

Now if you have measured the current when K is grounded and you are sure it is 30ma or less,
and you don't intend to ever plug the shield into the Arduino, you could
cheat and wire D10 directly to the K pin of the LCD instead of grounding K.
That would give you backlight control and allow PWM dimming.

These days for a text LCD display, especially one that isn't going to be on a shield plugged into an Arduino,
I'd use an I2C backpack. It only uses the 2 i2c pins.
You can get them off ebay for about $1 USD shipped to your door.


--- bill



Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bumblepom on Sep 20, 2018, 03:06 am
...

Now if you have measured the current when K is grounded and you are sure it is 30ma or less,
and you don't intend to ever plug the shield into the Arduino, you could
cheat and wire D10 directly to the K pin of the LCD instead of grounding K.
That would give you backlight control and allow PWM dimming.

These days for a text LCD display, especially one that isn't going to be on a shield plugged into an Arduino,
I'd use an I2C backpack. It only uses the 2 i2c pins.
You can get them off ebay for about $1 USD shipped to your door.


--- bill


I did measure the K to ground at 20 mA..
So I connected K directly to D10   --> BL off
But when I reversed the code to
< const int ... blLevel=LOW; >  instead of HIGH, then the BL comes on.

And yes I will be moving to i2C and have a plain LCD and backpack in transit.

Thanks for your help.

Nelson
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 20, 2018, 03:13 am
I did measure the K to ground at 20 mA..
So I connected K directly to D10   --> BL off
But when I reversed the code to
< const int ... blLevel=LOW; >  instead of HIGH, then the BL comes on.
Ah oops. My mistake. Since the bl pin (D10) is connected to K, the backlight comes on when it is low vs high.
So yes active level must be set to low, which tells the library to set the backlight pin low to turn on the backlight and high to turn it off.

With that correction,
you should now be able to control the backlight with backlight()/noBacklight() and even do backlight dimming using setBacklight(dimlevel)

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nielyay on Sep 20, 2018, 06:11 pm
Quote
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
Hello,
Sorry for asking.
Iam have the Keypad LCD Shield V2.0 and i have learn some tutorial page about it, but i need more learning this LCD, any suggestion program or links?



Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Sep 20, 2018, 06:31 pm
Hello,
Sorry for asking.
Iam have the Keypad LCD Shield V2.0 and i have learn some tutorial page about it, but i need more learning this LCD, any suggestion program or links?
That is outside the scope of this thread.
Those pages in the links you provided have the basic information on how the LCD, buttons, and headers are wired up to the shield.
I'd suggest for any further assistance to start a new thread.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: nielyay on Sep 21, 2018, 06:25 am
Quote
Those pages in the links you provided have the basic information on how the LCD, buttons, and headers are wired up to the shield.
hello bill,

yes, i mean did you have  any suggestion program for the LCD? i have try some program on the website.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: Fleetz on Mar 23, 2019, 05:46 am
I have a clone D1 ROBOT which doesn't have or at least I can not find a revison number. I run Bill's back light sketch and it report BL Bad.

The total current of the Arduino with LCD board mount is 70mA which doesn't seem excessive.

What was the original issue that has raised all this concern and suggested modifications? Nothing appears to be running hot after hours of running. So what was the flag that went up?

Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: MAS3 on Mar 23, 2019, 10:02 am
Read post 1 in this thread, it's all there.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: kssoin on Mar 30, 2019, 09:03 am
I have read this link, checked in my IDE I have this hd44780LCD library installed with the library manager.
In the examples included with this library could not make out the sketch for testing the backlight control of the shield.
Which sketch is it?


Regards for your time.
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: bperrybap on Mar 30, 2019, 09:20 am
I have read this link, checked in my IDE I have this hd44780LCD library installed with the library manager.
In the examples included with this library could not make out the sketch for testing the backlight control of the shield.
Which sketch is it?
See the wiki: https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_pinIO (https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_pinIO)

note: there is a link to the hd44780 library wiki in the included Documentation which can be found in the "Documentation" sketch.

--- bill
Title: Re: Warning to users of some vendors LCD keypad shields.
Post by: kssoin on Mar 30, 2019, 11:56 am
See the wiki: https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_pinIO (https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_pinIO)

note: there is a link to the hd44780 library wiki in the included Documentation which can be found in the "Documentation" sketch.

--- bill
Thanks bill