Pages: 1 [2]   Go Down
Author Topic: Delay LCD backlight turn off  (Read 3460 times)
0 Members and 1 Guest are viewing this topic.
Piemonte, Italia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 65
Just a brick in the wall
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley. 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?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Piemonte, Italia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 65
Just a brick in the wall
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot. This thread has been very helpful for me! smiley
Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Quote

/* Author: Solomon Smit
Date: 23 Nov 2012
This code is just to test the backlight on-off setup using a NPN
transistor.
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);
delay(1000);
//Switch the analogue pin A0 off
digitalWrite(backLight, LOW);
delay(1000);
}


Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



* Backlight_Control.jpg (15.92 KB, 310x161 - viewed 33 times.)
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Pages: 1 [2]   Go Up
Jump to: