A current source is an active circuit element that delivers a specified, constant current to a load regardless of the voltage developed across its terminals. In a real circuit or simulation, inserting a current source fundamentally changes the circuit's behavior by forcing a specific branch current, which makes the voltage across the load entirely dependent on the load's impedance (V = I × Z). Beginners frequently confuse independent current sources (which output a fixed value) with dependent or controlled current sources (whose output is dictated by another voltage or current elsewhere in the circuit), or they mistakenly assume ideal current sources can generate infinite voltage to maintain their current.

The Theory: Ideal vs. Real Current Sources

To understand how LTspice handles these components, we must distinguish between the mathematical ideal and the physical reality. An ideal current source has infinite internal parallel resistance and infinite compliance voltage. Think of an ideal current source like a positive displacement water pump forcing exactly 5 gallons per minute through a pipe; if you pinch the pipe (increase resistance), the pump simply generates higher pressure (voltage) to maintain the 5 GPM flow.

Real-world current sources—such as an LM334 precision current regulator, a transistor current mirror, or a specialized LED driver IC—have a limited compliance voltage. This is the maximum voltage the source can develop across its terminals before it runs out of headroom (usually limited by its power supply rails) and saturates. Once saturated, the device can no longer maintain the target current, and it begins to behave more like a voltage source or a high-value resistor.

Simulation Warning: Never leave an ideal current source floating or connected in series with an open circuit in LTspice. Because the simulator will attempt to calculate the infinite voltage required to push current through an infinite resistance, it will result in a 'Matrix is singular' error or cause the simulation to hang.

Worked Numeric Example: Load Sizing and Compliance

Let's look at how compliance voltage dictates circuit design using a standard 20mA industrial sensor loop. Suppose we have an ideal 20mA current source and we want to measure the voltage drop across a shunt resistor to read the sensor data.

  • Scenario A (100Ω Shunt): Using Ohm's Law (V = I × R), the voltage across the resistor is 0.020A × 100Ω = 2.0V. A standard 24VDC power supply easily provides the compliance voltage needed to drive this.
  • Scenario B (1.5kΩ Shunt): The required voltage is 0.020A × 1500Ω = 30.0V. If our real-world current source is powered by a 24VDC supply, it cannot generate 30V. The source will saturate at roughly 23V (accounting for internal transistor dropout), and the actual current will drop to roughly 15.3mA, ruining the measurement.

When simulating this in LTspice, using an independent I component will blindly output 30V in Scenario B. To model the real-world failure, you must use a behavioral source with a voltage limit.

Configuring Current Sources in LTspice

LTspice offers several ways to inject current into a netlist, ranging from simple DC biases to complex, math-driven behavioral models. To place a basic source, press F2, type current, and place the component. Right-click the component to access the 'Advanced' menu for transient waveforms (SINE, PULSE, EXP, PWL).

Source Type LTspice Symbol Primary Use Case Syntax / Configuration
Independent I Fixed biasing, simple AC/DC sweeps Right-click to set DC value, AC amplitude, or transient function.
Voltage-Controlled (VCCS) G Modeling transistor transconductance (gm), operational amplifiers Value = Transconductance (e.g., 1m for 1mA/V).
Current-Controlled (CCCS) F Modeling bipolar transistor beta, current mirrors Value = Current gain (e.g., 100). Requires a 0V sensing voltage source in the control branch.
Arbitrary Behavioral B (set to I) Complex non-linear models, compliance limits, mathematical functions Value = I=... followed by math equation (e.g., I=limit(0, 20m, V(ctrl))).

For deep-dive syntax and advanced behavioral modeling, the Analog Devices LTspice documentation remains the definitive reference for exact function names and netlist parameters.

Where You Meet This in Practice

You will rarely see a standalone 'current source' component on a physical PCB, but the behavior of a current source is foundational to modern electronics. Here is where you will find yourself simulating them:

  • 4-20mA Industrial Loops: Sensors transmit data over long cables using current rather than voltage to eliminate voltage drop errors across wire resistance. LTspice is heavily used to simulate loop power budgets and fault conditions.
  • Constant Current LED Drivers: High-power LEDs require regulated current to maintain consistent luminosity and prevent thermal runaway. Simulating the driver's control loop requires accurate current source models.
  • Transistor Biasing (Current Mirrors): In integrated circuit design, current mirrors act as active loads and biasing networks. You will use dependent current sources (G and F sources) to model the small-signal behavior of these mirrors.
  • Integrator Circuits: Charging a capacitor with a constant voltage yields an exponential curve. Charging a capacitor with a constant current yields a perfectly linear voltage ramp, which is the core principle behind oscilloscope timebases and analog synthesizer envelopes.

For a broader theoretical background on how these sources interact with network theorems, All About Circuits provides an excellent primer on DC current sources and their role in circuit analysis.

Frequently Asked Questions

How do I set up a time-varying current source in LTspice?

Place an independent current source (I) and right-click it. For a simple sine wave, check the 'SINE' radio button and fill in the offset, amplitude, and frequency. For arbitrary custom waveforms (like a specific sensor output profile), select 'PWL' (Piecewise Linear). You can either type time/current pairs directly into the dialog box (e.g., 0 0 1m 5m 2m 0) or link to an external text file containing your data points.

Why is my LTspice current source simulation throwing a 'timestep too small' error?

This is the most common error when working with ideal sources. It usually happens for two reasons: First, you have an ideal current source charging a capacitor with no parallel resistive discharge path, causing the simulated voltage to climb toward infinity until the math engine breaks. Second, you have a node that is completely floating (no DC path to ground). Fix this by adding a high-value bleeder resistor (e.g., 1GΩ) in parallel with the capacitor or current source to provide a DC operating point for the simulator.

What is the difference between a G-source and a B-source for current in LTspice?

A G source is a linear Voltage-Controlled Current Source (VCCS). Its output current is strictly proportional to the voltage across its sensing nodes, defined by a single transconductance value (e.g., 5m means 5mA of output per 1V of input). A B source is an Arbitrary Behavioral Source. When configured to output current (I=...), it allows you to use complex, non-linear math functions, conditional statements (if/then), and references to any node or component in the entire schematic. Use G for simple linear small-signal models; use B for complex macro-models.

How do I model a real-world current source with a compliance voltage limit in LTspice?

To prevent an ideal source from generating infinite voltage, use a behavioral current source (B) combined with the limit() function. For example, if you want a 20mA source that is controlled by a voltage at node 'ctrl', but you want to limit the compliance voltage across the source to 12V, you can model the load interaction directly. Alternatively, place a standard independent current source in your circuit, but place a Zener diode model or a voltage-controlled switch in parallel with it to clamp the maximum voltage, accurately mimicking the saturation behavior of a physical transistor current source.