Help : LED Delay OFF

Tonyr1084

Joined Sep 24, 2015
7,901
Swapping R1 & R2 along with using a PNP for Q2 will work too. Maybe even better.

The beam will hold R2's resistance low, keeping a high current present on the base of a PNP transistor. When the beam drops out the base of Q2 should go low enough to conduct, thus, charging C1. If charge rate is of concern, add an additional resister in series with C1 to prevent the sudden rush into the capacitor. R3 will still be needed to drain C1 when the beam returns. Otherwise, like I said, the gate of Q1 will act as its own capacitor and tend to hold its state. With the addition of C1 the period in which the gate remains saturated will be greatly extended. That's why you need to pull the gate low with R3.

The original circuit (without the blue addition) held the gate (of Q1) low when the beam was present but sent the gate high when the beam disappeared.

I like the circuit - mostly. However, ambient light could also hold the resistance of R2 quite low. In the dark dank dungeon of my work shop the circuit would work great. But in the real world of my kitchen table I doubt the circuit would be as effective. But I guess because I haven't built the circuit myself to actually test it in the real world.

Perhaps using the IR LED's from an old TV remote along with an IR Receiver (IR = Infra Red) would work more reliably in the presence of strong background light.

And my circuit was a basic block build, not the absolute resolution of the problem. Using a transistor to charge a capacitor will give you the delay time to turn the LED off after the beam is restored. Using different values of capacitors and resistors create the RC Time circuit you need to hold the LED on for any set period of time. And like someone before me said, the LED won't be "LIT" then "GO OUT"; it will "Dim till it goes out". The MOSFET will act like a valve. As the capacitor's charge diminishes the gate will slowly close and slowly pinch off the current from the LED.

My gift is "Concept" on how to solve the problem. Your job is to engineer exactly what you want. I only hope to have given you some direction. But you COULD use an Op Amp configured as a comparator. A diode to block reverse grounding so the cap can discharge through a resistor. There are LOTS of ways to build your circuit. My idea was just one quick and dirty way of solving a problem.
 
Last edited:

Marcus2012

Joined Feb 22, 2015
425
You pretty much have to use an amplifier for those things as they generate very little current -> high resistance source. LDR is the right choice here.
Ahh yeah you make a good point. But I'm looking at the diagram and wondering why it has a P-channel for low side switching. Wouldn't it be easier with an N-channel FET and PNP then a photodiode holding the base high?

EDIT actually I think that is an N-channel lol opps
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
7,901
For those who disagree with my solution: OK. Post your own solution. That way I can learn something.

In response to Danny's question about how to turn the LED off - when C1 is discharged through R3, the gate will be pulled low. The LED will go off. NO? If not, what am I missing? Keep in mind I'm FAR from the expert on this subject. I still muddle through on my work bench trying to find what works, whereas most of you can simply build the circuit knowing the results of changes. I'm here to learn more than I am to answer questions. I have read far more threads than I have posted to. I'm willing to offer an alternative point of view but do not think MY answers are the RIGHT answers. More of "What If's".

Personally, I think my circuit would work. I'm not building it so I won't know if I'm wrong. If I am wrong - please - somebody who knows - explain it to me. Thank you.
 

Marcus2012

Joined Feb 22, 2015
425
This was basically what I was thinking but I minced my words quite badly sorry. In this one the sensor could be an LDR or a photodiode. R and C values to be set.

led light switch.png
 

Tonyr1084

Joined Sep 24, 2015
7,901
Marcus: Using Q2 as an NPN transistor, you probably wouldn't need R3. The PN Junction of the NPN will conduct current and drain C1. However, without using a current limiting resistor in series between C1 and Q2, you could over-current the transistor and burn it out.

For someone who may want the LED to be fully lit for the (supposedly) three seconds after the beam is restored, you could set up a darlington pair of transistors. That will act more like a switch, and the LED will not diminish (or dim) linearly, but rather it will hold most of the RC time period then suddenly diminish at the last few milliseconds. (depending on the decay rate of C1).
 

dannyf

Joined Sep 13, 2015
2,197
That's not the preferred solution. You should really play with the circuit a little bit, particularly think about where you should place that current limit resistor to better define the decay of the current going through the LED.

Not to mention that you will need to limit the charge-up current into the capacitor.
 

dannyf

Joined Sep 13, 2015
2,197
Essentially, you want the current through the led to follow the voltage decay across the capacitor, once the beam is removed. That means you have to define the time constant of the rc network and not let the mosfet or the npn's be junction comes into play.

That also means that once the beam is on the ldr, you want to charge up the capacitor in full as soon as possible / practical.

All of that calls for a topology i discussed earlier: pnp to charge up the capacitor, and mosfet to follow the capacitor voltage decay.
 
Top