Arduino Forum

Using Arduino => Displays => Topic started by: jay2012 on Sep 17, 2012, 06:28 pm

Title: 16x2 LCD shows only black boxes in the bottom line
Post by: jay2012 on Sep 17, 2012, 06:28 pm
hey,i got a new lcd and wanted to test it out before actually uploading any program,and i did that with the hello world program,and the output was just black boxes in the bottom line , with the top line being blank.
The connections from the lcd to arduino are the regular ones,except V0,as i connected it to GND.
Can someone please explain to me how important contrast is and is it this which is causing the problem?...because the connections are all fine,and arduino is fine too.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Sep 17, 2012, 07:07 pm
Quote
... and the output was just black boxes in the bottom line , with the top line being blank.

Well for starters you have the LCD module upside down.

Perhaps if you told us more about which module you are using we could be of more help.

Quote
The connections from the lcd to arduino are the regular ones...

There's no such thing.  You can use any I/O pin of the Arduino for any of the LCD connections.

Quote
...except V0,as i connected it to GND.

If this is pin 3 then you should be OK.  Although the display will not be optimal you should be able to see something, and you are --- the black boxes.

Quote
... and is it this which is causing the problem?

No.  It's something else.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: Docedison on Sep 17, 2012, 07:10 pm
V0 is the Contrast pin... it literally sets the contrast of the display and in this case is your issue. You will need at a minimum a 4K7 resistor from 5V to V0 and a 330R from V0 to ground (Courtesy of PH Anderson) I borrowed those values from an LCD "Serial Backpack" by PH Anderson. The values work on most LCD display devices that use the HD44870 IC or it's equivalent for LCD control.
The Best thing to do is use a 5K pot:   CW or one end to ground, Wiper or center lead to V0 and CCW or the other end to 5V.The resistors will get you going and the pot will give you control of the contrast.

Doc
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Sep 17, 2012, 08:04 pm
Quote
... and in this case is your issue.

No it's not.  He is seeing a single row of boxes which means that the display is getting power and that his contrast voltage is adequate (but probably not optimum).  If the contrast voltage were too high (compared to GND) the display would be blank and if too low there would be some dimmer boxes in the other row.

His controller is not being properly initialized which is due to a wiring or programming error.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: dragonwarrior on Sep 20, 2012, 01:39 pm
Hi everyone. I am new to this arduino programming.
I do have the same problem with interfacing LCD to my arduino.

I use JHD162A LCD . I have thoroughly checked the wiring and connections .
what i see is a blank line in the first row followed by square boxes in the next row when i uploaded the "Hello world "program from the arduino library.

I have connected a 5K pot to pin 3 of the lcd  and i am able to adjust the contrast of the lcd as well ( that means the contrast gets changed for the second row only ) .

where did i mistake and please correct me.

Any help will be appreciated..
Thanks in advance.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Sep 20, 2012, 04:00 pm
Quote
what i see is a blank line in the first row followed by square boxes in the next row ...

Then your LCD module is upside down as well.

You posted a drawing of an LCD module.  If the pins really are below and to the left of the display then the pinout is usually different that the one that you have depicted.  We have to get this part straightened out first. 

Don 

Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: dragonwarrior on Sep 20, 2012, 05:10 pm
The pin numbers are given at the back of the LCD.
i have given the connections based on that ,so i think there is no problem with the connections.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Sep 20, 2012, 05:50 pm
Quote
...so i think there is no problem with the connections.

Well there is a problem somewhere.  It would help if you could provide a photograph that clearly and unambiguously shows the connections between your LCD and your Arduino.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: liuzengqiang on Sep 20, 2012, 06:57 pm
Make sure you supply a couple of pictures of your actual connection. A lot can happen between theory and practice, or thinking and doing. I wager more than 50% problems presented on this display sub-forum is a proof. The more information you provide, the sooner you get your help.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: dragonwarrior on Sep 27, 2012, 05:55 pm
It seems there are few problems in the earlier version of the arduino lcd library.
I saw the changes made and wired my lcd as per the latest (updated) lcd library and it works fine..

You need to get the black square boxes in the lcd before connecting the pins RS,EN,RW and the four data pins to the arduino.Once you got that,
All you need to do is to initailise your LCD pins by cheking the line : LIquidCrystal lcd (......) in your code..
Make sure that RS goes to pin 7 of arduino,EN goes to pin 8, and the four data pins (14,13,12,11) of the LCD goes to pins 12,11,10,9 of your arduino.
So it should be: LiquidCrystal lcd (7.8.9.10.11.12);
Now it should work fine!
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Sep 27, 2012, 11:49 pm
Quote
Make sure that RS goes to pin 7 of arduino,EN goes to pin 8, and the four data pins (14,13,12,11) of the LCD goes to pins 12,11,10,9 of your arduino.
So it should be: LiquidCrystal lcd (7.8.9.10.11.12);
Now it should work fine!


