r/arduino•
SameDaySS

LCD 20x4 with adjustable back-light?

Hardware Help

Hi, I have a 20x4 LCD display and the back-light is way too bright when monitored by IP-camera. I have been reading datasheets and none of them seem to have a "dim" option.

Does anyone know of a small LCD display that I can dim as this current one just looks like a big white blob on the camera.

I tried one of the TFT displays but they too are too bright.

Posted Feb 25, 2023, 3:35 PM UTC

16
nsmith0723•

On the back side of it there is a jumper named led. Pull that jumper and wire a pwm to the top pin. You'll be able to control its brightness

2
SameDaySSOP•

WOW -- thanks so much. That is awesome. Here's my test code if anyone else ever wants to use this.

const uint8_t PIN_BACK  = 5;   // LCD backlight

int16_t test = 255;
void setup(void) {
  pinMode(PIN_BACK,OUTPUT);
  analogWrite(PIN_BACK,255);
  lcd.begin(20,4);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("CONTROLLER");
}

void loop() {
  if (test < 5) {
    test = 255;
  }
  analogWrite(PIN_BACK,test);
  lcd.setCursor(10,3);
  lcd.print("   ");
  lcd.setCursor(10,3);
  lcd.print(test);
  test -= 5;
  delay(500);

}

2
roo-ster•

From here, it would be simple to add an LDR and have the Arduino adjust the brightness of the screen based on the ambient light level.

1
JimHeaney:Community-Champion: Community Champion•

You can fully turn off the LED backlight with the "LED" jumper, or you can add additional resistance between the "A" and "K" pins of your screen, this is the anode and cathode of the LED backlight. Odds are there is a resistor already on that i2c adapter board somewhere, perhaps try putting a resistor across the LED jumper pins?

1
SameDaySSOP•

Thanks, but the @nsmith0723: PWM approach above solved it fine.

2
Successful-Trash-752400k :400K: nano•

put your bl wires to pwm and you can control the brightness through pwm. or connect it to pwm pin through a transistor.

1