Pages: [1] 2 3 ... 7   Go Down
Author Topic: Warning to users of some vendors LCD keypad shields.  (Read 67605 times)
0 Members and 1 Guest are viewing this topic.
Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

NOTE: 2014-02-16
The next post:
http://forum.arduino.cc/index.php?topic=96747.msg725979#msg725979
has been updated to contain a zip image of some s/w work arounds.
While not as good as h/w fix, for many situations it can be "good enough".

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

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

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

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


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

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

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

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

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

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

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

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

I attached photos of the emartee board and my diode mod.

--- bill

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


* LCDKeypad_Shield_SCH.png (104.55 KB, 1560x1032 - viewed 2916 times.)

* IMG_5634.JPG (118.65 KB, 640x480 - viewed 1387 times.)

* IMG_5632.JPG (128.68 KB, 640x480 - viewed 1230 times.)

* IMG_5638.JPG (129.9 KB, 640x480 - viewed 1219 times.)
« Last Edit: February 16, 2014, 02:17:01 pm by bperrybap » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* IMG_5639.JPG (91.23 KB, 640x480 - viewed 1486 times.)
* SWblCTL.zip (1.25 KB - downloaded 154 times.)

* IMG_6690.JPG (83.51 KB, 640x480 - viewed 319 times.)
« Last Edit: April 16, 2014, 11:29:49 pm by bperrybap » Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1586
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

--- bill
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


« Last Edit: March 27, 2012, 01:29:58 pm by bperrybap » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

See the attached photos for further guidance.

Code to test with:

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


* Overview.jpg (309.38 KB, 1292x785 - viewed 1013 times.)

* Side View.jpg (272.04 KB, 974x702 - viewed 853 times.)

* Fix Detail.jpg (320.79 KB, 1056x820 - viewed 1062 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
« Last Edit: April 02, 2012, 10:35:26 am by SolarPanels » Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Pages: [1] 2 3 ... 7   Go Up
Jump to: