Which resistors for contrast and backlight for 20x4 LCD display

Hello,

the title says it all, I believe.
Can you tell me, which resistors to use on those displays. I haven't been able to display anything proberly.
Or which potentiometers should I get.

Thanks

Contrast - a 10k potentiometer connected between GND and Vcc. The wiper goes to Vo - pin 3. It will need to be set quite close to the GND end. A 470 ohm from GND to Vo and a 10k from Vo to Vcc may approximate. Some odd sorts of display require something different.

Examine the board for the traces between Pins 15 and 16, and the LED. It will generally have two resistors in series, one being a "0". If the other is 100 ohm (101), you do not need any other resistor in series with the LED.

If you haven't been able to display anything properly how do you know that the problem is the contrast ?
The backlight makes things easier to see, but I don't think it prevents you from seeing text like the contrast does.

If you haven't been able to display anything properly how do you know that the problem is the contrast ?

Maybe because that is one of the major reasons for not being able to see anything on the display.

The backlight makes things easier to see, but I don't think it prevents you from seeing text like the contrast does.

Unless you have one of the displays that is virtually impossible to see without a backlight such as the popular blue displays with white characters.

Don

Ok then I guess we can rule out all the other possible reasons...

Thanks for the replies.

Maybe I should have made it clearer that from an angle I can see everything perfectly. So the code is working. I therefore assume that it is a problem with the resistors.
I have ordered quite a few different potentiometers and will try them, when they get here on Friday (hopefully)
I do have all sorts of resistors here, but it's very tedious soldering in the different values of resistors all the time.

I will look for the 100 Ohm resistor.

Thanks for the clarification. The contrast pin needs 0.3V to 0.8V for best visibility.
You can use a 10k resistor connected to +5V in series with a 1k resistor connected to ground. The point where
they are connected in the middle should be about 0.4V dc, which should give you a decent visibility until
you get your pot.

Hey ! Hey!!

That worked flawlessly as you can see

Just for my education.
Could I not also have connected the contrast pin to an analogue pin on the arduino and set it to an output value of around 80?

See attached file.
The value I used was 46 when I did this in Nov of 2013.
You need to isolate the contrast pin from the PWM signal (it's not analog when it's an output, I don't care what they call it)
with a 4.7k ohm resistor between the analog (PWM) pin and the contrast pin with a 1 uF cap from the contrast pin to ground
This will filter the PWM to an acceptable level of ripple to eliminate the flicker you would get if you tried what you suggest.

(de nada, mi casa es tu casa)

HOBBYCOMPLCD_3.ino (1.97 KB)

This is more or less, what I want the final display to look like

I am wondering if there's a wayto get the "°" degree character and maybe a "0" with a line through it for an "average character"
I wouldlike that a lot.

read this:

see attached file for example

look for the part after this:

// Kode for å få æ, ø, å, Æ, Ø, Å i display

garagesensor.ino (2.45 KB)

Thanks a lot again.

I think, I did very well for a beginner.
It looks very good now, I think

#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int backLight = 13;    // pin 13 will control the backlight

byte average[8] = {
  B01111,
  B10011,
  B10111,
  B10101,
  B11101,
  B11001,
  B11110,
};

byte degree[8] = {
  B01000,
  B10100,
  B01000,
  B00000,
  B00000,
  B00000,
  B00000,
};


void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH);
  lcd.createChar(0,average);
  lcd.createChar(1,degree);
  lcd.begin(20,4);   
  lcd.clear();       
  
  // row 0
  lcd.setCursor(0,0);
  lcd.print("03:54");
  lcd.setCursor(7,0);
  lcd.print("23.2kmh");
  lcd.setCursor(15,0);         
  lcd.print("23.4");
  lcd.setCursor(19,0);
  lcd.write(byte(1));
  
  // row 1
  lcd.setCursor(0,1);
  lcd.print("25.1V");
  lcd.setCursor(7,1);
  lcd.print("250W");
  lcd.setCursor(15,1);         
  lcd.print("23.1A");
 
  // row 2
  lcd.setCursor(0,2);
  lcd.print("12.3km");
  lcd.setCursor(7,2);
  lcd.print("123Wh");
  lcd.setCursor(14,2);         
  lcd.print("17.3Ah");
  
  // row 3
  lcd.setCursor(1,3);
  lcd.print("6.2Wh/km");
  lcd.setCursor(12,3);
  lcd.print("23.1kmh");
  lcd.setCursor(19,3);
  lcd.write(byte(0));
}

void loop()
{
}

Not bad.
In and out in what , about 4 hours ?
Yeah you did ok for a beginner.

Now see if you can help someone else ...
I think you'll find that you learn faster trying to help others than if you work alone because they
push you to learn the answer. I guess you could say we're like detectives trying to solve cases and the
more cases you close the better you feel. Don't get me wrong, I'm not trying to compare us to
"The First 48" or anything but it has it's intrique in a geeky sorto way...

I am wondering if there's a wayto get the "°" degree character and maybe a "0" with a line through it for an "average character"

With many (most??) LCD controllers you don't need to create a custom character for the 'degree' character. It is typically displayed with the address code of 0xEF 0xDF.

If you can live with a 'theta' instead of a slashed 0 then use 0xF2. These are shown, along with lots of others, in Table 4 of the Hitachi HD44780U data sheet.

Don

Edit: Address error corrected per next post.

With many (most??) LCD controllers you don't need to create a custom character for the 'degree' character. It is typically displayed with the address code of 0xEF.

I think you mean 0xDF

raschemmel:

With many (most??) LCD controllers you don't need to create a custom character for the 'degree' character. It is typically displayed with the address code of 0xEF.

I think you mean 0xDF

Yes I did, thank you.

Don

Unless you have one of the displays that is virtually impossible to see without a backlight such as the popular blue displays with white characters.

That's right, I forgot about those, they are quite popular and as you say, useless without the backlight.