5

I hooked up a 16x2 Arduino compatible LCD yesterday and made sure all the connections were according to the program and the schematics provided all over the web. My contrast is adjusted perfectly but the problem is that there are black boxes on the top line while the lower one is empty.

Black boxes on top row only of LCD

I know this question has been asked many times but no one has answered the question other than saying, "Check your contrast pin". I'm using the default sample code provided in the Arduino IDE. HELP!

Regards.

8
  • Do you use a I2C interface on the LCD?
    – Rien Brand
    Apr 25, 2015 at 10:59
  • @RienBrand Nope. Just the standard interface(i dont know what its called). Here's a link to its data sheet by the way: evselectro.com/image/data/datasheet/LMB162ABC.pdf
    – Owais
    Apr 25, 2015 at 11:50
  • Can you post a picture of how you connected it? Contrast, indeed, isn't the issue here.
    – Gerben
    Apr 25, 2015 at 15:26
  • Most commonly this kind of problem is because the display has been connected backwards. Double check which pin of the header on your display is pin 1.
    – Majenko
    Apr 25, 2015 at 19:41
  • 1
    Look at this answer here: arduino.stackexchange.com/a/17472/11174
    – Jerry
    Nov 5, 2015 at 12:59

5 Answers 5

3

I have done some Googling across the web and it turns out that this can be caused by a couple of things:

  • Incorrect wiring.
  • Wiring of LCD backwards (ie 1 to 16 and 16 to 1).
  • Faulty wiring (ie broken cables & dry joints).
  • Incorrect initialization of the LCD.
  • Buggy software.
  • Damaged screen.

The LCD screen that you have is a based on the Hitachi HD44780 chipset. It is the most common interface for text-based LCDs. It can be identified by the 16-pin interface. I2C is the next most common interface and is distinguishable as it has a 4-pin (sometimes 5-pin) interface.

Lets assume that your screen isn't damaged. From the details in your question, it sounds like your contrast is working just fine. The list above can be shrunk to just 2 things: bad wiring and/or bad code. Lets eliminate both of those by using known working software and known working circuit.

Arduino has an LCD library with example programs. Details for this library, including a wiring diagram, can be found over at the Arduino site in the Reference section. I use these example sketches to test my wiring connections before I write my own program. I recommend using the Autoscroll example.

Wiring Diagram Schematic: Schematic These diagrams are from the Arduino Autoscroll page. I highly suggest that you read this page thoroughly.

The code can be easily uploaded into your Arduino, through the IDE, by going into File > Examples > LiquidCrystal > AutoScroll, then Sketch > Upload.
You should see the sketch print the characters 0 to 9 on the top line (with autoscroll off), then moves the cursor to the bottom right (turns autoscroll on,) and prints the characters 0 to 9 on the bottom line, but as it prints each character the display should move one to the left.

If you get this example program to work then you know that you have a working LCD and also that your wiring is OK as well.

2

Are you using an LCD driver board that has 4 connections between it and the arruino, or do you have the LCD directly connected?

If using a driver board, download Liquid Crupystal Library here

Ten make sure to have the library running in that startup code.

1

Connect your RW pin to Ground.

1
  • 2
    Your answer is rather terse and could do with some expansion. For example, why will connecting RW to ground help? As it stands your answer would have been better as a comment May 22, 2017 at 2:39
1

Alright guys thanks for everything! I've found the solution. It was a bad solder.

0

Your contrast is just fine. The black boxes indicate that your LCD isn't correctly initialized. Poor connections and / or bad code is to blame. So focus your debugging there.

Not the answer you're looking for? Browse other questions tagged or ask your own question.