I've been thinking and thinking about this.

Look at this image:

enter image description here

(Imagine both the resistor and LEd were in parallel with the capacitor, otherwise the LED will be overloaded)

By doing this I've managed to create a circuit that, when it loses power, makes the LED fade. However, I wanted to find a way in which the LED will only be powered when the circuit doesn't have a power supply (other than the capacitor). I've been thinking about logic gates, diodes, etc., but can't figure out a way in which it would work. Is there any?

  • \$\begingroup\$ Power on closes a switch/relay to the LED? \$\endgroup\$ – kenny Dec 29 '12 at 12:29
  • \$\begingroup\$ Problem is, the capacitor and the power supply are both supplying current in the same direction. \$\endgroup\$ – DLA Dec 29 '12 at 13:04

You need a way to differentiate between "powered from an external source" and "powered from capacitor only" -- a transistor, diode and a pair of resistors can do this for you.


The PNP transistor will remain off for as long as 12V is present. The diode allows the capacitor to charge but prevents the capacitor voltage from feeding the base of the transistor. R1 is a weak pull-down which turns the transistor on when the stronger pull-up R2 has no source voltage.

  • \$\begingroup\$ I'm having trouble adding images... could someone assist? \$\endgroup\$ – akohlsmith Dec 29 '12 at 18:18
  • \$\begingroup\$ Done. The problem was that you were linking to the page, not the image \$\endgroup\$ – Shamtam Dec 29 '12 at 18:19
  • \$\begingroup\$ Great answer! Just wondering, is a PNP normally on, i.e. if a 12V battery is connected across a PNP transistor from collector to emitter, and nothing to the base, will current pass through? \$\endgroup\$ – DLA Dec 29 '12 at 18:50
  • \$\begingroup\$ ..I think I meant from the emitter to the collector. Still trying to piece together this electronics stuff. \$\endgroup\$ – DLA Dec 29 '12 at 18:53
  • 3
    \$\begingroup\$ How did you pick the resistor values? It looks to me that R2 is going to have about 1.1 V across it, which is more than enough to turn on Q1, even with D1 in the emitter leg. Also, why is R3 in series with C1 instead of LED1? \$\endgroup\$ – Dave Tweed Dec 29 '12 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.