So I have a couple problems with my 16x2. First I'll explain my setup. VSS:5V VDO:GROUND VO:POT RS:PIN12 RW:GROUND E:PIN11 D4:PIN5 D5:PIN4 D6:PIN3 D7:PIN2 A:5V K:GROUND. The first problem is it seems that only half the screen turns on. Secondly, the dimmer doesn't stay constant, it fades without touching the pot. I am just trying to run the simple hello world program that comes with the liquid crystal library. However, I am not getting any kind of output printed on the screen. I'd appericiate any help I can get. Thanks
Have you considered connecting pin 3 of the LCD to the potentiometer?
Don
Do you get black boxes if you adjust the contrast pot?
My potentiometer is connected to pin 3. And no I dont get black boxes, I get white ones on half of the screen. I would post a picture but it won't let me, it keeps giving me errors.
ddzboy77:
And no I dont get black boxes, I get white ones on half of the screen.
Same thing.
Indicates the LCD controller is not receiving any instructions.
So is there something I'm missing in the program? I figured it would work as it is one of the example programs from the library and I dont believe anything needs to be defined.
OK, a few problems. Your photo is rather low resolution (something wrong in the processing considering its size) and taken in the dark, inside. Better to take it outside in full daylight but not sun to get sufficiently uniform lighting.
You refer to "one of the example programs from the library" but we have no idea what code and what library so we don't trust that. Please post it according to section 7 of the instructions!
I see your potentiometer is plugged across the centre valley of the breadboard which is in itself, correct. You suggest it is intermittent - its pins may not be properly connecting as they are too short or a bad shape for the breadboard. That is a common problem.
However while you are at it, do not connect the potentiometer to 5 V positive at one end - either leave that end unconnected or if it is a 10k pot, connect both ends to ground - it will work better! This is a long-standing mistake in the circuits published.
As you adjust the contrast potentiometer, you should be able to - reliably - get the blocks on the top row only. If not it is a connection problem.
I am not sure what hose extra components are at the top of the picture - it looks as if the ground may not be properly connected.
Here is my code I am working with. It is the "Hello World" example from the Liquid Crystal library with absolutely no changes made to it.
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
I have attached a picture of the resulting outcome from the code.
The white boxes fade in and out on the screen with absolutely no change to the potentiometer. I have soldered new legs to the pot and I am very confident in it's connection now. I tested the pot to make sure it was working right and according to a multi-meter and fading a led it works perfectly. I tried plugging the voltage legs both into negative like I was suggested, however, then it did not work at all.
I am 99.9% sure I am wired up as I should be, but obviously not. This is a brand new LCD; but with the top and bottom rows lighting up at the same time and only half of the boxes appearing according to everything I have seen that's not a great sign.
If there are any other tests I can run to confirm whether my LCD is good or not I'd appreciate links or the instructions to do so. At this point in time if my LCD isn't bad I am completely stumped.
OK, I cannot figure out what is going on with the connections at the top left of your breadboard - I presume it is some remnant circuit from another experiment but I am not reassured that the ground is correctly connected to the breadboard bus rail and you appear to have ground connected to "AREF". Yet the display is alight.
Either something is intermittently connecting or the power supply is overloaded.
I think you need to get rid of the spurious wiring. Then connect only pins 1,2,3, 15 and 16 of the display and with as I suggested both ends of the potentiometer to ground. I would like to see a photo of this. If you cannot get a stable row of "blocks" on the first line by adjusting the potentiometer, then one of the components connected must be faulty.
ddzboy77:
My potentiometer is connected to pin 3. ...
It is now, but it has moved since the original photo.
How hot is your epoxy blob? Shouldn't VSS be connected to GND and VDD be connected to +5 volts?
Don
The attached picture shows the best visual of the boxes I can get by changing the pot.
How hot is your epoxy blob?
What epoxy blob are you referencing?
Unfortunately this whole electronics thing isn't my area of expertise, so I appreciate all the help I'm getting
Once again you have corrected a mistake without acknowledging such. That's not a good technique for making friends and influencing people.
Although your power connections are now correct that doesn't mean that any damage you might have done to your device while the power was reversed has been fixed.
The HD44780U type controller and its auxiliary controller are most likely covered with epoxy blobs that you will find on the underside of the pc board. Those devices probably got very hot while the power was reversed and although they are quite robust and can frequently survive abuse they may have been irreversible damaged.
Here's my suggestion:
- Remove all of the connections
- Get the backlight working (pins 15 and 16)
- Connect the power and contrast (pins 1, 2, 3 and the potentiometer)
- Adjust the potentiometer and see if you can adjust it to give a single row of blocks.
If that doesn't work you are out of luck.
Don
Well I appericiate all the help and I'm pretty sure it's shot due to my ignorance.
I just realized that your latest photo depicts the test setup I described in my previous message. I guess you should think about ordering a new display.
Don
floresta:
How hot is your epoxy blob? Shouldn't VSS be connected to GND and VDD be connected to +5 volts?
Ah! Good spotting.
Thermal effects - that would explain the spontaneously changing display. Note that there are two chips on the board, one for the left half and one for the right. At present, these are behaving differently, but if you have corrected the wiring and it is showing essentially the same thing I am afraid it is now what we refer to technically as "cactus".
the poti doesn't seem to be connected to GND and VCC ...
noiasca:
the poti doesn't seem to be connected to GND and VCC ...
It is connected to ground. It should never be connected to Vcc, that is a longstanding and very foolish blunder.
Paul__B:
... that is a longstanding and very foolish blunder.
if that's your opinion, than you should try to convince some Arduino guys to correct their examples: https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay
Go on. Paul has been writing about this for YEARS !!
If examples were to change it would upset a larger number of people.
And it is a bit late.
I could advocate "driving on the right", "24 hour clock", "unambiguous date format", "metric weights and measures", ...
I guarantee that there would be thousands of readers who would extol the virtues of Farenheit, bushels, AM/PM, ...
David.
noiasca:
if that's your opinion, than you should try to convince some Arduino guys to correct their examples: https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay
You are of course, joking!
(Well, I know you are. )
The tutorials include a section on how to use "String"s (those with a capital "S") despite the fact that using Strings will crash the Arduino.
It took years to have a stupid mistake corrected in the shiftOut tutorial and even then it was only corrected in the circuit schematic, not in the breadboard diagram:
Note the capacitor shown bypassing the green - data pin - wire to ground!
Yes, it's all "set in stone", the good and the bad.