Wrong characters with LCD 16x2 (from the Arduino Starter Kit)

Hi! I’ve a strange problem with my LCD and the Hello world example that displays wrong characters (hgnno. wornf!) instead of “Hello, world!”
if i try to print “abcdefghijklmnopqrstuvwxyz” the result is “abcfgfghijknonop…”
Here the code:

/*
  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() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

The problem is related to the breadboard (i tried more than 3 dispositions of LCD in breadboard without results) or am i doing something wrong?
Here’s how i wired the LCD with the Arduino Uno:

adding the 15, 16 for the backlight.
The second row is not displayed (lcd.setCursor(0, 1); doesn’t do nothing)

Thanks in advance

Hi and welcome.

The problem you must have, is that you have no connection on either pin D4 or pin D7.
I'm sure of this because you seem to miss a single bit in your connection, looking at your description.
This can be due to a miswiring by you, a bad connection in your breadboard, but most likely a bad jumperwire (that happens too often).
So recheck all connections, and replace the wires you used for D4 to D7.
If you replace 1 wire, test and then replace the next wire (power down before replacing anything), you can find the wrong one.

The pre-made jumper wires occasionally have bad pin crimps inside the black cylindrical sleeves on the tips. If you have a meter you can ohm them out or just breadboard "GO/NO GO" led circuit and substitute one of the wires with the other jumpers one at a time. Do you have a multimeter to measure your Vcc voltage ? Is everything running off your USB cable /Arduino or do you have an external P.S ? You can rule out wiring errors because there is no combination of miswires that would still give you any alphabetical characters that look like characters. If it was miswired, the garbage on the lcd would not be readable letters but something much more random. If the control wires were mis-wired would not get any correct data (no alphabetical characters). It looks more suggestive of the kind of errors possible in a serial lcd scenario only baud rate errors result in much more extreme errors (you wouldn't get anything remotely like what you are supposed to see, no two consecutive characters would be correct and probably it would be only one character repeating forever. Your issue is something completely different , but it might fit into a scenario of an I2C lcd with no 4.7k pullup resistors. All that speculation aside, when you post for help with a technical issue involving both hardware and software, generally, posing the software along is not sufficient. You need to provide more details about the H/w, preferably a link to where you got it. These days with so much stuff coming from China with no documentation it is almost pointless to ask for a datasheet because all that you're going to get is the Hitachi HD44780 controller datasheet. Can you post a link to where you got the lcd and a photo of it ?

!llew sa aremac wen a deen uoy knith I

noD

!llew sa aremac wen a deen uoy knith I

"I think you need a new camera as well !"

You can rule out wiring errors because there is no combination of miswires that would still give you any alphabetical characters that look like characters. If it was miswired, the garbage on the lcd would not be readable letters but something much more random.

What makes you say this?

All that speculation aside, when you post for help with a technical issue involving both hardware and software, generally, posing the software along is not sufficient. You need to provide more details about the H/w, preferably a link to where you got it. These days with so much stuff coming from China with no documentation it is almost pointless to ask for a datasheet because all that you're going to get is the Hitachi HD44780 controller datasheet. Can you post a link to where you got the lcd and a photo of it ?

Frequently true, but not in this case.

Your power and contrast voltage are obviously correct. Your wiring is almost correct otherwise the initialization would not have been successful.

Your incorrect characters are most likely due to problems with one or more of your four data lines. Most of them can be explained by D5 being stuck high so I would start there. Look carefully at the solder joints on your LCD. Look for bridges (two pins connected by a sliver of solder) or 'cold' solder joints which look dull instead of shiny.

Don

You can rule out wiring errors because there is no combination of miswires that would still give you any alphabetical characters that look like characters. If it was miswired, the garbage on the lcd would not be readable letters but something much more random.

What makes you say this?

As it turns out this is only partially true. Some of the characters are readable letters, and some are not. What I meant to say is that the change to the displayed information would so great that you would not have an entire line with readable characters like reported by the OP: "“abcfgfghijknonop…” , and that turned out to be true. (see attached) Initially it was based on past experience but when I did it deliberately it was only true in so far as I did not see an entire line that was readable as consecutive alphabetical characters, but rather a combination of characters and garbage.

Sorry for the short and not exhaustive reply, now in order:

Hi and welcome.

The problem you must have, is that you have no connection on either pin D4 or pin D7.
I’m sure of this because you seem to miss a single bit in your connection, looking at your description.
This can be due to a miswiring by you, a bad connection in your breadboard, but most likely a bad jumperwire (that happens too often).
So recheck all connections, and replace the wires you used for D4 to D7.
If you replace 1 wire, test and then replace the next wire (power down before replacing anything), you can find the wrong one.

This is the first thing that i thought regarding the problem but changing disposition on the breadboard and trying with different wires each time is not solving the problem (and LCD male header pins like the soldered part seem to be not damaged)…

In this topic a guy had a similar problem:

Hello" is printed as “Jgnno” here is more for reference

lcd.print(“Hello”);
//Jgnno
lcd.print(“World”);
//Wornf
// lcd.print(“ABCDEFGHIJKLMNOP”);
//CBCFGFGJKNONOR

and the solution was in this case that the DB5 (DB1?) line wasn’t wired securely/properly. (what i think is correct right now)

The pre-made jumper wires occasionally have bad pin crimps inside the black cylindrical sleeves on the tips. If you have a meter you can ohm them out or just breadboard “GO/NO GO” led circuit and substitute one of the wires with the other jumpers one at a time. Do you have a multimeter to measure your Vcc voltage ? Is everything running off your USB cable /Arduino or do you have an external P.S ? You can rule out wiring errors because there is no combination of miswires that would still give you any alphabetical characters that look like characters. If it was miswired, the garbage on the lcd would not be readable letters but something much more random. If the control wires were mis-wired would not get any correct data (no alphabetical characters). It looks more suggestive of the kind of errors possible in a serial lcd scenario only baud rate errors result in much more extreme errors (you wouldn’t get anything remotely like what you are supposed to see, no two consecutive characters would be correct and probably it would be only one character repeating forever. Your issue is something completely different , but it might fit into a scenario of an I2C lcd with no 4.7k pullup resistors. All that speculation aside, when you post for help with a technical issue involving both hardware and software, generally, posing the software along is not sufficient. You need to provide more details about the H/w, preferably a link to where you got it. These days with so much stuff coming from China with no documentation it is almost pointless to ask for a datasheet because all that you’re going to get is the Hitachi HD44780 controller datasheet. Can you post a link to where you got the lcd and a photo of it ?

The LCD worked perfectly some months ago, it is powered with the standard arduino USB connected to the port of my Macbook Pro. The LCD datasheet is this: http://arduino.cc/documents/datasheets/LCD-WH1602B-TMI.pdf
And i haven’t nothing to check if a wire is going on (except manual connection and check, what i will try to do).

!llew sa aremac wen a deen uoy knith I

Ahahahahaahahhaah “Mea culpa for yesterday”

Frequently true, but not in this case.
Your power and contrast voltage are obviously correct. Your wiring is almost correct otherwise the initialization would not have been successful.
Your incorrect characters are most likely due to problems with one or more of your four data lines. Most of them can be explained by D5 being stuck high so I would start there. Look carefully at the solder joints on your LCD. Look for bridges (two pins connected by a sliver of solder) or ‘cold’ solder joints which look dull instead of shiny

Yes, i think that this is the problem!

Thank you all!