Hello World LCD

I am very new to Arduino and excited to make some things work. I am working on the Hello World tutorial and have reached a block .I have everything wired up according to the tutorial. I have checked it several times. I have the LED backlight working but I can't get a message to come to the LCD. When I plug the Arduino Uno into my computer via USB, all I get is a row of sixteen blocks on the top row of the LCD. I tried adjusting the 10k pot and I can make the blocks go away and return. I tried running the sketch and there is no change. I have pressed the reset button, reloaded the sketch, unplugged and replugged the USB cable and still no change. I am sure this is something stupid that I am doing, but I can't find it. Any assistance would be greatly appreciated.

Hi, welcome to the forum.

To get a display working for the first time can be hard. The first row with blocks could be an initialization problem, perhaps with wrong wiring. It is possible that the display is broken, but I assume that some wires are wrong, just as it was for me when I tried to make a display work.

It would help us a lot when you give more information. For example: which Arduino board are you using, which Arduino IDE version, which display, do you have a schematic, can you make a photo so we can check the wiring ?

You can copy a link in a post. You can attach files with the "Additional Options...", it is below the text input field on the left.

Do you use this example ? http://arduino.cc/en/Tutorial/LiquidCrystal Did you use that example, or did you make a change to it ? Can you check the wiring once more ? Do you use Arduino IDE 1.0.6 ?

The fact that your backlight works and that you can adjust the contrast means that you have the five power pins connected properly and that your display is most likely to be functional (not defective).

Assuming that you have been successful loading other sketches into your Arduino this would suggest a problem with your wiring.

There are seven more connections to be made and the three most common problems are: 1- overlooking the connection between R/W (LCD pin 5) and GND. 2- a mismatch between the numbers in the LiquidCrystal lcd(. . .); statement and the actual wiring 3- poor soldering

If these hints don't help then we need to see a photograph of your setup that clearly and unambiguously shows all of the connections between your Arduino and your LCD module. We also need a copy/paste version of the code that you are actually using, not a link to the code that you think you are using.

Don

Thank you for the replies.

Do you use this example ? http://arduino.cc/en/Tutorial/LiquidCrystal - Yes
Did you use that example, or did you make a change to it ? - I made some changes to the code that I saw in another post. It was just to get rid of the loop.
Can you check the wiring once more ? - Checked, no changes made. Still doesn’t work.
Do you use Arduino IDE 1.0.6 ? - Yes

1- overlooking the connection between R/W (LCD pin 5) and GND. - It’s there
2- a mismatch between the numbers in the LiquidCrystal lcd(. . .); statement and the actual wiring - Matched up
3- poor soldering - Checked all joints with microscope. All look Ok.

I have loaded and run many sketches with no problem.

My Arduino came with the Ultimate Arduino Microcontroller Pack. On the Board it says Arduino UNO - SMD Edition - Make Special Edition.

This is the code I am running:
/*
LiquidCrystal Library - Hello World

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 shows the time.

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/LiquidCrystal
*/

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

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

void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“hello, world!”);
}

void loop() {
}

A photo of my setup is attached to a separate post… When I tried to post this with the photo attached, I got an error.

Photo of setup attached:

Thanks for the photo, I have been looking at it, and I think everything is connected okay. The MAKER Uno is like the real Uno, that can't be a problem.

Could the display be broken after all ?

I can think of 3 things: 1 ) A bad connection of one of the data lines, for example a bad contact of the breadboard. 2 ) Add a delay of 1 second "delay(1000);" before "lcd.begin(16.2);" 3 ) Or the display is broken....

I would start by checking your soldering. → Common Soldering Problems | Adafruit Guide To Excellent Soldering | Adafruit Learning System

If that doesn’t fix things then it’s time to pull all of the wires out and start again. Here is my complete outline of how I recommend that you proceed, I only quoted part of it before:

Here is my generic step by step approach that should work:

(1) If the module has a backlight then get it working properly. This involves only pins 15 and 16 on most LCD modules. Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly. This involves only pins 1, 2, and 3 on most LCD modules. You should be able to just barely see blocks on one row of a two row display and on two rows of a four row display.

NOTE: The Arduino has not been used yet, except as a possible source for the power needed for the first two steps. Do not try to go any further until this is working. If you don’t see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six control and data wires between your LCD module and your Arduino.

(5) Upload your sketch and it should work.

Troubleshooting:

If you have a 16x1 display and there are blocks only on the left half of the row in step 2 then use

lcd.begin(8, 2);

in your sketch.

If you still don’t get a display then make sure that your wiring matches the numbers in the descriptor (or vice versa).

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

If you get a display but it is garbled or has some other problems then try again with a ‘static’ sketch, one that displays a simple message on the top row of the display and then stops. All of your code should be in setup() and loop() should be empty between the brackets.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
  }

If you are still having problems then we need to see a photograph of your setup that clearly and unambiguously shows all of the connections between your Arduino and your LCD module. We also need a copy/paste version of the code that you are actually using, not a link to the code that you think you are using.

Also: To post code you should highlight the portion of your text that is code and then use the ‘#’ code button.
And: Did you use the ‘Additional Options’ when you tried to post your photo?

Don

Could the display be broken after all ?

As I said before the fact that the backlight works and that you can adjust the contrast means that the display is most likely to be functional (not defective).

Add a delay of 1 second "delay(1000);" before "lcd.begin(16.2);"

Why on earth would you want to do that?

Don

The controller could be broken. The backlight and contrast would work in that case.

Perhaps this display is not happy with the floating pins during reset. I have used a delay myself and adviced someone to add 500ms, and it made the display work. I know the LiquidCrystal library does a good job by trying to capture the display (it could be in 4-bit or in 8-bit mode, not easy to initialize it), but sometimes that is not good enough.

I put my money on a broken display (something internal with the controller).

I put my money on a broken display (something internal with the controller).

Really??

I think it's more likely to be the soldering or possibly a bad wire.

Don

I sincerely thank everyone for your assistance. It is now working properly.

When I stripped everything down and started by getting the backlight working and then the power, etc, I used different jumpers to hook everything up. The problem was indeed, a bad wire. Sure had me stumped.

Well, on to the next tutorial. :-)

Did I lose my money here ? =(
floresta, you can tell me your paypal account in a PM $)
Fosterr3, I’m glad you have it working now :stuck_out_tongue: