Page 1 of 1

Changing backlight control pin

Posted: Thu Dec 08, 2011 9:26 pm
by andrewduncan
I want to change the backlight control pin on the 16x2 LCD shield. This is a part of getting the shield working together with the USBDroid. The problem I am having is working out how I can remove the backlight control from pin D3. The links to wire up other pins to the backlight control are easy to find, but I can't work out how to remove the control from pin D3. Is LINK2 connected and just need to be cut, or is there another connection to pin D3. I could just remove pin D3 from the LCD shield, but I am sure there must be a neater solution.

Thanks Andrew

Re: Changing backlight control pin

Posted: Mon Dec 12, 2011 3:27 am
by LukeW
There is a copper track running through the middle of the "LINK2" (which maybe labelled as "D3" on the board) pads on the board, you can sever this track to disconnect it.

Then you can short out one of those other unconnected alternative pads to link the backlight control signal to one of the other Arduino pins which is unused in your configuration, so it doesn't conflict with anything else in your particular hardware configuration. I think on the board silkscreen they are all labelled with their Arduino pin numbers.

Re: Changing backlight control pin

Posted: Mon Dec 12, 2011 3:51 am
by andrewduncan
Thanks Luke. That makes sense. It is labelled D3. I just couldn't see the copper track, I guess it is under the silkscreen. Thanks for your detailed answer. I am going to use one of the analog pins (A1) for the backlight. Thanks again.

Andrew

Re: Changing backlight control pin

Posted: Fri Jun 13, 2014 6:37 am
by moonerj2
once pin d3 is changed, do you need change any code? or setup the display differently?

Re: Changing backlight control pin

Posted: Sun Jun 15, 2014 11:25 pm
by angusgr
Hi moonerj3,

The backlight is on by default (pin 3 has a pullup resistor.) So by default it's turned on, even if it's not referred to in the sketch at all.

If you cut the connection and move it to another pin, the pullup resistor may become disconnected so you may need to drive that pin high with digitalWrite() so that the backlight comes on.

Here's a quick example sketch that turns the backlight on as part of setup(), then flashes it as part of loop(). Changing the "#define BACKLIGHT_PIN" line allows you to use a different pin.

Code: Select all

#include <Wire.h>
#include <LiquidCrystal.h>

#define BACKLIGHT_PIN 3

LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

void setup()
{
  /* Set up backlight pin and turn on */
  pinMode(BACKLIGHT_PIN, OUTPUT);
  digitalWrite(BACKLIGHT_PIN, HIGH);
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop()
{
  /* Blink the backlight off and on! */
  digitalWrite(BACKLIGHT_PIN, LOW);
  delay(1000);
  digitalWrite(BACKLIGHT_PIN, HIGH);
  delay(1000);
}