16x2 LCD prints foreign letters?

I have my LCD code, and wiring all right + the contrast pot, but when I print "hello" it has foreign symbols and filled in blocks of light.
Can anyone help me? If you need it, I will provide a picture.

I also used this tutorial to wire it up.
http://www.ladyada.net/learn/lcd/charlcd.html

Thanks.

Picture:
http://troll.ws/i/SCF2Cj.jpg
http://troll.ws/i/Y6tW5R.jpg
New Pictures:
http://troll.ws/i/a9ueT1.jpg
http://troll.ws/i/g6llkF.jpg
http://troll.ws/i/ONxMrR.jpg
http://troll.ws/i/Gb6r7S.jpg

Code:

//This is just the example hello world, but I changed the pins to what mine are set up to.
#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
}

No one can help you until you post decent pictures of your complete wiring/hardware, post the code you are using and include information regarding how you are powering the Arduino and LCD display.

Added the code, and will be putting more pictures up soon.

  1. You're constantly writing new data to the lcd in loop(). Try adding a 1 second delay in the loop.

  2. That tutorial misses out one important thing. For most LCDs, you mustn't connect the backlight directly to +5v and ground, you need a series resistor. The LCD datasheet will give you the current rating and voltage drop, from which you can work out the resistor. If you don't have the datasheet, 100 or 150 ohms should be OK.

However, I'm not at all sure that either of these is the cause of your problem.

dc42:

  1. You're constantly writing new data to the lcd in loop(). Try adding a 1 second delay in the loop.

  2. That tutorial misses out one important thing. For most LCDs, you mustn't connect the backlight directly to +5v and ground, you need a series resistor. The LCD datasheet will give you the current rating and voltage drop, from which you can work out the resistor. If you don't have the datasheet, 100 or 150 ohms should be OK.

However, I'm not at all sure that either of these is the cause of your problem.

I hooked up the power and ground to 150 OHM resistor, then to ground and power and all that good stuff. The backlight then didn't work and it still printed these weird symbols.

  1. You're constantly writing new data to the lcd in loop(). Try adding a 1 second delay in the loop.

Unfortunately that's the standard sketch supplied with the Arduino IDE and it's not likely that we can get them to change it. The sketch does work as advertised but it seems like a piss poor idea to try to display changing data in a sketch that is almost always the very first one used by LCD neophytes. I recommend the following:

...
void setup()
  {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
  lcd.setCursor(0,1)
  lcd.print("it works!");
  }

void loop()
  {
  }
  1. That tutorial misses out one important thing.

Yes and no...Actually the text part of the tutorial is quite specific about the need for a series resistor and tells exactly how to calculate the value.

"Next we'll connect up the backlight for the LCD. Connect pin 16 to ground and pin 15 to +5V through a series resistor. To calculate the value of the series resistor, look up the maximum backlight current and the typical backlight voltage drop from the data sheet. Subtract the voltage drop from 5 volts, then divide by the maximum current, then round up to the next standard resistor value. For example, if the backlight voltage drop is 3.5v typical and the rated current is 16mA, then the resistor should be (5 - 3.5)/0.016 = 93.75 ohms, or 100 ohms when rounded up to a standard value. If you can't find the data sheet, then it should be safe to use a 220 ohm resistor, although a value this high may make the backlight rather dim."

Unfortunately the accompanying photographs do not show the resistor because the LCDs sold on that site (at least at the time the tutorial was generated) already have the series resistor on the pc board and consequently do not need an external one. This is one of the few flaws in that tutorial.

However, I'm not at all sure that either of these is the cause of your problem.

Actually it could very well be the cause of the problem. The excessive current being drawn by the backlight has been known to draw down the power supply to the point where the LCD controller no longer works properly.

Don

I hooked up the power and ground to 150 OHM resistor, then to ground and power and all that good stuff.

That isn't correct. The resistor goes in place of the red wire that is shown connected to pin 15 in the Adafruit photos. In other words, remove the red wire and replace it with the resistor.

Don

floresta:

