Lots of devices are fitted with a liquid crystal display (LCD). Now LCD implies backlighting that rather useful option that enables us to read the message being displayed! For devices where there’s no need to read the display continuously, the backlight doesn’t need to stay lit up all the time — several seconds is often all you need to read the display. This saves a little power and lengthens the life of the backlight. Devices fitted with an LCD also have a processor, and so it’s possible to employ a function to control the backlight directly from within the processor software. But sometimes it’s not possible to implement this sort of function within the microcontroller, because all the controller’s pins are already in use, or because you don’t have the source codes or tools needed to modify the software.
The circuit described here has been designed for just such cases. A device using an LCD usually has at least one button that, in most cases, pulls one of the microcontroller inputs down to 0 V when it is pressed. If no such button exists, one can always be added. We can use the signal from this button to control the backlight. As soon as the button is pressed, the backlight is activated, then extinguished a few seconds later by the timer. Using an OR gate, it’s possible to use several different buttons to trigger the timer. It doesn’t take many components to build a timer like this. The OR gate consists of a pull-up resistor R1+R2 and as many diodes as there are buttons. Thanks to these diodes, transistor T1 conducts while the button is pressed, and hence capacitor C1 is charged, the MOSFET T2 conducts, and the backlight comes on.
Because R3 has a very low value, capacitor C1 charges very rapidly, so even a very brief press of one of the buttons is enough to trigger the timer. Once the button is released, T1 turns off, and C1 then discharges slowly through R4 alone, since T2 has a very high input impedance. When T2’s gate voltage falls low enough, it turns off and the backlight goes out. The time the backlight stays lit after all the buttons have been released is roughly R4 (Ω) × C1 (F) seconds. Of course, this circuit can be used for other applications too, and can be used to switch things other than an LED — for example, a relay. The value of R5 depends on the load being switched. For an LED running off a 5 V supply, a value of around 300 Ω will be about right.