Serial LCD brightness

Hi all,

I have bought a Red Serial LCD from sparkfun, ( http://www.sparkfun.com/commerce/product_info.php?products_id=9394 ) and am trying to adjust the brightness with arduino as i need to make it visible behind a translucent black plastic sheet. At the moment the Red simply doesnt shine through, i was wondering if anyone has changed the brightness and how it compares to a basic red LED, and also what code i need to be using to adjust it? I have tried before but it didnt seem to dim or brighten the backlight.

Thanks

SparkFun's lcds have the default brightness set at it's brightest, but you can try adjusting the potentiometer on the back if it has one.

does the potentiometer change the contrast though? hmmm, interesting that its the maximum brightness, is there anyway of boosting it?

The pot changes the contrast but I would have thought that it is your problem. The brightness is normally pretty good.

If you look at this: http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF then it describes how to increase the brightness in the code up to a maximum in case yours is not set at the max.

Mowcius

I was messing around with the brightness of my SparkFun 2.5 Serial LCD today and came up with the following, using a potentiometer connected to A0 [Value 0 - 1023] to control the LCD brightness [Value 128 - 157]. You can see the simple fitting parameter in the math section of my code.

/*
Try to control the serial LCD brightness with a potentiometer
*/

int sensorPin = 0;
int sensorValue = 0;
int brightnessIndex = 128;
int brightnessPrev = 128;

void setup()
{
  Serial.begin(9600);
}


// Starts the cursor at the beginning of the first line (convienence method for goTo(0))
void selectLineOne() { //puts the cursor at line 0 char 0.
  serCommand(); //command flag
  Serial.print(128, BYTE); //position
}

// Starts the cursor at the beginning of the second line (convienence method for goTo(16))
void selectLineTwo() { //puts the cursor at line 0 char 0.
  serCommand(); //command flag
  Serial.print(192, BYTE); //position
}

// Resets the display, undoing any scroll and removing all text
void clearLCD() {
  serCommand();
  Serial.print(0x01, BYTE);
}

// Turns the backlight on
void backlightOn() {
  serLcd();
  Serial.print(157, BYTE);
  //128 off
  //140 40%
  //150 73%
  //157 Fully on
}

// Turns the backlight off
void backlightOff() {
  serLcd();
  Serial.print(128, BYTE);
}

// Initiates a function command to the display
void serCommand() {
  Serial.print(0xFE, BYTE);
}

void serLcd() {
  Serial.print(0x7C, BYTE);
}


void loop()
{

  Serial.print("PotVal = ");
  sensorValue = analogRead(sensorPin);

  clearLCD();
  selectLineOne();
  Serial.print("PotVal = ");
  Serial.print(sensorValue);

  // Match the potentiometer limits with the LCD brightness value limits
  brightnessIndex = round(157 - 29 * (1023 - sensorValue) / 1023);

  selectLineTwo();
  Serial.print("Bright = ");
  Serial.print(brightnessIndex);
 
 // Only send brightness adjustments when there has been a change (reduces flicker)
 if ( brightnessIndex != brightnessPrev ) 
  {
  serLcd();
  Serial.print(brightnessIndex, BYTE);
  brightnessPrev = brightnessIndex;
  }

  // Play with this delay according to your needs
  delay(200);
}

Hi, thanks for that code, however, although helpful it didnt seem to change brightness? is the change substantial or minimal? i have taken some photos to show the difference, if there is any? i cant seem to see any.

LCD at 128 brightness

LCD at 157 brightness

Can anyone see a difference? is that how it is suppose to be, a minimal change?

The change is normally greater than that.

That highest brightness looks about as bright as I would expect it to be.

Mowcius

Is it possible to put it behind a red plastic sheet instead of a black one?

wouldnt a red plastic sheet be worse as there would be no way of differentiating?

I was wondering whether the White LCD would be any better do you think?

As red is of a very low frequency is it not?

Red is a low wavelength. A red filter would be better as it would not let any light through apart from the red light from the display. I presume that you want a filter so that you cannot see the display when it is off.
A dark magenta filter should work well.

Mowcius

It is indeed to stop it being seen behind when off, however i am very far on with this project and a front face, of which the LCD will be behind, has already been made in black and due to time will be unable to make a different coloured face.

Do you know if the white might be better at showing through the black or do you think it will be much the same issue?

Hmm, I would have thought you will have issues whatever colour you use.
White would probably be better as there is more of the spectrum of light to pass through and it is probably 'brighter' for that reason.

Mowcius

thanks Mowcius, i will have to experiment. :slight_smile: .... if not i will build a row of LEDs and diffuse them somehow.

Thanks to others who posted too.

Here's what it should look like... It seems like your LCD isn't registering the brightness commands, because 128 brightness should = OFF, and 157 is max brightness.

Video: [turn sound down, something is messed up about the vimeo conversion] http://vimeo.com/11389496

Ahh yeah, that does seem to suggest there is something up with my LCD :S. That is a lot lot brighter at 157 aswell, i think? do you agree?

Hmmm, could it be the actuall hardware that isnt too good, i think this has been the problem all along as i have tried to set it to 128 before and it has never worked.

I have connected the LCD into the tx pin on the arduino, thats right yeah? ...

From your pictures you seem to have 2 red wires from the LCD and 1 black on the other side, I have been using a JST 3-pin connector (http://www.euromodels.com.au/images/accessories/JSTXH2SLEAD.jpg) that will still do the same trick wont it?

hmm, does anyone have any ideas?

I didn't have a connector so I just used some pins, and I'm getting ground from another part of the board just to keep it safely away from Vcc. Good luck!

I tried to use that pin one on the side of the LCD rather than the JST 3-pin and it didnt seem to work, i wasnt getting a readout on the screen.

This mystery seems so odd. Has anyone else had this experience? Is it something with the way it is connected up? Or is it more likely something to do with my board?

Thanks
Matt