A current source circuit forces a specific, unvarying current through a load regardless of the load's resistance, up to the limits of the power supply. While a simple resistor can approximate a current source if the supply voltage is massively oversized, a precision active current source circuit uses closed-loop feedback to maintain exact current. For bench work, sensor excitation, and LED driving, the op-amp-driven BJT topology is the gold standard. This guide breaks down the exact component values, failure extremes, and breadboard testing procedures you need to build a reliable 20mA source.
The Anatomy of an Op-Amp Current Source Circuit
The most robust topology for low-to-medium current applications (1mA to 100mA) uses an operational amplifier to drive the base of an NPN bipolar junction transistor (BJT), with a sense resistor in the emitter path. This creates a low-side current sink, which functions identically to a high-side current source from the load's perspective.
To understand the feedback loop, track these four critical nodes:
- V_REF (Non-Inverting Input, Pin 3): The control voltage that dictates the setpoint. This can come from a DAC, a microcontroller PWM-filtered output, or a simple resistive voltage divider.
- V_SENSE (Inverting Input, Pin 2): The feedback node connected to the junction of the BJT emitter and the sense resistor. The op-amp's high open-loop gain forces this node to equal V_REF.
- V_LOAD (BJT Collector): The output node where the load connects to the positive supply. Current flows from the supply, through the load, into the collector, and out the emitter.
- V_CC (Op-Amp Supply & Load Supply): The positive voltage rail. The LM358 can operate on a single supply, making it ideal for this single-rail topology.
Why Choose an Op-Amp Topology Over a Simple BJT?
You might wonder why we don't just use a simple two-resistor BJT bias network or a basic BJT current mirror. The answer is thermal stability and load regulation. In a simple BJT current source, the base-emitter voltage (V_BE) drifts by approximately -2mV/°C. As the transistor heats up, the current drifts significantly. Furthermore, a simple BJT source has a relatively low output impedance, meaning the current will sag as the load resistance increases and the voltage across the transistor drops.
The Texas Instruments LM358 op-amp solves this by absorbing the V_BE variation into its feedback loop. The op-amp simply outputs whatever base voltage is necessary to maintain the emitter voltage, rendering the BJT's thermal drift virtually irrelevant to the output current.
Failure Modes at the Extremes
Understanding what breaks when components fail or hit their limits is critical for safe circuit design. Here is the failure-mode contrast for the op-amp + BJT topology:
- Load Shorts (R_LOAD = 0Ω): The current remains locked at the setpoint. The BJT's collector-emitter voltage (V_CE) spikes to equal V_CC. The BJT must dissipate P = V_CC × I_SET. If V_CC is 12V and I_SET is 20mA, the 2N3904 transistor dissipates 240mW, which is well within its 625mW limit. No damage occurs.
- Load Opens (R_LOAD = ∞): Current drops to zero. V_SENSE drops to 0V. The op-amp detects V_REF > V_SENSE and swings its output to the positive rail trying to turn the BJT on. The BJT base receives maximum current, but since the collector is open, no main current flows. The circuit survives, though the op-amp output stage is stressed.
- Sense Resistor Opens: This is the catastrophic failure mode. V_SENSE drops to 0V. The op-amp rails its output high, fully saturating the BJT. The load is now subjected to maximum possible current, limited only by V_CC and the load's own resistance. If your load is a fragile LED or a low-resistance coil, it will likely burn out. Always use a robust, properly rated sense resistor.
Design Walkthrough: Sizing Real Components for a 20mA Source
Let's design a precision 20mA current source circuit to drive a sensor or an LED string. We will use a 5V logic-level reference and a 12V main supply.
1. Sizing the Sense Resistor (R_SENSE)
The governing equation is I_OUT = V_REF / R_SENSE. To keep power dissipation low and avoid needing a high-wattage resistor, we want a small voltage drop across R_SENSE. Let's step V_REF down to 1.00V using a precision voltage divider or a low-noise LDO.
R_SENSE = 1.00V / 0.020A = 50Ω.
Since 50Ω is not a standard 1% E96 value, we select a 49.9Ω 1% metal film resistor.
Actual I_OUT = 1.00V / 49.9Ω = 20.04mA. The power dissipated by the resistor is I²R = (0.020)² × 49.9 = 20mW. A standard 1/4W (250mW) resistor is more than adequate.
2. Selecting the BJT and Base Stopper
The 2N3904 NPN BJT is perfect here (max I_C = 200mA). However, BJTs can oscillate at high frequencies when driven by a low-impedance op-amp output on a breadboard. To prevent this, insert a 100Ω base stopper resistor between the LM358 output (Pin 1) and the 2N3904 base.
Behavior Matrix: What Changes When One Element Changes?
| Element Changed | Direction of Change | Effect on Output Current | Effect on Circuit Stress |
|---|---|---|---|
| Load Resistance | Increases | No change (until compliance limit) | V_CE increases, BJT heats up |
| V_REF (Control) | Increases | Proportional increase | Higher power dissipation in BJT and R_SENSE |
| R_SENSE | Increases (e.g., thermal drift) | Decreases slightly | Lower overall power dissipation |
| V_CC (Main Supply) | Decreases | No change (until headroom lost) | Op-amp may rail, BJT enters saturation |
Step-by-Step Breadboard Testing and Verification
Breadboarding analog feedback circuits introduces parasitic capacitance that can turn your precision source into a high-frequency oscillator. Follow this exact sequence to verify the build safely.
- De-energize and Wire the Feedback Loop First: With the power off, place the LM358 and 2N3904. Connect the 49.9Ω sense resistor from the emitter to ground. Wire the inverting input (Pin 2) directly to the emitter node. Keep this trace as short as physically possible to minimize parasitic inductance.
- Install the Base Stopper: Place the 100Ω resistor between Pin 1 (op-amp output) and the BJT base. Do not skip this; it isolates the op-amp from the BJT's base-emitter capacitance.
- Apply V_REF Before V_CC: Power the op-amp and apply your 1.00V reference to Pin 3. Leave the main load supply (V_CC) disconnected for now.
- Verify the Open-Load State: Turn on the op-amp supply. Measure the voltage at the op-amp output (Pin 1). It should be railed high (near V_CC of the op-amp) because the op-amp is trying to push current through an open circuit to raise V_SENSE to 1.00V.
- Connect the Load and Main Supply: Connect your load (e.g., a 100Ω power resistor for testing) between the 12V supply and the BJT collector. Power the 12V rail.
- Measure and Verify: Use a multimeter to measure the voltage across the 49.9Ω sense resistor. It should read exactly 1.00V. Measure the voltage across the 100Ω test load; it should read 2.00V (confirming 20mA via Ohm's law). If you have an oscilloscope, probe the sense resistor to ensure the DC line is flat and free of high-frequency ringing.
Frequently Asked Questions
How do I calculate the compliance voltage of a current source circuit?
Compliance voltage is the maximum voltage the current source can drop across the load while still maintaining the set current. It is calculated by subtracting the internal voltage drops from your main supply rail. The formula is: V_COMPLIANCE = V_CC - V_SENSE - V_CE(sat). Using our 12V supply, 1V sense drop, and 0.2V BJT saturation voltage, the compliance voltage is 10.8V. If your load requires more than 10.8V to pass 20mA (e.g., a resistor larger than 540Ω), the BJT will saturate, and the current will drop below the 20mA setpoint.
Can I use a MOSFET instead of a BJT in this current source circuit?
Yes, and for currents above 100mA, you should. Replacing the 2N3904 with an N-channel logic-level MOSFET (like the IRLZ44N) eliminates base current error entirely, as the gate draws virtually zero steady-state current. However, MOSFETs have much higher input capacitance than BJTs. If you swap in a MOSFET, you must increase the base/gate stopper resistor to around 220Ω to 470Ω and potentially add a small feedback capacitor (100pF to 1nF) between the op-amp output and its inverting input to maintain phase margin and prevent severe oscillation.
Why is my current source circuit oscillating on the breadboard?
Oscillation in an op-amp current source circuit is almost always caused by parasitic capacitance at the inverting input node or the base/gate of the pass transistor. Breadboards add 2pF to 5pF of stray capacitance per contact. When the op-amp tries to correct a tiny voltage error, this capacitance delays the feedback signal, causing the op-amp to overshoot and ring. To fix this: keep the sense resistor and inverting input pin leads under 5mm in length, ensure a 100nF bypass capacitor is placed directly across the op-amp's VCC and GND pins, and verify your base stopper resistor is in place to isolate the transistor's input capacitance from the op-amp's output stage.






