Electronic – use a capacitor and a transistor to create a circuit which automatically turns off an LED after a period of time

capacitorledtransistors

I'm extremely new to electronics and I find I learn things better when I have physical examples to examine. I'm trying to understand the way capacitors and transistors work on a practical level, and I thought this might be a good way to get a better understanding.

So, let's say I have this circuit:

CircuitLab Schematic 6hbnd8cjwkm5

Supposing the capacitor is fully discharged when the battery is first connected, would the LED light and then switch off after about 15 seconds? Here's my reasoning, and my (extremely ignorant and naive) expectation of how the circuit will flow:

  • When the battery is connected, current flows through R1 into C1, charging C1
  • 5RC = 5 * 3000 * 0.001 = 15, so C2 should take 15 seconds to charge up
  • During that time, current is flowing into the base of T1, allowing current to flow between the collector and emitter, thus powering the LED
  • When C1 is fully charged, current stops flowing into the base of T1, therefore current stops flowing between the collector and emitter, therefore the LED switches off.

Have I fundamentally misunderstood how capacitors work in DC circuits, and perhaps how transistors work too? If so, how could this circuit be reworked to produce the outcome I'm expecting (i.e, a circuit which uses a capacitor and a transistor to automatically switch off an LED after some period of time)?

Best Answer

So many things wrong with that circuit, lets go back to the start.

The transistor is a valve that lets current flow through it from collector to emitter (the pointy arrow) when current is injected into the base.. as shown below.

As such, as long as you feed current into the base, current will flow through the transistor and, if the voltage on the base is high enough, it will act like a kind of switch.

When turned on, current can flow from the battery through the LED lighting it up. The LED can only withstand so much current or it will burn out. The resistor is included to limit that current to the rated amount specified by the manufacturer's specifications.

schematic

simulate this circuit – Schematic created using CircuitLab

So now you have a circuit that will turn on an LED.

Now you need to drive that circuit with something that turns it on for a while, then turns it off. Now your idea is to do something like this.

schematic

simulate this circuit

Idea being C1 takes a while to charge up through the base limited by the resistor. Indeed with the indicated values the transistor will start to turn off around eight seconds after the power is applied.

Unfortunately a 1mF capacitor is rather physically large and expensive. The resistor choice also affects the current in the LED.

A better solution for this task is to use a different device like an N-Channel MOSFET.

schematic

simulate this circuit

A MOSFET is gated by voltage not current. This effectively decouples the timing side from the driving side. That means you can use much larger resistances, and therefor a smaller capacitor for timing without affecting the LED current.