A current source in LTspice is a simulation component that forces a specific, user-defined electrical current through a branch of a circuit, adjusting its internal voltage automatically to maintain that flow regardless of the load resistance. When you drop this component into a schematic, it fundamentally changes how you analyze bias networks and active loads by removing the voltage-drop constraints of physical bench supplies, allowing you to isolate transistor gain from power supply sag. The most common mistake hobbyists and students make is confusing the basic independent source with the behavioral source, or treating the ideal simulation source as if it has real-world compliance limits.
Think of an ideal current source like a positive-displacement hydraulic pump: it pushes a fixed volume of fluid (current) per second, and if you restrict the pipe (increase resistance), the pump simply generates whatever pressure (voltage) is necessary to keep the flow constant. Below, we break down exactly which LTspice symbols to use, how to write the syntax, and where these components break down compared to physical hardware.
The Core LTspice Current Source Symbols
LTspice provides several distinct symbols for current sources, each mapped to a specific SPICE primitive. Picking the wrong one forces you into awkward workarounds later. Here is the decision matrix for the four primary source types you will find in the component library (accessed via F2 or the Component menu).
| Symbol / Prefix | SPICE Type | Best Use Case | Limitation |
|---|---|---|---|
| I (current) | Independent | Static DC biasing, simple AC sweeps, standard transient pulses (PULSE, SINE, PWL). | Cannot easily reference other node voltages dynamically without extra components. |
| bi (behavioral) | Behavioral Independent | Complex math, time-varying equations, modeling sensors with non-linear outputs. | Can cause convergence issues if equations contain discontinuities. |
| G (g) | Voltage-Controlled | Modeling transconductance amplifiers, OTAs, or V-to-I converters. | Requires defining both input (control) and output nodes. |
| F (f) | Current-Controlled | Current mirrors, sensing current through a 0V dummy voltage source. | Must reference a specific voltage source component name, not just a node. |
bi source is vastly more powerful than standard SPICE behavioral sources. It accepts arbitrary C-like expressions, including if() statements and limit() functions, directly in the value field.
Worked Numeric Example: Simulating a 4-20mA Sensor Loop
Industrial sensors frequently use a 4-20mA current loop because it is immune to voltage drop over long wire runs. Let us simulate a transmitter ramping from 4mA to 20mA into a standard 250 Ω shunt resistor, and calculate the resulting voltage the ADC will see.
The Circuit Setup
- V1: 24V DC supply (powering the transmitter).
- I1: The current source representing the transmitter, placed in series with the load.
- R1: 250 Ω load resistor (shunt) connected to ground.
The Math
According to Ohm's Law (V = I × R), the voltage across the 250 Ω shunt will be:
- At 4mA (zero-scale):
0.004 A × 250 Ω = 1.0 V - At 20mA (full-scale):
0.020 A × 250 Ω = 5.0 V
LTspice Implementation
Place the independent current source (I) on the schematic. Right-click the value field and select PWL (Piecewise Linear). We want the current to start at 4mA at time 0, and ramp to 20mA at 1 second. Enter the following syntax:
PWL(0 4m 1 20m)
Run a .tran 1.5 (transient analysis for 1.5 seconds). Probe the node between I1 and R1. The waveform will show a clean, linear ramp from 1.0V to 5.0V. This confirms your ADC scaling math before you ever wire up the physical bench prototype.
Where You Meet This in Practice
While voltage sources dominate power delivery, current sources are the backbone of signal processing and analog design. You will rely on them heavily in these specific scenarios:
- Active Loads for Amplifier Testing: Instead of using a physical resistor that changes its voltage drop as the amplifier swings, a current source forces a constant bias current, allowing you to measure the true open-loop gain and output impedance of an op-amp or discrete transistor stage.
- Photodiode and Solar Cell Modeling: Light sensors generate current proportional to lux, not voltage. A behavioral current source (
bi) mapped to a light-intensity variable lets you simulate the exact I-V curve of a photodiode under varying illumination. - Biasing Differential Pairs: The tail current source in a differential amplifier dictates the common-mode rejection ratio (CMRR) and slew rate. Simulating this with an ideal current source isolates the pair's performance from the noise of the biasing circuitry.
- Battery Charging Profiles: Modeling the Constant Current (CC) phase of a Li-Ion charge cycle is trivial using a PWL current source that holds at 1A until the cell voltage hits 4.2V.
The Compliance Voltage Trap: Ideal vs. Real
The most dangerous aspect of the current source in LTspice is that it is mathematically ideal. If you configure I1 to push 1 mA through a 1 MΩ resistor, LTspice will happily generate 1,000 volts across the resistor to maintain that 1 mA flow.
A real-world 4-20mA transmitter powered by a 24V loop supply has a compliance voltage limit. If the loop resistance gets too high (e.g., 1500 Ω), the transmitter runs out of voltage headroom and the current collapses. LTspice's default
I source does not know about your 24V rail; it will generate 30V, 100V, or 1000V to force the current. Always verify that the voltage across your simulated current source does not exceed the compliance limits of the physical component you intend to buy.
How to fix this in LTspice: If you need to model real-world compliance limits, swap the independent I source for a behavioral bi source and use the limit() function, or place a Zener diode in parallel with the current source to clamp the maximum voltage it can generate.
Quick-Start Decision Path: Which Source Do I Pick?
Use this if-then logic to select the right component for your next schematic:
- IF you need a simple, static DC bias or a standard AC small-signal sweep THEN use the basic I (independent) source.
- IF your current output depends on a voltage elsewhere in the circuit (like a V-to-I converter) THEN use the G (voltage-controlled) source.
- IF you need to model a complex sensor, a time-dependent ramp, or a mathematical equation THEN use the bi (behavioral) source.
Default Pick: For 90% of non-trivial, modern analog simulations, use the bi (Behavioral Independent) source. It accepts arbitrary expressions (e.g., I = V(in) * 0.05 + 1m), covers all the use cases of the basic I source, and saves you from having to swap components later when your simulation requirements inevitably expand.
Frequently Asked Questions
Why does my LTspice simulation fail to converge when I use a current source?
Convergence failures usually happen when a current source is connected to a node that has no DC path to ground (a floating node). SPICE requires every node to have a finite DC resistance to ground to solve the initial operating point. If your current source feeds directly into a capacitor or an ideal op-amp input, add a high-value resistor (e.g., 1G or 1 Gigaohm) from that node to ground to provide a DC path without affecting your AC or transient results.
Can I make a current source that turns off based on a digital signal?
Yes. Use the bi source and incorporate an if() statement referencing a digital node. For example: I = if(V(enable) > 2.5, 0.020, 0). This will output 20mA when the enable pin is high (above 2.5V) and 0mA when it is low. To prevent convergence issues from the hard step, use the u() (step) function with a slight smoothing factor, or use the s (voltage-controlled switch) symbol in series with a standard DC current source.
Where can I find more advanced LTspice behavioral syntax?
The official Analog Devices LTspice documentation covers the basics, but the most comprehensive, community-maintained library of behavioral functions and edge-case workarounds is hosted on the LTspice Groups.io Wiki. The 'B-sources' (behavioral) section of that wiki is mandatory reading for advanced analog modeling.






