Not able to interface correctly with LCD

So I'm trying to display messages from the arduino onto the lcd, the standard hello world program, but somehow nothing seems to get displayed. In the example given the default connections are

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

I changed the connections AND the corresponding data in the above statement, just want to make sure thats not the reason why the lcd isn't working.

I.e is it possible that my lcd is not displaying anything just cause i changed the default connections??

Any help is highly appreciated
Thanks in advance :slight_smile:

PS I know this might be a stupid question, but im a beginner. Please go easy on me :slight_smile:

Show us your code.
Show us your schematic.
Show us a picture of the actual wiring.

Is it the HD44780 LCD?

Hey!!

Attached is the code and the connections.

I really don't know what model it(the lcd) is. Doesn't say anything in english except the pin numbers, everything else is in chinese/japanese.
I know the lcd works cause i'm getting the power on screen but its not displaying anything.

code.txt (2.48 KB)

2 things jump out immediately:

#1 Add a wire form Arduino +5V to a 220 ohm resistor then the other end of the resistor goes to pin 15 (+LED) of the LCD. Add a wire form pin 16 (-LED) of the LCD to Arduino 0 volts. Adjust the contrast so you see the LCD pixels. This will turn on the backlight of the LCD.

#2 Before you print a line on your LCD you should position your cursor. example: lcd.setCursor(0,0); OR lcd.setCursor(0, 1); (note: line 1 is the second row, since counting begins with 0). Also, you may want to clear the line before you write to it.

You really should get in the habit of commenting your lines of code!

I also suggest you start out with something that is proven to work.
Try this example to see if your setup works:

So i tried the example code hello world but even that seems to give garbage.

Then i found this link, and even i'm giving the 5V supply to the lcd from the arduino:
http://forum.arduino.cc/index.php?topic=138224.0

But i don't quite understand this:

"I used a external power supply (5V) and somehow you must connect that same power supply to the Arduino."

Doesn't the arduino need bw 7 and 12V supply???

So i just realised that the lcd type is Jhd162A.

Any advice??

Code and schematic still the same.

HC1234:
So i just realised that the lcd type is Jhd162A.

Any advice??

Code and schematic still the same.

It's still a HD44780-clone, and I can derive from the model number (the 162- part) that it's 2 lines of 16 chars - totally standard.

// Per.

Show us a picture of the actual wiring.

7-12 will work, 7 is recommended for the power jack.

Doesn't the arduino need bw 7 and 12V supply???

Make sure you have the external ground (0V) going to the Arduino ground (0V).

I used a external power supply (5V) and somehow you must connect that same power supply to the Arduino

Thanks for all your help guys, i resoldered everything, connected those backlights and used the clear and setcursor commands AND it worked like a charm!!!!