Display not showing anything

Hello. I have Just bought an Arduino Mega kit and I was playing around with the components, but I have failed to do anything with the LCD screen. I have watched multiple tutorials, but nothing. I'm not sure if I have just done something wrong or the LCD is broken.

Here are some pictures for you to be able to see what is connected where: Dropbox - File Deleted

My cables are also in perfect condition, I have measured it and the voltages were everywhere as they should be.

My code has an

#include<LiquidCrystal.h>

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

at the top and in the setup function there are 2 lines:

lcd.begin(16, 2);
lcd.print("hello, world!");

Thanks for help

When you just power the LCD and the backlight, and nothing else connected, can you adjust the contrast until you see one line full of solid blocks and one empty line? Like this:

Also, you should put some current limiting resistance between the anode and cathode of your backlight.
(Edit: Yes, I meant in series. I said it WRONG! Thanks Paul__B.)

Edit to add: It looks like those header pins are not soldered to the LCD PCB. How are they connected?

Jobi-Wan:
Also, you should put some current limiting resistance between the anode and cathode of your backlight.

Not if resistor R8 on the display is "101" or 100 Ohms. And you explained it wrong! You meant in series with either the anode or cathode pin.

Jobi-Wan:
Edit to add: It looks like those header pins are not soldered to the LCD PCB. How are they connected?

Dead right!

Not soldered = not actually connected!. :astonished:

There is a little rule of electricity/ electronics here: You must make a physical connection from one conductor to the next in order to make an electrical circuit. They must be pressed together.

Actually, if you cannot solder it, you can wedge a toothpick into every one of the 16 holes alongside the header.


Now while we are at it, a little hint I like to put in: Remove the wire connecting the potentiometer to +5 V. Do not connect the potentiometer to 5 V, only to ground and pin 3 of the LCD.

This is a mistake that has been mindlessly propagated through years and years of "tutorials" and amateur designs (and probably a few professional ones as well). It will not prevent the display from working, but the wrong connection makes it more significantly more difficult to adjust.

  1. Yes, I can change the contrast
  2. Yes, I can see those yellow rectangles
  3. I have connected them with pins that have 2 "heads". I'll upload a picture of it when I get home.
  4. I'll try the toothpick idea. And edit the comment if it works or not. Thanks

Paul__B:
Remove the wire connecting the potentiometer to +5 V. Do not connect the potentiometer to 5 V, only to ground and pin 3 of the LCD.

This is a mistake [...]. It will not prevent the display from working, but the wrong connection makes it more significantly more difficult to adjust.

I hope this is not considered thread hijacking but could you elaborate on this a bit?
So if the contrast is set by adjusting the resistance from pin 3 to ground, not by the voltage you set to pin 3, does that mean that pin 3 is a current source? And doesn't that also mean that the total resistance of the potentiometer matters more?

Jobi-Wan:
I hope this is not considered thread hijacking but could you elaborate on this a bit?

With pleasure! :sunglasses:

Jobi-Wan:
So if the contrast is set by adjusting the resistance from pin 3 to ground, not by the voltage you set to pin 3, does that mean that pin 3 is a current source? And doesn't that also mean that the total resistance of the potentiometer matters more?

Pin 3 is indeed a current source. It is a "ladder" of five 2k2 resistors (R1 to R5 on the board) connected to Vcc and setting the contrast voltages for the liquid crystal. As follows:


There was a major mistake early on in the application of the HD44780 LCD driver chip where a designer copied something from a test circuit in the chip documentation where a potentiometer was used to set the contrast voltage. In fact, I have not been able to locate this misleading circuit, it is not in the present datasheet to hand which shows only the correct configuration (in figure 21, page 37) of a variable resistor in series with the negative supply to the contrast ladder. You may note that the negative 5 V supply is only required for the uncommon "extended temperature" version of LED displays, for almost all readily available, the contrast voltage is slightly less that 5 V and the resistor connects to ground.

Nevertheless, once made, this blunder became ingrained in almost all following designs and "instructional" literature, since few designers actually understood the magical workings of a multi-level multiplexed LCD - or cared to spend the time to do so.

The popular modules - the "1602", the "2004" and other variants - have the resistor ladder shown in figure 21, consisting of five 2k2 ("222") resistors "R1" to "R5", totalling 11k. R6 or "RF" is the clock oscillator of the HD44780 while R7 is 0 in the 5 V versions. R8, usually "101" as 100 Ohms is the LED resistor. The usual optimum contrast voltage - the voltage on the ladder between Vdd and Vo is between 4.5 and 4.8 V, corresponding to between 0.2 and 0.5 V on Vo. This then is most readily set by a resistance between 200 Ohms and 1.2k - if the supply voltage is actually 5 V - as this resistance becomes the correct proportion of the resistor ladder.

With the incorrectly wired 10k potentiometer, this resistance would be set with the potentiometer in the first (ground) tenth of its range (so ten turn potentiometers are often used) however the additional part of the 10k connected to 5 V draws an additional and completely undesirable 500 µA or so requiring the potentiometer to be set within the first twentieth of its range.

This is an absurd situation; if you must use a 10k pot, then it should never be connected to 5 V; the "free" end may be connected to the wiper or even to the ground end as this actually reduces the value of the potentiometer and makes contrast setting easier.

The correct value of the potentiometer, wired as a variable resistor with wiper connected to one end is 1k or 2k. This spreads the usable contrast setting to the whole range of the potentiometer.

Paul__B:
With pleasure! :sunglasses:

Thanks. I learned something useful today.

Please pass it on.