Go Down

Topic: Delay LCD backlight turn off (Read 4070 times) previous topic - next topic


I'm not driving the LCD through i2c at the moment. I am using the New Liquid Crystal library by Francisco Malpartida and I don't think it allows me to control the backlight, so I am using an "external" wiring for it. I2C communication happend on A4/A5, if I'm not mistaken, which I can't access on my board.

@Tom: Thanks for the explanation, but I actually knew how the different types of capacitors are made :). I was rather willingly to know what the difference is on the practical side, but I seem to understand it's mainly a difference in the capacity range right?


I was rather willingly to know what the difference is on the practical side, but I seem to understand it's mainly a difference in the capacity range right?

The other significant differences are the leakage current and ESR (effective series resistance), which are both generally much higher for aluminium electrolytic capacitors than for ceramic or metallised film capacitors. The ESR is why it is common to put a 100nF ceramic capacitor in parallel with an aluminium electrolytic.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Thanks a lot. This thread has been very helpful for me! :)


Hi Arduino Peeps:

To switch the LCD backlight off and on rather use the following:

I used a 2N2222 NPN transistor with hFE = 75; R1 works out to be 1 Ohm and R2 = 3.9K. This allows for a collector current, which flows through the backlight, of 85 mA. This is enough to light up most LCDs (16 x 2 character).

The code is simple. I use analog pin, A0. Just to test your setup:

/* Author: Solomon Smit
Date: 23 Nov 2012
This code is just to test the backlight on-off setup using a NPN
The following calculations:
Calculate R1:
Check the datasheet of the LCD what is the forward voltage drop
of the backlight. Normally between 4.2V - 4.9V.
Mine, the LMB162ABC is 4.9V. 
Also check the forward current (max) for the backlight.
Mine is 150 mA.
Now: Ohm's Law:
R1 = (5 - 4.9)/0.150 = 0.67 Ohm.
Choose R1 = 1 Ohm
Implies, Iforward = (5-4.9)/1 = 100 mA.

Now Choose Transistor, Q1:
I use 2N2222A, with hFE = 75 for Vcc = 5V at 150mA;

Now Calculate R2:
Ieb = (Iec/hFE)
Ieb = 0.1/75 = 1.33 mA
Thus, R2 = 5/0.00133 = 3 759 Ohm
Choose R2 = 3.9k;

int backLight = A0;

void setup()
//No need to setup analogue pin

void loop()
//Switch the analogue pin A0 high for a short time
digitalWrite(backLight, HIGH);
//Switch the analogue pin A0 off
digitalWrite(backLight, LOW);


You can use a phi-panel serial LCD back pack that I am selling. It will give you full control of the lcd and back light, and senses as many as 16 keys on a key pad, or one key that you currently have. You won't need anyone's library. All you need is to hook it up to arduino hardware serial port. The rest of the pins are free to do anything.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131