Go Down

Topic: LCD help (Read 6591 times) previous topic - next topic


Nov 13, 2009, 03:06 am Last Edit: Nov 13, 2009, 03:40 am by vampist Reason: 1
I am wiring this up as we speak.

This would be much easier if my bread board jumper wires came in today  ::)

Well I got it to SORT of display Hello world...

Just.. It is now distorted..

Hmm. Would the lcd be distorted if it was not getting enough power for some reason? what would cause this? picture in a second..

It's only showing contrast on the right two rows...  :-?


I am using a Duemilanove and a 4X20 display bought from hacktronics.  They recommend just a 1k resistor from contrast (pin3) to ground, which gives me good contrast.  Also, just shorting pin 3 to ground gives good contrast.  The "hello world" code from the Aduino version 17 examples worked fine for me.

Now my question:  I am using the "serial input" code, again directly from the V17 library.  If I put in more than 20 characters, the text wraps from line 1 to line 3, then to line 2, then to line 4.  Why?  I tried changing the parameters in the call to lcd.begin, first to the (20,4) matching my LCD, then to various other numbers, but it made no difference in the text wrapping, so:
1)  Why the odd wrapping order, and
2)  What exactly does lcd.begin do?


They recommend just a 1k resistor from contrast (pin3) to ground, which gives me good contrast.  Also, just shorting pin 3 to ground gives good contrast.

I guess that's why they are called hacktronics.  Seriously - It may work on the display that they sell (it works on mine too) but it is a good idea to stick with the manufacturers recommendations if you want the same code to work on your next display.

Why the odd wrapping order

A full explanation can be found by using the LCD Addressing link at http://web.alfredstate.edu/weimandn .

What exactly does lcd.begin do
It lets you specify the configuration of your LCD so that the setCursor() can hopefully work correctly.  I say hopefully because there is still at least one bug, for the 16x4 displays.



Here is that image of the weird contrast I talked about in my other post.


That picture is a prime example of why I have never tried to make any phone calls with my camera.


Well I couldn't find the digital camera. So I just grabbed my cell.

Besides.. I wouldn't really be able to get a good picture with the back light. You also wouldn't be able to see anything with out it either.

Just look closely on the right side of the lcd.


Well I can't find my magic unblurring glasses so you will have to tell me what characters are displayed.  It looks like the left side of each row is blank, characters start appearing at about the middle, and then they taper off to nothing.  What am I supposed to see (or not see) on the right side of the LCD?



Don, thanks for your answers.  The link answering my question on text wrapping was a very good explanation.  

As for your comment on contrast control: I agree that the best practice is to refer to the manufacturer's datasheet.  Unfortunately, in this case I have a "no-name" display board (the only thing stamped on the board is "20080617 Ver.B"), and Hacktronics didn't supply a datasheet (I have asked for one, no response yet).  So I did the next best thing, which was to take the supplier's advice which a) works with this device, and b) is simpler than the variable voltage supply.  True, if I change hardware, I might have to change bias circuit, but since it is "only" hardware, it shouldn't have any ripple effects on my code.  BTW, the 1k resistor provides about 400 mV to pin 3, which gives better contrast than simply grounding the pin.


Hello Don,

I was able to follow your explanation, and in no time 'hello world' was displayed on the LCD.

Here's what I think happened:

Before starting to hook up the hardware, I looked for many examples of controlling the LCD, most of which say to download and install their version of code.  In no time at all, I had various version of code in the library.  As you said, start with a pristine version of 0017.

The other thing that hurt me, was that I assumed (I know...) that pressing 'upload' also started 'compile'.  You said to compile/verify first, then upload, which worked.

Lastly, I didn't have r/w grounded in the third wiring version.

Thanks again for your help!



It looks like we have everyone going except for the original poster!



Nov 14, 2009, 09:27 pm Last Edit: Nov 14, 2009, 10:36 pm by vampist Reason: 1
What you got from the picture is correct.
What is being displayed is actually nothing but contrast tapering off to the right starting at the middle on both rows 1 and 2.

Compile does not start automatically when upload is sent?! :-?
So by clicking compile THEN clicking upload, this could solve the whole problem?!

I know the problem is not my arduino, or the code, I have rewired this about five times.

Yesterday I got my protoshield v.5 in the mail so I have that build.
Makes it SO much easier with the protoshield and a mini breadboard stuck to the top.

So many grounds and 5v's  :P

I will attempt right now:
1. Re-download 0017.
2. Rewire lcd again.
3. Compile THEN upload.

I will give you the results in just a bit.

Re-downloaded 0017.
Rewired the LCD making sure every wire was PERFECT.

Result: Same dang boxes only on the right.


Makes it SO much easier with the protoshield and a mini breadboard stuck to the top.

It's even easier with a Modern Device Bare Bones Board on a regular solderless breadboard!



Do you think it's possibly the LCD?


I've been waiting for the results of your rewiring - I don't normally reread the stuff above my last post so I missed your 'Edit'.

You are getting the the same results after you run your sketch - but how does the display react with just the power, ground, and contrast?  Do you get the blocks on the top row with the bottom row clear?

The fact that the display starts in the middle could indicate a programming or wiring error as well as a bad LCD.  If you cut and pasted the program that leaves the wiring and the LCD.  You appear to be consistent with your wiring but you may not be correct.  It's time for a good clear picture of your setup so that others can double check your wiring.



Nov 15, 2009, 02:22 am Last Edit: Nov 15, 2009, 03:20 am by vampist Reason: 1
I will get a clear picture. I am lucky I check the thread I was about to disassemble the setup lol...

Oh and with just power, ground, and contrast. It also displays in just the middle. With ONLY contrast on the right top and bottom squares.

I think I may change some wires up so it will be much easier to tell what wire is what and where it goes.
As it stands they are all a dark green. It would be like finding a needle in a haystack.

Pictures in a moment.

Tried even with my good camera.. and just could not get a clear picture.
So I quickly made up a diagram that mimics the arduino setup.

Go Up