I hooked up the power and ground to 150 OHM resistor, then to ground and power and all that good stuff.

That isn't correct. The resistor goes in place of the red wire that is shown connected to pin 15 in the Adafruit photos. In other words, remove the red wire and replace it with the resistor.

Don

Thanks, I will try that out.

Okay, I tried that, and once again the backlight receives no power at all when using a 100K or 150K OHM resistor.

Should I get a new LCD? If so from where?

floresta:
Yes and no...Actually the text part of the tutorial is quite specific about the need for a series resistor and tells exactly how to calculate the value.

"Next we'll connect up the backlight for the LCD. Connect pin 16 to ground and pin 15 to +5V through a series resistor. To calculate the value of the series resistor, look up the maximum backlight current and the typical backlight voltage drop from the data sheet. Subtract the voltage drop from 5 volts, then divide by the maximum current, then round up to the next standard resistor value. For example, if the backlight voltage drop is 3.5v typical and the rated current is 16mA, then the resistor should be (5 - 3.5)/0.016 = 93.75 ohms, or 100 ohms when rounded up to a standard value. If you can't find the data sheet, then it should be safe to use a 220 ohm resistor, although a value this high may make the backlight rather dim."

Unfortunately the accompanying photographs do not show the resistor because the LCDs sold on that site (at least at the time the tutorial was generated) already have the series resistor on the pc board and consequently do not need an external one. This is one of the few flaws in that tutorial.

That looks pretty close to the text I submitted as a correction a few weeks ago! Last time I looked, it hadn't been published.

Ciehanski:
...
Thanks, I will try that out.

That should fix the backlight, but not the original problem. My best guess is that your wiring is incorrect or you have some bad connections. I see you are using a socket strip to connect to the LCD. Are all the pins of it that you are using properly soldered to the LCD pads? Are you passing the Arduino pin numbers to the LiquidCrystal constructor in the correct order, corresponding to the way you have wired them to the LCD?

Ciehanski:
Okay, I tried that, and once again the backlight receives no power at all when using a 100K or 150K OHM resistor.

You need 100 or 150 ohms, not Kohms.

dc42:

floresta:
Yes and no...Actually the text part of the tutorial is quite specific about the need for a series resistor and tells exactly how to calculate the value.

"Next we'll connect up the backlight for the LCD. Connect pin 16 to ground and pin 15 to +5V through a series resistor. To calculate the value of the series resistor, look up the maximum backlight current and the typical backlight voltage drop from the data sheet. Subtract the voltage drop from 5 volts, then divide by the maximum current, then round up to the next standard resistor value. For example, if the backlight voltage drop is 3.5v typical and the rated current is 16mA, then the resistor should be (5 - 3.5)/0.016 = 93.75 ohms, or 100 ohms when rounded up to a standard value. If you can't find the data sheet, then it should be safe to use a 220 ohm resistor, although a value this high may make the backlight rather dim."

Unfortunately the accompanying photographs do not show the resistor because the LCDs sold on that site (at least at the time the tutorial was generated) already have the series resistor on the pc board and consequently do not need an external one. This is one of the few flaws in that tutorial.

That looks pretty close to the text I submitted as a correction a few weeks ago! Last time I looked, it hadn't been published.

Ciehanski:
...
Thanks, I will try that out.

That should fix the backlight, but not the original problem. My best guess is that your wiring is incorrect or you have some bad connections. I see you are using a socket strip to connect to the LCD. Are all the pins of it that you are using properly soldered to the LCD pads? Are you passing the Arduino pin numbers to the LiquidCrystal constructor in the correct order, corresponding to the way you have wired them to the LCD?

Ciehanski:
Okay, I tried that, and once again the backlight receives no power at all when using a 100K or 150K OHM resistor.

You need 100 or 150 ohms, not Kohms.

Opps, I was using KOHMS. I'll try that too. And I soldered it pretty well, but I'm not too sure on the wiring correctly part. I'm new to all this.

The LCD Pins:
1 - To ground.
2 - To 5v
3 - To pot.
4 - To Arduino pin 7.
5 - To ground.
6 - To Arduino pin 8.
11 - To Arduino pin 9.
12 - To Arduino pin 10.
13 - To Arduino pin 11.
14 - To Arduino pin 12.
15 - To 5v.
16 - To ground.

The ones I skipped are not connected to anything. From that, is my wiring and LCD variable in the code all correct?

15 - To 5v.

No. To 5v through a 150 ohm resistor.

Don

That looks pretty close to the text I submitted as a correction a few weeks ago! Last time I looked, it hadn't been published.

You have had better luck getting them to fix things than I have. I recall that they made some major changes, mostly additions, to the tutorial recently and that's probably when your information got added. I believe that they used to just mention that some other LCD modules needed an external resistor but theirs didn't. I looked at their current 20x4 offering which specifies 4.2v / 180mA for the LED. Their current 16x2 specifies 4.1v / 100mA. This means that both need an external resistor.

Hopefully they will fix up the photos soon. The one showing the single row of 'boxes' is still upside down.

Don

floresta:

15 - To 5v.

No. To 5v through a 150 ohm resistor.

Don

I changed that to a 150 OHM not KOHM resistor. Backlight now has power. But it still prints those weird symbols.

floresta:

That looks pretty close to the text I submitted as a correction a few weeks ago! Last time I looked, it hadn't been published.

You have had better luck getting them to fix things than I have. I recall that they made some major changes, mostly additions, to the tutorial recently and that's probably when your information got added. I believe that they used to just mention that some other LCD modules needed an external resistor but theirs didn't. I looked at their current 20x4 offering which specifies 4.2v / 180mA for the LED. Their current 16x2 specifies 4.1v / 100mA. This means that both need an external resistor.

Hopefully they will fix up the photos soon. The one showing the single row of 'boxes' is still upside down.

Don

Uploading the new photos now. It has the new resistor in there too. :slight_smile:

New pictures are up. :slight_smile:

Ciehanski:
The LCD Pins:
1 - To ground.
2 - To 5v
3 - To pot.
4 - To Arduino pin 7.
5 - To ground.
6 - To Arduino pin 8.
11 - To Arduino pin 9.
12 - To Arduino pin 10.
13 - To Arduino pin 11.
14 - To Arduino pin 12.
15 - To 5v.
16 - To ground.

The ones I skipped are not connected to anything. From that, is my wiring and LCD variable in the code all correct?

That wiring does correspond to the LCD constructor call in the code you posted.

Try a sketch that does the begin call, then sets the cursor position and prints a single character, or 4 characters all the same. Experiment with different cursor positions and characters. From the results you get, we may be able to establish where the problem lies.

dc42:

Ciehanski:
The LCD Pins:
1 - To ground.
2 - To 5v
3 - To pot.
4 - To Arduino pin 7.
5 - To ground.
6 - To Arduino pin 8.
11 - To Arduino pin 9.
12 - To Arduino pin 10.
13 - To Arduino pin 11.
14 - To Arduino pin 12.
15 - To 5v.
16 - To ground.

The ones I skipped are not connected to anything. From that, is my wiring and LCD variable in the code all correct?

That wiring does correspond to the LCD constructor call in the code you posted.

Try a sketch that does the begin call, then sets the cursor position and prints a single character, or 4 characters all the same. Experiment with different cursor positions and characters. From the results you get, we may be able to establish where the problem lies.

When I do the lcd.cursor(); it doesn't show it at all, but when uploading to the board it shows up, not at the beginning of the line, but about 4 spaces away from the end, and then when uploading is done, it disappears.

Also, when I do lcd.print("Test"); it doesn't even show the weird symbols anymore. My lcd variable code must not be in order.

Forget that. But the cursor doesn't show. But the symbols do.

@Ciehanski
You really should not use the Quote button with orange text at the upper right of a previous reply unless you really intend to quote the full text of that particular reply. If that is not the case then you should use the Reply button with black text that is under the last reply.

Don