A precision current source in a circuit forces a specific, unvarying current through a load regardless of load resistance changes, up to the supply voltage limit. While you can buy dedicated ICs like the LM334, building a discrete current source using an LM358 dual op-amp and a 2N3906 PNP transistor gives you superior control, lower dropout voltage, and the ability to drive high-power loads like LED arrays or battery charging circuits.
In this guide, we will break down the exact topology, calculate real component values for a 50mA driver, and cover the failure modes that catch beginners off guard on the bench.
The Op-Amp and PNP Topology: Why It Wins
When designing a current source in a circuit, you generally have three choices. Here is why the op-amp + PNP BJT topology beats the alternatives for most bench and DIY applications:
| Topology | Dropout Voltage | Accuracy | Verdict |
|---|---|---|---|
| LM317 Constant Current | High (~2.0V - 3.0V) | Moderate (Vref drifts with temp) | Wastes power as heat; poor for low-voltage battery systems. |
| Simple BJT Current Mirror | Low (~0.2V) | Low (Vbe mismatch & temp drift) | Good for IC internals, terrible for precise bench loads. |
| Op-Amp + PNP BJT | Very Low (<0.2V) | High (Set by 1% sense resistor) | Best for DIY. High precision, low heat, easy to control. |
The secret to the op-amp topology is the negative feedback loop. The op-amp continuously adjusts the base drive of the PNP transistor to ensure the voltage across the sense resistor exactly matches your reference voltage. Because the LM358 has a high open-loop gain, the error is reduced to mere millivolts.
Node Labels and Circuit Behavior Matrix
To troubleshoot effectively, you need to understand the circuit nodes. Assume a 12V supply ($V_{CC}$) and a ground-referenced load.
- Node A (Non-Inverting Input +): Connected to $V_{ref}$ (your target control voltage).
- Node B (Inverting Input -): Connected to the top of the sense resistor ($V_{sense}$).
- Node C (Op-Amp Output): Drives the base of the PNP transistor.
- Node D (PNP Emitter): Connected directly to $V_{CC}$ (12V).
- Node E (PNP Collector): Connects to the positive terminal of the load.
- Node F (Sense Resistor Top): Connects to the load negative and Node B.
- Node G (Sense Resistor Bottom): Connected to Circuit Ground.
Behavior Matrix: What Changes When Elements Shift
Understanding how the circuit reacts to component changes is critical for debugging. Here is what happens when you alter specific parameters:
| Element Changed | Effect on Load Current ($I_{load}$) | Effect on Node C (Op-Amp Output) | Effect on Node E (Collector Voltage) |
|---|---|---|---|
| $R_{sense}$ increases | Decreases | Rises (closer to $V_{CC}$) | Rises (less voltage dropped across load) |
| $V_{ref}$ (Node A) increases | Increases | Falls (closer to GND) | Falls (more voltage dropped across load) |
| Load Resistance increases | Remains Constant | Falls (to push harder) | Falls until compliance limit is hit |
| $V_{CC}$ drops slightly | Remains Constant | Falls slightly | Remains Constant |
Design Walkthrough: Sizing a 50mA LED Driver
Let's design a precision current source in a circuit to drive a high-power LED array at exactly 50mA from a 12V supply.
1. Select the Sense Resistor ($R_{sense}$)
The governing equation is $I_{load} = V_{ref} / R_{sense}$. We need a clean $V_{ref}$. Let's use 1.00V, which is easy to derive from a voltage divider or a precision reference like the TL431.
$R_{sense} = 1.00V / 0.050A = 20\Omega$.
Select a 20.0Ω, 1% tolerance, 1/4W metal film resistor. The power dissipation is $P = I^2R = (0.05)^2 \times 20 = 0.05W$, well within the 250mW rating of a standard 1/4W resistor.
2. Select the Pass Transistor
We need a PNP BJT. The 2N3906 is a perfect fit. It has a maximum Collector-Emitter voltage ($V_{CEO}$) of 40V (safely above our 12V) and a max continuous collector current of 200mA (safely above our 50mA).
3. Select the Op-Amp
The LM358 is a dual op-amp that operates on a single supply and can swing its output close to ground, which is necessary to fully turn on the PNP transistor. (Note: The LM358 output does not swing all the way to $V_{CC}$, but that is fine here because pulling the base low turns the PNP on).
4. Set the Reference Voltage ($V_{ref}$)
Use a 10kΩ and a 1kΩ resistor in a voltage divider from a stable 5V rail to get roughly 0.45V, or use a 10kΩ potentiometer between 5V and GND with the wiper feeding Node A. For fixed 1.00V, a TL431 shunt regulator is the professional choice.
Breadboard Testing and Extreme Failure Modes
Before connecting an expensive load, verify the circuit on a breadboard using a dummy load resistor.
Step-by-Step Breadboard Verification
- Power the Op-Amp: Connect Pin 8 (VCC) to 12V and Pin 4 (GND) to ground. Do not connect the PNP yet.
- Verify $V_{ref}$: Apply your control voltage to Node A (Pin 3). Measure it with a multimeter. Confirm it reads exactly 1.00V.
- Check Open-Loop Output: With Node B (Pin 2) tied to ground, measure Node C (Pin 1). It should read near 0V (turning the PNP fully ON). If you tie Node B to 12V, Node C should rise toward 10.5V (turning the PNP OFF).
- Integrate the PNP and Sense Resistor: Wire the 2N3906 and the 20Ω sense resistor. Connect a 100Ω dummy load between Node E and Node F.
- Measure and Trim: Power up. Measure the voltage across the 20Ω sense resistor. It should read exactly 1.00V. Calculate current: $I = 1.00V / 20\Omega = 50mA$.
What Breaks at the Extremes? (Failure Mode Contrast)
Real-world circuits fail. Here is how this topology handles extreme faults compared to a simple series resistor:
- Shorted Load (Load R = 0Ω): The current source limits the current to exactly 50mA. The op-amp adjusts the PNP base to drop the entire 12V across the transistor. The 2N3906 will dissipate $12V \times 0.05A = 0.6W$. It will get hot (TO-92 max is ~0.625W at 25°C), but it won't explode. Contrast: A simple series resistor would allow massive current flow, burning the trace.
- Open Load (Load disconnected): No current flows. Node B is pulled to 0V by the 10kΩ pull-down resistor. The op-amp output swings low, turning the PNP fully ON. Node E sits at 12V. When you reconnect the load, it immediately receives 12V until the feedback loop catches up (microseconds). No damage occurs.
- Shorted Sense Resistor ($R_{sense}$ = 0Ω): Node B is forced to 0V. The op-amp output slams low, turning the PNP fully ON. The load now sees the full 12V supply, and current is limited only by the load's own resistance. This is the most dangerous failure mode. If your load is a low-resistance LED without an internal resistor, it will pop instantly.
- Exceeding Compliance Voltage: If you increase the load resistance too high (e.g., swapping the 100Ω dummy for a 500Ω resistor), the circuit needs $500\Omega \times 0.05A = 25V$ to maintain 50mA. Since $V_{CC}$ is only 12V, the PNP saturates. The current will drop to roughly $12V / 500\Omega = 24mA$. The circuit doesn't break; it just stops regulating.
Frequently Asked Questions
How does a current source differ from a current sink in a circuit?
A current source pushes current from a positive supply rail, through the load, and down to ground. The load is tied to ground, and the regulating element (like our PNP transistor) sits on the high side. A current sink, conversely, pulls current from a positive supply, through the load, and regulates the path to ground using a low-side NPN or N-channel MOSFET. Sinks are generally easier to build because N-channel MOSFETs and NPN transistors have better performance characteristics and are cheaper than their P-type counterparts. However, if your load must be grounded (like a chassis-mounted LED heatsink), you must use a high-side current source.
What happens to a current source when the load resistance exceeds the compliance voltage?
The compliance voltage is the maximum voltage the current source can push across the load while maintaining regulation. It is roughly $V_{CC}$ minus the dropout voltage of the pass transistor and sense resistor. If the load resistance increases to the point where $V = I \times R$ exceeds the compliance voltage, the pass transistor saturates. The circuit transitions from a constant current source into a simple voltage source (limited by $V_{CC}$). The current will proportionally drop as resistance continues to increase, following Ohm's law ($I = V_{CC} / R_{load}$), until the load is removed entirely.
Can I use an N-channel MOSFET instead of a PNP BJT for this current source?
Yes, but it requires modifying the topology. To build a high-side current source with an N-channel MOSFET, you face a gate-drive problem: the gate must be driven significantly higher than the source pin, which is already sitting near $V_{CC}$. This requires a charge pump or a bootstrap circuit, adding complexity. If you want to use an N-channel MOSFET (like the IRF540N) for its high current handling and low $R_{DS(on)}$, you should redesign the circuit as a low-side current sink. In a sink configuration, the op-amp drives the MOSFET gate directly from a standard 0-5V or 0-12V signal, making the design much simpler and more efficient for high-power applications. For a deeper dive into semiconductor configurations, All About Circuits covers constant current circuits extensively.






