Electronic – Time delayed deactivation of a circuit

basiccircuit-designcircuit-theoryeducationpractical

In a simple electronic circuit with a momentary switched LED (or bulb, tube etc.); what can be done to trigger the LED for several seconds before proceeding to break the circuit?

In other words; I want one quick press of the button to activate the LED, and also deactivate it automaticslly after x amount of seconds; just as if I'd been holding my finger on the button the whole time.

I probably didn't explain it very well, but I'm sure it should be easy to infer my meaning. FYI; I'm just trying to teach myself how to build basic, practical electronic circuits by tinkering with a breadboard.

I know it's pretty simple stuff; but at the moment, the configuration basically looks like this:

simple circuit.

Best Answer

I thought I'd provide both a thinking process and design procedure, given the lack of information about the current or voltage supply. But I won't provide any part selections or values since there are no specifications for voltages or currents. So just the idea has to suffice for now.


The idea starts with the left schematic below:

schematic

simulate this circuit – Schematic created using CircuitLab

The left side shows the basic LED, current-limiting resistor, and the momentary switch. But there is an added "function." This function box is supposed to do the additional work of both detecting when the switch is momentarily closed (debouncing it, as necessary) and then bypassing the momentary switch for some time period. This means it will eventually have to include a "timer" and more.

Moving to the right side above, the first step is to just add a controllable high-side switch. In this case, I chose a PNP BJT as \$Q_1\$ for this purpose and added a "pull-up" resistor, \$R_1\$, which has a few simple uses: (1) it helps to remove stored charge in the PNP when turning off; and, (2) it holds the PNP BJT firmly off unless the rest of the circuit firmly turns it on.


The following steps continue the thinking. Starting again on the left:

schematic

simulate this circuit

Here in step 2, I've added a driver for the high-side switch in the form of a MOSFET, \$M_1\$, and a base-current limiting resistor, \$R_2\$, for \$Q_1\$'s base. Turning \$M_1\$ on will then turn \$Q_1\$ on, as well.

I chose a MOSFET here because I know that there will be some timing yet to be done and a MOSFET gate doesn't require current to hold the MOSFET on and the current leakage is very, very low. So this means that a simple RC timing circuit could finally be considered now. (Another BJT circuit would require current, too, and would be sweeping the problem under a rug to be solved still later.)

(Having gotten to this point, one might wonder why I didn't start with a MOSFET in the first place. Good question. And it's worth considering. But the answer relates to the arrangement of the momentary switch and the direction it pulls on the node it's attached to. And moving the momentary switch to the low side doesn't fix this problem.)

I didn't add a "pull-down" resistor to the gate of \$M_1\$ because of what's coming up in step 3.

Now, moving to the right side (step 3) of the above schematic, I've added the RC timing circuit and also the switch detection. (They are one and the same.) Here, when the momentary switch pulls up in order to supply power to the LED, it also pulls \$C_1\$ up and with it the gate of \$M_1\$, which now becomes active. (This RC also acts to debounce the switch, too.) \$C_1\$ is nominally discharged at the start of all this, so the voltage across it should be close to zero prior to the momentary switch being engaged.

The values of \$R_3\$ and \$C_1\$ (along with the required gate voltage for \$M_1\$) will determine the duration of the added "hold" time. Because of the low leakage of \$M_1\$'s gate, the RC time constant can be quite long.

As \$C_1\$ slowly charges by way of \$R_3\$, the gate voltage of \$M_1\$ moves lower and lower and will eventually turn \$M_1\$ off. At this moment, \$Q_1\$ will also turn off and the power will be removed from the LED (or other load.)


There is a problem with the version in step 3, though. When \$M_1\$ finally turns off, \$C_1\$ is charged up to some voltage (positive side above, negative side below.) When \$Q_1\$ also turns off as a result of \$M_1\$ turning off, this allows the load (the LED and its current limiting resistor) to pull the collector of \$Q_1\$ rapidly down towards ground (the negative rail.) This pulls the positive side of \$Q_1\$ close to ground, too. Which means the negative end of \$C_1\$ is very much lower than ground.

This isn't precisely a problem. Technically, \$R_3\$ does provide a DC path and it will gradually allow the capacitor to discharge. But leaving it to \$R_3\$ means the circuit is "mostly worthless" while yet another set of RC time constants goes by. So to hasten things, \$D_1\$ is added. This provides a very fast way for \$C_1\$ to rapidly discharge and reset itself after the timer expires. And so the circuit resets itself almost immediately. Which is a desired behavior, I think. (Without \$D_1\$, the circuit will behave "erratically" from the perspective of a user.)

Step 4 on the left side below shows the addition of this diode:

schematic

simulate this circuit

In the final step (to the right) one more diode is added to protect the gate of \$M_1\$ from excessive voltage as well as providing yet another discharge path for parasitic capacitances in the circuit.

(In all of this, the circuit so far assumes that the gate of \$M_1\$ can withstand the power supply voltage. If not, if the supply voltage required by the LED is too high, then this circuit really isn't a safe approach for the MOSFET and it would need further added design elements -- such as a zener to protect the MOSFET gate.)


Note that the above is not re-triggerable. Once triggered, its time period must be allowed to expire before the momentary switch can be used again. If one wants it to be re-retriggerable, then two new diodes need to be added:

schematic

simulate this circuit

Those diodes allow the momentary switch to discharge \$C_1\$ as well as pull it up, so that the timing is reset when the switch is again pressed momentarily. (Two diodes are needed to avoid unwanted interactions between the nodes on either side of \$C_1\$.)


So that's it.

Note that no values or selection of parts is included in any of the above examples. That's because there are no voltage or current specifications by the OP. Given the lack of information, this is probably all that can be done for now. And even then, the circuit cannot be expanded easily to some of the high voltages and some newer LEDs may require -- such as LED filaments with 28 series LEDs (of a couple of types) that often require \$70\:\textrm{V}_\textrm{DC}\$ or more to operate. (MOSFET gates can be a bit too sensitive for such things.)

All I can offer are some notes.

  1. \$R_1\$ is just a pull-up. Its value isn't critical, but if the required base current for \$Q_1\$ is \$I_{B_1}\$ and the required base-emitter voltage is \$V_{BE_1}\$ then perhaps \$R_1\approx 100\cdot\frac{V_{BE_1}}{ I_{B_1}}\$. It could be less than that, or more.
  2. \$R_2\$ sets the required base current for \$Q_1\$. Assuming \$M_1\$'s drain is close to ground, when on, the value should be \$R_2\approx \frac{\left(+V\right) - V_{BE_1}}{I_{B_1}}\$. Also, one should check the power dissipation required, as well, since an appreciable voltage is dropped here.
  3. \$R_3\$ and \$C_1\$ set the timing. Because of availability and also the difficulties in keeping a circuit clean enough, \$R_3\$ should probably be \$\le 2.2\:\textrm{M}\Omega\$. Somewhat larger values are fine, too. But just be aware that it starts getting more expensive and more difficult, the higher the value gets. Meanwhile, \$C_1\$, if long delays are anticipated and \$R_3\$ is rather large, should be a lower leakage type.
  4. \$Q_1\$'s collector needs to be able to support the required current. So select it, appropriately. This will impact it's required \$I_{B_1}\$ and also its \$V_{BE_1}\$ when on. Read the datasheet carefully. Also, make sure that it is able to handle any necessary dissipation and that it is operated within the safe-operating area found in the datasheet.
  5. \$M_1\$ only needs to sink \$Q_1\$'s required base current, \$I_{B_1}\$. So it probably can be a smaller (or as small) device. The main thing to look for here is that its \$V_{GS_{TH}}\$ is appropriate for the circuit's operating voltage (and the required sinking current, of course) and that it allows for a reasonable variation so that the RC timing can operate satisfactorily. Again, check the datasheet carefully, too.
  6. Obviously, \$R_{LIMIT}\$ must be chosen appropriately for the LED (or other load.)
  7. The numbered diodes I'm imagining are just 1N4148 types. But this may not always be appropriate. Again, consider the above text about what they do when considering a specific choice.
  8. No provisions were added here to handle an inductive load's kickback voltages. Using an inductive load may affect a number of circuit elements that I did not consider and may require substantial changes that I didn't (and won't) anticipate here.
  9. The potential difference of the voltage supply impacts a variety of part selection details. (For example, if an electrolytic is selected for \$C_1\$ then the voltage specification for it probably matters and should be observed.) Be sensible.
  10. The choice of a momentary switch matters too, depending on the expected load current and voltage. The DC voltage specification for a switch is often many times lower than its AC voltage specification. Be sensible here and read the datasheet.
  11. The above circuit is for educational purposes only. Additional protection elements may be required for any given situation. For example, this circuit should never be considered anywhere near a gasoline station pump or near potentially explosive vapors, nor should it be used anywhere near a living heart during a medical operation. Etc. Etc.
Related Topic