I am using a 20x4 (JHD 204A) LCD display with green backlight. It works well. I had connected a new 16x2 LCD (JHD 162A) with blue backlight which does not work. I am wondering how 20x4 and 16x2 from the same manufacturer does not match each other.
I had purchased one more 16x2 blue back LCD from another shop which also does not respond. Contrast adjust shows no difference, 20x4 LCD before initialization shows 2 rows full of blocks and 2 rows empty, with 16x2 just empty like a screen after lcd.clear() command.
I had tried with a simple code, 20x4 responds there too, but 16x2 does not. Please help me. :~
// include the library code: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 13, 8, 9, 10, 11);
void setup()
{
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("HELLO WORLD");
}
void loop()
{
}
How about a photo of your wiring ?
How is the backlight wired ?
How is the contrast pot wired ?
How about a photo of the 20x2 working correctly with the same wiring ?
These devices should be entirely interchangeable as far as the code is concerned. If you substitute a 16x2 for the 20x4 you may not see all of the text, but some of it should be visible.
You might have to tinker with the backlight. Some displays do not have a backlight and others are almost illegible without one. You might also have to tinker with the contrast when you switch displays.
If your original display worked OK and the others display one line of blocks (for the 16x2) or two lines of blocks (for the 20x4) then you may have messed up some of the wiring when you swapped displays. Pug the 'good' one back in and see if it still works.
Another possibility for the 'blank' display is that it may be an 'extended temperature' device in which case you may need a negative contrast voltage.
Otherwise your 'bad' displays may just be substandard (out of spec) in which case they may not work with the timing in the standard LiquidCrystal library.
I had tried to convert a electric room heater application with blower (in a box) to an automatic one with sensor. Due to connectivity issues in my breadboard, i had made a pcb by my own. I had checked it thoroughly and found all connections are ok, 20x4 lcd also works well, only 16x2 does not work. This is my first time buy of a 16x2 LCD.
About the attachments
20x4.jpg shows the 20x4 displays HELLO WORLD
16x2.jpg shows the 16x2 displays nothing
20x4 and 16x2.jpg shows both the displays have the same pin order (pin 1 to 16 on the bottom)
Schematic_Tmp_ctrlr_main_brd.pdf shows the schematic of the pcd that i had made. A five key keypad is an addition, which is under preparation.
16x2 has the pin config printed on the back which was similar to the connection what i have made. Still does not work !?
That's a nice PCB and all but the wiring for a 1602 LCD (4-BIT parallel, NOT I2C) that most of us are familiar with
is this one:
Strangely enough, yours is very similar, but this is the first time I have seen any documentation suggesting or STATING,
that what we commonly refer to as a 4-bit parallel lcd is actually a SPI lcd. That's news to me. I'm not saying it's not,
but there are some inconsistencies, for example the pin labeled MISO. I'm sure you know what that stands for yet in
the LiquidCrystal.h library that pin is the rs pin and it is clearly FROM the Arduino TO the LCD , which is NOT
MASTER-IN,SLAVE OUT.
All the other pins in your schematic are consistent with being Arduino OUTPUTS /LCD INPUTS. If the protocol we are
all used to referring to is actually SPI, then you should be able to connect multiple LCDS and control them all from the
same Arduino, busing all the pins together , as long as you have a unique chip select (SS) for each one. I've seen
maybe 30 to 40 postings about these displays but never anything about them being SPI or about running multiple
displays on the same bus using different chip selects. Do you have any documentation to support the reason you
named the signals as you did instead of using the naming convention in the above link ?
How do you explain the MISO inconsistency ?
I can't read the code in the LiquidCrystal library. It must be assembly language or compiled or something because there
is no code for the functions listed. I don't know how that works. I'm still learning about libraries.
I am using a normal 8line/4line parallel LCD. Since i use the same ports for In System programming, i had named them after the SPI. Actually they are not SPI lines, sorry for the confusion.
About the potentiometer, my pcb layout library has a swapped connection for wiper and gnd, so to match the pcb layout i used this way in the circuit. Now layout has the middle (wiper) for contrast pin
1k resistor in the LCD line was planned early for another use and i forgot to remove it in the pcb making, after shorting the resistor 20x4 LCD started working.
This display contrast pin shall be grounded directly (but more bright) or shall be connected through a very low resistance to ground, unlike my green 20x4 display where i need a resistor to supply. This is just the inverse of the usual displays.
I was doing something thinking myself as intelligent, actually i was stupid, a simple try would have saved my 2 days of time and also your time
You don't really need a pot. If you use a voltage devider with a 10k resistor to +5V with the other end
connected to a 1 k resistor to ground and connect your contrast pin-3 to where the two resistors are connected
to each other the voltage will be about 0.79V dc which should be nominal. You can vary the 1 k resistor in
200 ohm increments to fine tune it but that should be close enough.
Good catch on the D4 resistor Don .
This display contrast pin shall be grounded directly (but more bright) or shall be connected through a very low resistance to ground, unlike my green 20x4 display where i need a resistor to supply. This is just the inverse of the usual displays.
In general these devices need their contrast pin to be about 4.7 volts below their supply voltage which means about 0.3 v above ground.
The best way to achieve this is with a voltage divider, typically in the form of a potentiometer.
Many devices work acceptably with the contrast at 0v and some work when cobbled up with a resistor or diode to GND but the recommended potentiometer technique is the best solution.
If you have a device intended to be used over an extended temperature range then the whole picture changes as a negative voltage is frequently required at the contrast pin.
As I said before: "These devices should be entirely interchangeable as far as the code is concerned. If you substitute a 16x2 for the 20x4 you may not see all of the text, but some of it should be visible." If you go the other way some of the fancy cursor positioning might not work as expected but the text should be visible.
It is more than likely something very simple.
Given the initial post talks about the contrast pot not working, my
guess is that either the pinout is backwards for the blue display or the constrast pot needs more adjustment.
The ideal constrast setting will more than likely not be the same between
the two displays and since the contrast pot is on the main board, it
will need to be adjusted when the display is changed.
That pot looks like a multi turn pot, so it may need quite a few
turns to affect the pixels.
I am facing the same issue you had earlier in the process. I am connecting an Arduino Pro mini to a 16x2 LCD, I am following the same configuration given by Arduino (http://arduino.cc/en/Tutorial/LiquidCrystal) and would like to firstly clarify that if I am using an Arduino Pro mini will there be different configurations to get the display?
So far I have managed to get the backlight to light up, at first there were only black pixels throughout the top half of the LCD and now I have dropped to just a coloured screen ( :0). The following images show what configurations I have used and the output so far. (Please look at the image that is Titled 4). The image labelled 1, is a picture of what i originally got butnow when I connect a power source the black boxes are no longer visible.
The code I have been using is a direct copy of the 1 taken from Arduino home page (Hello World) with no modifications needed as it what I have in my circuit, connection wise.
The final image uploaded (titled WOOHOO) was the tutorial I was following when making connections and managed to get the blocks of pixels visible.
Any suggestions would be MUCH appreciated, if further description or images are neccessary please let me know.
This is a different problem and should be addressed in it's own thread. Use a title that describes your problem (which doesn't seem to have anything to do with a 20x4 display).
When you do repost it mention whether or not you have tested the contrast adjustment, assuming you know how to
wire that up. If not you need to clarify that. Don't worry about text until your contrast adjustment works because you
won't see any text if it doesn't.