Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Tools
Old 25th April 2006, 08:38 PM   #1
Default Switching LCD Backlight on and off

I'm busy fiddeling around with a microcontroller, keypad and lcd and have question about the lcd backlight.

everytime I press a key on the keypad I would like the lcd backlight to come on for say 2 seconds. if another key is pressed the light stays on. if no key is pressed within 2 secs the light goes off.

the problem is that i've run out of pins on the microcontroller so am looking for another way to do it - otherwise I could have used some coding to do it. When a keypad is pressed a buzzer makes a short beep.

Now my question - can I link the buzzer to some kind of timer (555?) to do the switching of the light on and off.

Can anyone offer any help - am I on the right track, or is there an easier way?
gregmcc is offline  
Old 25th April 2006, 09:26 PM   #2
Default

You can use a 555 timer wired as a one-shot (monostable multivibrator). Set your pulse width to 2 seconds and fan the output pin from your controller to both the buzzer and the one-shot.

Every time your buzzer goes off, you will get a single pulse 2 seconds long.
phalanx is offline  
Old 25th April 2006, 10:21 PM   #3
Default

If I press the keypad within the 2 seconds, will the output be extended by a further 2 secs.
gregmcc is offline  
Old 25th April 2006, 11:00 PM   #4
Default

Quote:
Originally Posted by gregmcc
If I press the keypad within the 2 seconds, will the output be extended by a further 2 secs.
no, not with a basic monostable setup

can we see what the rest of your io lines are doing? maybe there's a way to optimise one of them, to free up a dedicated line for the backlight ... then you have the ability to control the backlight, without sounding the beeper, like turning the backlight on when it's dark out and stuff
justDIY is offline  
Old 26th April 2006, 03:22 AM   #5
Default

Quote:
Originally Posted by gregmcc
If I press the keypad within the 2 seconds, will the output be extended by a further 2 secs.
Oops, I overlooked the fact that you needed a retriggerable one-shot.

It just so happens that you can get dedicated retriggerable monostable multibrator (retriggerable one-shot) chips and they cost less than $1. If you go do Digikey, search for "monostable", click the multivibrators link, and under the features column select one of the "retriggerable" descriptions and then narrow your search. A number of possibilities will pop up.
phalanx is offline  
Old 26th April 2006, 04:41 AM   #6
Default

But basically putting in a 555 when you've got a uController is just heresy. Suggest getting a controller with more pins or try to find a way to save a pin elsewhere.
__________________
I thought what I'd do was I'd pretend I was one of those deaf-mutes.
Oznog is offline  
Old 26th April 2006, 09:07 AM   #7
Default

thanks for all the replies. I found a chip on digikey which might do the trick. Will try it out tonight and let you know.

At a later stage I might have to look at using another microcontroller more pins - a light that comes on after its dark is a good idea!
gregmcc is offline  
Reply

Tags
backlight, lcd, switching

Thread Tools
Display Modes




All times are GMT. The time now is 05:21 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker