Pages: 1 [2]   Go Down
Author Topic: Liquid crystal problem  (Read 2368 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6914
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, sorry I thought you didn't. So here is what you found, with lcd.begin(16,2), there is no text however you turn the potentiometer? Right?
Do you have a multimeter? Measure the voltage on the middle pin of the potentiometer AS YOU TURN. Any change in voltage?
Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All is normal. At one end 0,012V at the other 5V and in between i get 1.2 or 2.3 or 3.4. So it's ok.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All is normal. At one end 0,012V at the other 5V and in between i get 1.2 or 2.3 or 3.4. So it's ok.
Is this measured at the potentiometer or at the display (you could have a bad connection).  You typically want less than 1 volt, frequently only 0.3v.  Perhaps some nice clear, in focus, photographs would help us spot something we haven't thought about.  They must be shot straight down so we can see the display and both ends of all the interconnecting wires.

Don
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All is normal. At one end 0,012V at the other 5V and in between i get 1.2 or 2.3 or 3.4. So it's ok.
Is this measured at the potentiometer or at the display (you could have a bad connection).  You typically want less than 1 volt, frequently only 0.3v.  Perhaps some nice clear, in focus, photographs would help us spot something we haven't thought about.  They must be shot straight down so we can see the display and both ends of all the interconnecting wires.

Don

Measured at the display.

LE: Added the pictures. The problem is with the library. I still don't understand how the 4 data pins can influence the contrast. I could eliminate the trimmer by putting the contrast directly to gnd.


* IMG_4776.JPG (434.44 KB, 2250x1725 - viewed 20 times.)

* IMG_4772.JPG (429.17 KB, 2253x1653 - viewed 17 times.)
« Last Edit: February 08, 2011, 06:11:25 am by Shebu » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The problem is with the library.
It's more likely that the problem is with the LCD module.

Don
Logged

Minnesota USA
Offline Offline
Sr. Member
****
Karma: 1
Posts: 323
Made it mahself outta sand 'n wahr.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I note the late edit to your first post that the same issue arises with a 20x4 LCD. That makes it unlikely that the problem is with the LCDs.
I notice that you have a Mega. What I do with my Mega is plug the LCD in directly; Pin 1 (GND) goes into the GND next to socket 53, pin 2 into socket 53.( I use this with a bit of a kludge for the contrast pin either a 1000 ohm resistor bridged to ground or solder stackable header onto the first 3 pins and plug a contrast pot in directly.) In your case, you are only seeing anything when you pull contrast all the way to ground, so I added a couple of lines to ground the contrast pin. It is hard to have wiring issues this way. You could still have a solder bridge I suppose.


I stripped some stuff out of working code to make it simpler, so I haven't run exactly this, but it should be trivial to plug your LCDs in as described above and try it.
Code:
#include <LiquidCrystal.h>
 
 LiquidCrystal lcd(49,47,45, 35,33,31,29);
 

 void setup() {
 
  int BACKLIGHT = 27;    // pin 27 will control the backlight I check current on the backlight in the datasheet before I solder pins there!
  int BACKLTGND = 25;    // PIN 25 will be set LOW to provide a Gnd for the backlight
  int POWER5V = 53;      // we will set this HIGH to provide power on pin 2 of the LCD
  int GNDMain = 255;      // next to pin 53 (in the pin "55" position) is a GND--pin 1 of the LCD goes there
   pinMode(POWER5V, OUTPUT);          //We're using a digital out as a 5V power source for the LCD
    digitalWrite(POWER5V, HIGH);
   pinMode (GNDMain, OUTPUT);
   digitalWrite(GNDMain, LOW);
 
//be sure the current draw on the backlight is less than 40 mAmps before you uncomment these 4 lines
 //  pinMode(BACKLIGHT, OUTPUT);        //set 255 if you need to wire backlight to gnd bo high current draw
//   digitalWrite(BACKLIGHT, HIGH);     // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
//   pinMode(BACKLTGND, OUTPUT);        //We're using a digital out as a GND for the backlight
//   digitalWrite(BACKLTGND,LOW);
 
//what the heck your contrast only showed something when you pulled it to ground anyway:
pinMode(51,OUTPUT);
digitalWrite(51,LOW); //ground the contrast pin

  lcd.begin(16,2);

lcd.setCursor(0,0);
lcd.print("Hello World!");
lcd.setCursor(0,1);
lcd.print("hello Mega!");
 }

 void loop() {
}


There is a version of LiquidCrystal with better timing on some of the delays at http://code.google.com/p/liquidcrystal440/
I do not think your problem sounds like any of the things I saw with bad timing however.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A late edit (or any edit after an subsequent post) is a bad idea because only new readers are likely to notice it.  When you respond to an Email notice of a forum reply it takes you directly to the end of the thread, not the beginning.

We still haven't seen a usable photograph of the wiring or of the actual characters being displayed so it's pretty much a shot in the dark.  Everything the OP has said still leads me to believe that it is likely to be a contrast issue.  Since the message (or at least the first line) is visible the basic wiring and the timing must be OK.  We still don't really know if he is using the begin function and we don't know what the display really looks like.  It could also be a backlight issue since some displays aren't too visible without proper backlighting.  That 220 ohm resistor would be suitable for a single LED connected to a 5v supply but most backlights use several LEDs in a series/parallel combination and use a lot smaller resistor.  Some even have the proper resistor on-board and do not require an external resistance.


Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same problem... the display contrast is very low until I remove the lcd.begin(16,2) line.

The LCD I am using is WM-C1602N and datasheet here.
http://www.datasheet4u.net/datasheet/W/M/C/WMC1602N_ETC.pdf.html

any solution for this issue?
« Last Edit: February 26, 2012, 11:15:48 am by lawleo » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have the same problem... the display contrast is very low until I remove the lcd.begin(16,2) line.

The answer is in reply #4.  Have you followed the suggestion I posted there?

Don
Logged

Pages: 1 [2]   Go Up
Jump to: