Having trouble turning on LCD backlight using transistor

Hi,

I'm having trouble turning on my LCD backlight with my Arduino Uno. The LCD I'm using is a standard 16x2 HD44780 compatible display and according to its datasheet needs between 80 and 120 mA of current for the backlight. As the I/O pins on the Arduino Uno can only supply 40 mA of current I am trying to use a standard 2N2222a transistor to turn on the backlight.

I've attached the positive pin of the backlight (pin 15 on the LCD) to 5V via a 100 Ohm current limiting resistor. I've attached the negative pin of the backlight (pin 16 on the LCD) to the collector of the transistor. I've attached the base of the transistor to a digital pin on the Arduino Uno (pin 1) via a 15 KOhm resistor. I calculated this base resistance assuming a collector current of 100 mA and a DC current gain of 300 (the maximum current gain specified in the transistor datasheet). The emitter of the transistor is connected to ground.

When I power up my Arduino Uno and run an LCD test program the LCD displays ASCII text fine, but the backlight doesn't come on despite the fact that I've set up this circuit.

I've verified that I'm getting 5V on pin 1 on my Arduino Uno so there should be a voltage across the base of the transistor. I've also verified that the LCD does indeed have a backlight. I think I've gone wrong in designing my circuit but I just don't understand where.

Any help would be much appreciated.

Cheers,
Tony

Have you ever had the back-light on, wiring it direct, without the transistor?

Paul

Change the base resistor to 1k.
A gain of 300 might be a gain of 50 at that current.
You should have ~0.65volt at the base, and even less at the collector.
Leo..

@Paul: No the backlight has never been on before.

@Leo: These are the voltage/current values I am getting for each base resistance respectively:

Rb = 1K: Vb = 0.62V, Vc = 0.03V, ib = 330uA, ic = 0.3mA

Rb = 15K: Vb = 0.73V, Vc = 0.01V, ib = 4.83mA, ic = 2.2mA

Judging by the data, if I use a huge value for Rb I should get to ic = 80mA.

But surely 1K is an adequate resistance for the base right?

Forget about those calculations. 1k is perfect.
If you get almost zero volt on the collector, then the transistor is fully saturated (on).

See if you have 5volt on one side of the 100ohm resistor, and how much on the other side.

You should have ~3.3volt on the resistor/LED junction.
If not, check LED polarity and wiring.
Leo..

P.S.
I see that you get a higher Vb with a 15k resistor.
That's not possible.
Are you reading your resistor values right?

With a 1k resistor, the transistor gets ~4mA fixed base current.
That is good for collector currents from zero to ~400mA

I've got the backlight working now! I foolishly didn't realise that the two power rails on my breadboard were separated in the middle, so I wasn't supplying 5V to the backlight.

Also, the backlight seems to come on when connected directly to 5V. There must be an onboard transistor to boost the current, so I guess I don't need the external transistor after all.

Thanks for your help Leo :slight_smile: