1. Sweet writeup, I’ve been looking for a good intro to working with LCDs and my Arduino, because I’ve been having the same issues. I’ll be watching to see if you figure it out, yeah? And thanks for the links!

    • Jeff, glad the post was helpful … I’ll definitely be keeping an ongoing list of links in this series of posts as I figure things out. Goodness knows the Internet has already helped me out huge with this, so hopefully I can contribute back with some knowledge too.

  2. You mentioned that you had a problem with the contrast. How are you controlling the contrast pin?
    On my boards I use a pot and the contrast is quite good. Your LCD looks very similar to the Optrex 51505 that I use. The schematic of my board is in the datasheet at http://tinyurl.com/9mv2cs

    • I tried it two ways — I grounded the contrast pin and I also used analogwrite from pin 5 (if I remember correctly) to do a variety of tests (I figured this was more accurate than using a pot for troubleshooting).

      The problem only appears when using lcd.begin(), regardless of trying to put text on two lines … so, I’m not sure what the problem is with that command (or with how I’ve tried to set things up).

      • The analog write is a digitally generated voltage. You need a filter cap to generate a stable DC value. As you draw current from the pin the voltage will drop. With a decent size cap the voltage drop probably would not be much in an LCD application.

        Not sure how lcd.begin() could cause a constrast problem.

        • Thanks for the help with this … I’ll try the contrast pin with a pot.
          I’m sure it’s a silly mistake on my part somewhere, but it’s really strange, because I can set up an Arduino sketch that simply says write “test”, and it works perfectly fine, good contraste totally legible. Then I’ll add the line lcd.begin(16,2) in the setup and the contrast will be so weak that it’s illegible.

          That line is the only change I make, and whether I ground the contrast pin or try the analog write, it’s results in the same problem.

  3. Toaster

    I have the same problem…
    One line – working perfect
    Two lines – bad contrast…
    The next try will be to use a negative contrast voltage, hope this will solve the problem…

  4. Hi justin!
    For the 2 line contrast thing I have run into similar issues before. I recommend using a pot to control the contrast line. Also, depending on how your script is written if you don’t have enough delay() then it will be constantly flickering on and off as it rewrites itself.
    Lastly, as toaster mentioned, some lcds want to have a neg voltage for contrast. That’s never fun to work out. Check the data sheet, and if it does want that I’d just buy a different lcd!

  5. bob


    Nice post and was really helpful.
    But I am having a very serious problem:
    I tried a couple of example codes, with the respective schematics, and the LCD just doesnt work. NOTHING comes on, absolutely no dark spots!
    I tried out with 2 LCDs.

    Can u think of any reason?

    I did try Grounding the contrast pin throught a pot. It also didnt work.


    • Is your LCD backlit? Maybe the first thing to try would be just connecting the power and ground for the LCD, then the same for the backlight, without having the Arduino programmed. Grounding the contrast pin, and avoiding the pot might also be a good place to back up, simplifying things is probably the best way to problem solve with this.

      Sorry I couldn’t be of more help.

Comments are closed.