Practical case: Simple Transistor Timer

Simple Transistor Timer prototype (Maker Style)

Level: Basic. Build an off-delay circuit using the slow discharge of a capacitor to control a transistor.

Objective and use case

In this session, you will build an analog timer circuit that keeps an LED illuminated for a specific duration after a push-button is released. This demonstrates how a capacitor stores energy and discharges it over time to control a switching element (the transistor).

Why it is useful:
* Interior car lighting: Lights that fade out slowly after the door is closed.
* Staircase timers: Lighting that remains on long enough for someone to climb the stairs.
* Bathroom fans: Fans that continue running for a few minutes after being switched off to clear humidity.
* Debouncing: Smoothing out short, unwanted signal interruptions.

Expected outcome:
* Button Press: The LED turns ON immediately to full brightness.
* Button Release: The LED remains ON initially.
* Delay Phase: The LED gradually dims and turns OFF after a few seconds as the capacitor voltage drops.
* Target Audience: Students and hobbyists learning about RC time constants and transistor switching.

Materials

  • V1: 9 V DC supply, function: main power source.
  • S1: Push-button (Normally Open), function: charging trigger.
  • C1: 470 µF electrolytic capacitor, function: timing and energy storage.
  • R1: 10 kΩ resistor, function: discharge timing resistor.
  • R2: 470 Ω resistor, function: LED current limiting.
  • Q1: 2N2222 NPN transistor, function: current switch.
  • D1: Red LED, function: visual output indicator.

Wiring guide

Construct the circuit following these connections using the specific node names provided.

  • Power Supply:

    • Connect V1 positive terminal to node VCC.
    • Connect V1 negative terminal to node 0 (GND).
  • Input and Timing Network:

    • Connect S1 between node VCC and node VCAP.
    • Connect C1 positive terminal to node VCAP.
    • Connect C1 negative terminal to node 0.
    • Connect R1 between node VCAP and node BASE.
  • Transistor Switch:

    • Connect Q1 Base to node BASE.
    • Connect Q1 Emitter to node 0.
    • Connect Q1 Collector to node COL.
  • Output Load (LED):

    • Connect R2 between node VCC and node LED_A.
    • Connect D1 Anode to node LED_A.
    • Connect D1 Cathode to node COL.

Conceptual block diagram

Conceptual block diagram — Simple Transistor Timer
Quick read: inputs → main block → output (actuator or measurement). This summarizes the ASCII schematic below.

Schematic

[ INPUT & TIMING ]                  [ LOGIC / SWITCH ]                 [ OUTPUT LOAD ]

(VCC 9 V) --+--(Power Path)--------------------------------------------------> [ Resistor R2 ]
           |                                                                        |
           |                                                                        v
     [ Button S1 ]                                                             [ LED D1 ]
           |                                                                        |
           v (Trigger)                                                              |
     [ Node VCAP ] --(Slow Discharge)--> [ Resistor R1 ] --(Base Sig)-->+           |
           |                                                            |           |
           + <--(Stores Charge)-- [ Capacitor C1 ]                      |           |
                                       |                                v           v
                                       v                        +-----------------------+
                                    [ GND ]                     |     TRANSISTOR Q1     |
                                                                | (Base)    (Collector) |
                                                                +-----------------------+
                                                                            |
                                                                            v (Emitter)
                                                                         [ GND ]
Schematic (ASCII)

Measurements and tests

Follow these steps to validate the circuit behavior using a multimeter.

  1. Initial State: Ensure S1 is not pressed. The LED should be OFF.
    • Measure voltage at VCAP. It should be near 0 V.
  2. Charging Phase: Press and hold S1.
    • Check: The LED turns ON immediately.
    • Measurement: The voltage at VCAP should instantly rise to approximately 9 V (VCC).
  3. Discharge Phase: Release S1 and start a stopwatch.
    • Observation: The LED remains lit.
    • Measurement: Monitor the voltage at VCAP. It will slowly decrease.
    • Threshold: When VCAP drops below approximately 1.4 V (V_BE + drop across R1), the LED will dim significantly and turn OFF.
  4. Time Constant: Record the time from release until the LED turns completely off.

SPICE netlist and simulation

Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)

* Practical case: Simple Transistor Timer

* --- Power Supply ---
* V1: 9 V DC supply
V1 VCC 0 DC 9

* --- Input and Timing Network ---
* S1: Push-button (Normally Open)
* Modeled as a Voltage Controlled Switch (S1) driven by a control pulse (V_S1_ACT)
* Connects VCC to VCAP when activated
S1 VCC VCAP CTRL 0 SW_MODEL

* Control signal for the button press simulation
* Press button at T=0.5s, hold for 0.5s, then release to allow discharge
V_S1_ACT CTRL 0 PULSE(0 5 0.5 1m 1m 0.5 20)

* C1: 470 µF electrolytic capacitor
C1 VCAP 0 470u

* R1: 10 kΩ resistor (Discharge path to Base)
* ... (truncated in public view) ...

Copy this content into a .cir file and run with ngspice.

🔒 Part of this section is premium. With the 7-day pass or the monthly membership you can access the full content (materials, wiring, detailed build, validation, troubleshooting, variants and checklist) and download the complete print-ready PDF pack.

* Practical case: Simple Transistor Timer

* --- Power Supply ---
* V1: 9 V DC supply
V1 VCC 0 DC 9

* --- Input and Timing Network ---
* S1: Push-button (Normally Open)
* Modeled as a Voltage Controlled Switch (S1) driven by a control pulse (V_S1_ACT)
* Connects VCC to VCAP when activated
S1 VCC VCAP CTRL 0 SW_MODEL

* Control signal for the button press simulation
* Press button at T=0.5s, hold for 0.5s, then release to allow discharge
V_S1_ACT CTRL 0 PULSE(0 5 0.5 1m 1m 0.5 20)

* C1: 470 µF electrolytic capacitor
C1 VCAP 0 470u

* R1: 10 kΩ resistor (Discharge path to Base)
R1 VCAP BASE 10k

* --- Transistor Switch ---
* Q1: 2N2222 NPN transistor
* Connections: Collector=COL, Base=BASE, Emitter=0(GND)
Q1 COL BASE 0 2N2222MOD

* --- Output Load (LED) ---
* R2: 470 Ω resistor
R2 VCC LED_A 470

* D1: Red LED
* Connections: Anode=LED_A, Cathode=COL
D1 LED_A COL DLED

* --- Models ---
* Switch Model: Threshold 2.5V, Low On-Resistance
.model SW_MODEL SW(Vt=2.5 Ron=0.1 Roff=100Meg)

* NPN Transistor Model (Generic 2N2222)
.model 2N2222MOD NPN(IS=1E-14 VAF=100 BF=200 IKF=0.3 XTB=1.5 BR=3 CJC=8E-12 CJE=25E-12 TR=46.91E-9 TF=411.1E-12 ITF=0.6 VTF=1.7 XTF=3 RB=10 RC=0.3 RE=0.2)

* LED Model (Red LED approx)
.model DLED D(IS=1u N=2 RS=10 BV=5 IBV=10u)

* --- Analysis Commands ---
* Transient analysis for 10 seconds to observe the long RC discharge (Tau ~ 4.7s)
.tran 10m 10s

* Output voltage of Capacitor, Base, Collector, and LED Anode
.print tran V(VCAP) V(BASE) V(COL) V(LED_A)

.op
.end

Simulation Results (Transient Analysis)

Simulation Results (Transient Analysis)
Show raw data table (2110 rows)
Index   time            v(vcap)         v(base)         v(col)
0	0.000000e+00	5.504285e-01	5.495835e-01	8.838023e+00
1	1.000000e-04	5.504285e-01	5.495836e-01	8.838088e+00
2	2.000000e-04	5.504285e-01	5.495835e-01	8.838088e+00
3	4.000000e-04	5.504285e-01	5.495835e-01	8.838088e+00
4	8.000000e-04	5.504285e-01	5.495835e-01	8.838088e+00
5	1.600000e-03	5.504285e-01	5.495835e-01	8.838088e+00
6	3.200000e-03	5.504285e-01	5.495835e-01	8.838088e+00
7	6.400000e-03	5.504285e-01	5.495835e-01	8.838088e+00
8	1.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
9	2.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
10	3.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
11	4.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
12	5.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
13	6.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
14	7.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
15	8.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
16	9.280000e-02	5.504285e-01	5.495835e-01	8.838088e+00
17	1.028000e-01	5.504285e-01	5.495835e-01	8.838088e+00
18	1.128000e-01	5.504285e-01	5.495835e-01	8.838088e+00
19	1.228000e-01	5.504285e-01	5.495835e-01	8.838088e+00
20	1.328000e-01	5.504285e-01	5.495835e-01	8.838088e+00
21	1.428000e-01	5.504285e-01	5.495835e-01	8.838088e+00
22	1.528000e-01	5.504285e-01	5.495835e-01	8.838088e+00
23	1.628000e-01	5.504285e-01	5.495835e-01	8.838088e+00
... (2086 more rows) ...

Common mistakes and how to avoid them

  1. Reversed Capacitor Polarity: Electrolytic capacitors can explode or fail if connected backwards. Ensure the negative stripe on C1 connects to 0 (GND).
  2. Incorrect Transistor Pinout: Confusing the Collector and Emitter prevents switching. Verify the 2N2222 datasheet; usually, the tab or flat side indicates the pin orientation.
  3. Capacitor Value Too Small: Using a small capacitor (e.g., 100 nF) results in a delay too short for the human eye to perceive. Use at least 100 µF for visible results.

Troubleshooting

  • Symptom: LED never turns ON.
    • Cause: LED installed backwards or transistor broken.
    • Fix: Check D1 orientation (Anode to resistor, Cathode to Collector) and verify Q1 connections.
  • Symptom: LED turns OFF immediately upon releasing the button.
    • Cause: Capacitor is missing, disconnected, or value is too low.
    • Fix: Ensure C1 is firmly connected between VCAP and 0. Try increasing C1 to 1000 µF.
  • Symptom: Transistor gets very hot.
    • Cause: Missing base resistor or short circuit at the output.
    • Fix: Ensure R1 (10 kΩ) is correctly installed between the capacitor and the base to limit base current.

Possible improvements and extensions

  1. Variable Timer: Replace R1 with a 50 kΩ potentiometer in series with a 1 kΩ resistor to allow the user to adjust the delay duration.
  2. Darlington Pair: Replace Q1 with a Darlington transistor (or two NPNs connected as a Darlington pair) to significantly increase input impedance, allowing for much longer delays with the same capacitor value.

More Practical Cases on Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.

Quick Quiz

Question 1: What is the primary function of the capacitor (C1) in this circuit?




Question 2: Which component acts as the current switch in this off-delay circuit?




Question 3: What happens to the LED immediately after the push-button is released?




Question 4: Which real-world application is mentioned as a use case for this type of circuit?




Question 5: What is the purpose of the resistor R2 (470 Ω) in a typical LED circuit like this?




Question 6: What is the voltage of the power supply (V1) used in this project?




Question 7: Which component works in conjunction with the capacitor to determine the discharge timing?




Question 8: What type of switch is S1 described as in the expected outcome?




Question 9: During the 'Delay Phase', why does the LED eventually turn off?




Question 10: What is the target audience for this specific project?




Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me:
Scroll to Top