You are missing the entire point of the numbers inside the parentheses - but it is not entirely your fault since the documentation is elusive.

You can use any available I/O pin on your Arduino for any of the LCD lines.  All you have to do is express them, in a specific order, within the parentheses.
Here is how I recommend commenting the example sketch:
Code: [Select]
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here


Here's how you find the documentation:
Start here: http://arduino.cc/en/Tutorial/LiquidCrystal
Scroll down to the bottom
Use the Liquid Crystal Library link to get here: http://arduino.cc/en/Reference/LiquidCrystal
Use the LiquidCrystal() link to get here: http://arduino.cc/en/Reference/LiquidCrystalConstructor
And there it is under 'Syntax'


Simple, isn't it?

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: gmcelhanon on Oct 04, 2012, 08:57 am
I had the same problem, and after very carefully checking all my connections and the library, I decided to go back and touch up my soldering.  Once I did that and tried it again, it finally worked.  So if the LCD isn't getting initialized, and you're just seeing the black boxes... and I did the soldering... then double check the soldering.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: liuzengqiang on Oct 04, 2012, 09:14 pm
gmcelhanon,

Thanks for sharing.

On the other hand, the OP has left the thread for 2 weeks. I recommend Admin to lock this thread.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: jay2012 on Oct 10, 2012, 07:28 pm
Thanks a lot guys,i installed the new library,checked the connections again,and changed the program to what was given here,and it worked.
thanks a lot. :)
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Oct 10, 2012, 08:07 pm
Did you also turn it over or are you standing on your head?

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: jay2012 on Oct 14, 2012, 10:45 am
nothing happened when i turned it over before...it was still the same.
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Oct 14, 2012, 03:55 pm
Quote
nothing happened when i turned it over before...it was still the same.

No it was not the same, unless you have a very unusual display.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: jhashmi on Feb 10, 2014, 06:38 pm
i know this topic is closed but many of will coming here with the same problem
i was facing this problem too and just find out why it was.
one thing is very clear that you are watching lcd up side down
as i was doing too. and second thing that led is not being communicated.
in my case i didn't conected the r/w to ground by connecting its working properly
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Feb 10, 2014, 11:00 pm
Quote
in my case i didn't conected the r/w to ground by connecting its working properly

You obviously have looked at some old threads but you haven't gone back far enough.  The problem of not connecting the R/W line was quite prevalent several years ago but has only shown up one or twice in the past few years.  The connection is clearly shown in the diagram with the tutorial (http://arduino.cc/en/Tutorial/LiquidCrystal) and is also mentioned in the program comments.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: BlackT on Jun 15, 2016, 02:14 pm
hello, i know the topic is old but i have a strange problem.
I conect my LCD like this
 http://fritzing.org/media/fritzing-repo/projects/h/how-to-connect-a-qy-1602a-lcd-to-arduino-correctly/images/conectar%20un%20lcd%20qy-1602%20a%20un%20arduino%20uno%20r3_bb.png
And when I conect my USB cable and upload sketch the LCD works, but when I unplug the USB then plug it again it just show the first black row. When I upload sketch it work again

/*
  LiquidCrystal Library - display() and noDisplay()

 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.

 This sketch prints "Hello World!" to the LCD and uses the
 display() and noDisplay() functions to turn on and off
 the display.

 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay

 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(11, 12, 7, 6, 5, 4);

void setup() {

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
    // Turn off the display:
    lcd.setCursor(5,0);
  lcd.print("HONDA");
  lcd.setCursor(4,1);
  lcd.print("CRM 180");
  delay(2000);
  lcd.clear();
  lcd.print("H:xxxx.x");
  lcd.setCursor(0,1);
  lcd.print("km:xxxxx");
  // Print a message to the LCD.
 
}

void loop() {
    // Print a message to the LCD.

 
}


I use arduino nano clone 328
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: floresta on Jun 15, 2016, 04:21 pm
Quote
hello, i know the topic is old but i have a strange problem.
Then start a new thread.

Post a photograph of how you actually connected your components rather than a link to a site that shows how you are supposed to connect things.

Check your link to verify that it works, yours doesn't.

Use the 'code' button to correctly display your code.  Read the forum instructions (http://forum.arduino.cc/index.php?topic=149018.0) if you don't know how to do this.

Don
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: BlackT on Jun 17, 2016, 01:23 pm
On extrenal power it is working OK, so is somethnig about when computer is looking for arduino hardver, never mind it will work on extrenal power, problem solved :)
Title: Re: 16x2 LCD shows only black boxes in the bottom line
Post by: snusmumriken on Dec 22, 2016, 06:50 pm
Found this thread because of a similar problem.  The last reply gave me the answer.  I reasoned that if an external supply worked and the USB->Arduino cable didn't, then it might be because the battery voltage was lower and more appropriate.  Sure enough, it turned out that I have a 3.3V display (not marked on the board, however), and I had been powering it off the Arduino's 5V supply.  Doh! 

I hope this helps someone else.