FluxBench.AI · software checked September 22, 2026
Measure an analog circuit
Use the Lab’s Analog SPICE bench to find steady-state voltages, watch a circuit change over time, or measure frequency response. Start with a checked example, then copy a supported resistor/capacitor breadboard circuit into an independent analog setup.
The bench uses ngspice 47. Its results belong to the displayed netlist; they do not run the MCU, drive the breadboard or replace its Teaching-mode instruments.
For one supported combined example, open Mixed Uno + RC · qualified example in the Lab. It runs pinned Uno firmware and an RC solver together for 250 µs, with source-bound interrupt events. See its exact scope and instructions.
Your first analysis
- Open a project’s Lab. Find Analog SPICE bench in the 2D instruments or the 3D Probe panel.
- Choose Resistor divider under Reference example. The independent example uses 5 V, 1 kΩ and 3 kΩ; your breadboard can stay as it is.
- Select Run analog analysis. Expect v(out) = 3.75 V and i(v1) = −0.00125 A. A negative source current means the source delivers power under SPICE’s current convention.
- Choose RC charge and discharge for a waveform. Run it, select a plot signal, then move Sample time to inspect the captured values. The waveform’s horizontal axis is simulation time in seconds.
- Select Save analog setup, then Save project. Reopen the project and rerun the analysis to obtain a fresh capture.
“Reference checks passed” applies to an exact built-in reference and its fixed tolerances. A custom circuit can produce a usable capture without being a validated reference.
Measure a filter’s frequency response
- Choose AC · RC low-pass filter and run it. Select v(out) as the plot signal and v(input) as the reference signal for gain.
- Choose Gain (dB) or Phase (degrees). The cursor near 158.489 Hz shows about −2.992 dB and −44.880°. The equation’s exact cutoff is 159.155 Hz; that frequency is between this example’s captured points.
- Use RC high-pass, RL or RLC examples to compare attenuation and resonance. Save the setup and project, or export SPICE and the raw complex CSV for your own calculations.
AC is small-signal analysis around a DC operating point. A source such as V1 input 0 DC 5 AC 2 90 sets a 5 V bias and a 2 V phasor at 90°. These are separate quantities. AC results do not show clipping, transient startup or a full-amplitude nonlinear waveform.
.ac dec 20 10 100k uses 20 intervals per decade from 10 Hz to 100 kHz. oct uses intervals per octave; lin specifies the total number of samples. Both endpoints must lie on the grid. Include a nonzero AC voltage/current source; PULSE sources are rejected in AC mode.
Without a reference signal, levels are dBV or dBA. A same-unit reference gives a complex ratio and dB gain. Phase is wrapped to ±180°. Zero-magnitude phase/levels and division by a zero reference are undefined, so the plot leaves a gap. The table always shows absolute signals.
Trace a DC characteristic
Choose DC sweep · diode load line, run it and select v(out). The curve shows the generic diode voltage as its supply changes from 0 to 5 V through a 1 kΩ resistor. At 5 V, expect about 0.57448 V across the diode and −4.4255 mA into the source.
Use .dc V1 0 5 0.05 for 101 operating points. A current-source sweep uses amperes, such as .dc I1 -2m 2m 0.1m. For reverse traversal, give a negative step: .dc V1 5 -5 -0.25. The source must exist, all sources must be constant, and both endpoints must lie on the grid.
The horizontal axis is source voltage/current, not time. Capacitors are open circuits and ideal inductors are shorts at steady state. Reverse sweeps do not establish hysteresis. The diode and amplifier examples use the stated generic models; the idealized amplifier has no supply rails or clipping.
Copy your breadboard circuit
Use resistors and capacitors connected to explicitly labeled 3V3 or 5V pins and GND. All placed parts must be supported. LEDs, sensors, switches, batteries, extension decks and connections to GPIO or an unknown supply pin prevent this import.
- Select Preview breadboard import. Choose the DC operating point, 12 ms supply pulse, AC frequency response, or DC supply sweep. Frequency/DC sweeps require one connected ideal supply; their preview states the bias, excitation and range.
- Review the generated netlist and terminal map. Check the split-rail connections and supply names. Select a mapped terminal to place the red probe on that location in your current Lab view.
- Select Use generated netlist as draft, then Run analog analysis. This copies the circuit into the analog draft and leaves breadboard parts and wires unchanged.
- Save the analog setup and project. If the circuit later changes, generate a new snapshot before running again. Use Keep as independent netlist only when you deliberately want to stop checking it against the breadboard.
A simple DC check
Connect 3V3 → 1 kΩ → midpoint → 1 kΩ → GND. The midpoint should be 1.65 V. Capacitors act as open circuits in the DC steady-state analysis.
A simple transient check
Connect 3V3 → 1 kΩ → midpoint, then 1 µF from midpoint to GND. Pulse mode captures 12 ms with 5 µs sample intervals; the RC time constant is 1 ms. This is a virtual supply stimulus, independent of firmware.
Frequency response keeps the labeled supply as DC bias and adds a 1 V AC excitation from 10 Hz to 100 kHz. Choose the supply node as the gain reference. The DC sweep uses 101 source values from 0 V to the label. These stimuli belong to the independent analog circuit; they do not model MCU operation or regulator behavior.
The terminal map locates the circuit; the probe’s Teaching reading remains separate from the SPICE result table. Moving a free part or changing wire color without changing connectivity does not invalidate the snapshot. Editing netlist text affects only the analog circuit.
Twenty-one reproducible examples
These are the same reference netlists available in the Lab. Expand one to inspect or copy it. The semiconductor examples use explicit generic models, rather than a named manufacturer device.
The RL and RLC examples add ideal inductors. Select i(l1) to inspect current from the inductor’s first terminal to its second. RLC ringing can exceed the source voltage or fall below ground as stored energy moves between L and C. These models do not include saturation, winding resistance, coupling or protection diodes. Breadboard copying still accepts only R/C circuits.
Resistor divider
5 V across 1 kΩ and 3 kΩ. Check output voltage and source current.
* Divider: ideal resistors
V1 supply 0 5
R1 supply out 1k
R2 out 0 3k
.op
.save v(out) i(v1)
Vout = 5 × 3000 / 4000. Source current is −5 / 4000 A under SPICE’s positive-into-source convention.
RC charge and discharge
1 kΩ, 1 µF, a 5 V pulse and a 1 ms time constant. Capture both edges.
* RC: explicit 1 us edges
V1 input 0 PULSE(0 5 1m 1u 1u 5m 20m)
R1 input out 1k
C1 out 0 1u
.tran 10u 12m
.save v(out)
RC = 1 ms. Each finite voltage ramp uses s[t − τ(1 − exp(−t/τ))], followed by exponential settling; falling-edge response is superposed. Every uniform sample is scored.
Generic diode
1 mA through the explicit FB_D model at 27 °C. This is not a 1N4007 model.
* Generic Shockley diode
I1 0 out 1m
D1 out 0 FB_D
.op
.save v(out)
Vd = kT/q × ln(1 + I/Is), T = 300.15 K, Is = 10⁻¹² A, n = 1; series resistance and charge storage are explicitly zero.
Generic NPN transistor
10 µA base drive, β = 100 and a 1 kΩ collector load. Forward-active operation only.
* Generic forward-active NPN
V1 supply 0 5
Ibase 0 base 10u
R1 supply out 1k
Q1 out base 0 FB_NPN
.op
.save v(out) v(base) i(v1)
Ic ≈ βIb = 1 mA, Vc = 5 − Ic × 1000 = 4 V; Vbe = kT/q × ln(1 + Ic/Is). Reverse leakage is below the declared absolute tolerances. No manufacturer 2N2222 claim.
Idealized op-amp gain
Non-inverting gain of about ten with finite open-loop gain 100,000. No supply rails, slew rate or bandwidth model.
* Explicit idealized op-amp; not LM358
V1 input 0 0.1
R1 feedback 0 1k
R2 out feedback 9k
X1 input feedback out FB_OPAMP
.op
.save v(out) v(feedback)
Vout = A × Vin / (1 + Aβ), A = 100000, β = 1000 / 10000. The explicit VCVS model is linear and has no rail clipping or transient limitations.
RL current rise and decay
100 Ω and 100 mH driven by a 5 V pulse. Inspect the 1 ms current time constant and reverse inductor voltage.
* Ideal RL with finite source edges
V1 input 0 PULSE(0 5 1m 1u 1u 5m 20m)
L1 input out 100m
R1 out 0 100
.tran 10u 12m
.save v(out) i(l1) i(v1)
L/R = 1 ms. Resistor voltage follows the same finite-ramp first-order equation as the RC reference. Inductor current is Vout/100 A, positive from input to out; source current has the opposite sign. Ideal inductance has no saturation or winding losses.
RLC ringing and damping
100 Ω, 100 mH and 1 µF. Inspect overshoot, ringing and signed inductor current on both pulse edges.
* Underdamped series RLC
V1 input 0 PULSE(0 5 1m 1u 1u 5m 20m)
R1 input coil 100
L1 coil out 100m
C1 out 0 1u
.tran 3u 12m
.save v(out) i(l1) i(v1)
Solve LC Vout″ + RC Vout′ + Vout = Vin with zero initial energy. α = R/(2L) = 500/s; damped angular frequency = √(1/(LC) − α²). Integrate the unit-step response over each 1 µs edge. IL = C × dVout/dt; source current is −IL. All samples are checked against this independent equation.
Inductor DC operating point
An ideal inductor becomes a short circuit at steady state. A 100 Ω load limits current to 50 mA.
* Ideal inductor at DC
V1 input 0 5
L1 input out 100m
R1 out 0 100
.op
.save v(out) i(l1) i(v1)
At DC, VL = L × dI/dt = 0. Vout = 5 V, IL = 5/100 = 0.05 A and IV1 = −0.05 A. The load is required; an ideal source/inductor loop may be singular.
AC · RC low-pass filter
1 kΩ / 1 µF, 159.15 Hz cutoff. Inspect attenuation and phase lag from 10 Hz to 100 kHz.
* Small-signal RC low-pass
V1 input 0 AC 1
R1 input out 1k
C1 out 0 1u
.ac dec 20 10 100k
.save v(input) v(out) i(v1)
H = 1/(1 + jωRC), RC = 1 ms; source current = −jωC H. At fc = 1/(2πRC), |H| = 1/√2 and phase = −45°. Input is 1 V at 0°.
AC · RC high-pass filter
1 µF / 1 kΩ, 159.15 Hz cutoff. Low frequencies attenuate while phase leads the input.
* Small-signal RC high-pass
V1 input 0 AC 1
C1 input out 1u
R1 out 0 1k
.ac dec 20 10 100k
.save v(input) v(out) i(v1)
H = jωRC/(1 + jωRC), RC = 1 ms; source current = −H/R. At cutoff, |H| = 1/√2 and phase = +45°.
AC · RL current and phase
100 mH / 100 Ω. Compare resistor voltage and signed coil/source currents across frequency.
* Small-signal RL
V1 input 0 AC 1
L1 input out 100m
R1 out 0 100
.ac dec 20 1 10k
.save v(out) i(l1) i(v1)
IL = 1/(R + jωL), Vout = R IL and source current = −IL. Ideal L = 100 mH; the R/L corner is 159.15 Hz.
AC · RLC resonance
100 Ω / 100 mH / 1 µF. A linear sweep resolves capacitor-voltage peaking near 503 Hz.
* Small-signal series RLC
V1 input 0 AC 1
R1 input coil 100
L1 coil out 100m
C1 out 0 1u
.ac lin 401 10 2010
.save v(out) i(l1) i(v1)
H = 1/(1 − ω²LC + jωRC); IL = jωC H and source current = −IL. At ω0 = 1/√(LC), H = −j√(L/C)/R. Voltage peaking can exceed the 1 V input; the peak is below ω0 when damping is nonzero.
AC · source phase and DC bias
A divider driven by 5 V DC plus a 2 V, 90° AC excitation. The sweep reports only the AC response.
* DC bias and phased AC voltage
V1 input 0 DC 5 AC 2 90
R1 input out 1k
R2 out 0 3k
.ac oct 4 10 640
.save v(out) i(v1)
AC input phasor is j2 V; Vout = j2 × 3/4 = j1.5 V and source current = −j2/4000 A. The separate DC operating point would be 3.75 V, which is not added to these AC values.
AC · current-source excitation
1 mA DC plus a 2 mA, −90° excitation into 1 kΩ. Check source units and phase direction.
* Phased AC current source
I1 0 out DC 1m AC 2m -90
R1 out 0 1k
.ac lin 5 10 1000
.save v(out)
Current flows into out with phasor −j0.002 A. Ohm’s law gives Vout = −j2 V. The 1 V DC bias is independent of the AC response.
AC · biased generic diode
FB_D biased at 1 mA, with a 10 µA small-signal excitation. This is a generic differential-resistance example.
* Small-signal linearization of generic diode
I1 0 out DC 1m AC 10u
D1 out 0 FB_D
.ac dec 10 100 10k
.save v(out)
Linearize the Shockley equation at 1 mA: rd = (kT/q)/(Id + Is), T = 300.15 K, Is = 10⁻¹² A. Vac = 10 µA × rd. This generic model has zero junction capacitance and storage; frequency-independent response is intentional, not manufacturer behavior.
DC sweep · bipolar divider
Sweep −5 V to +5 V through a 1 kΩ / 3 kΩ divider. Inspect positive and negative signed currents.
* DC divider sweep
V1 input 0 0
R1 input out 1k
R2 out 0 3k
.dc V1 -5 5 0.25
.save v(input) v(out) i(v1)
Vout = Vin × 3000/4000; source current = −Vin/4000. Reversing traversal preserves each steady-state result; it does not introduce hysteresis.
DC sweep · reverse divider
Sweep the same divider from +5 V to −5 V. The source axis follows the requested direction.
* DC divider sweep
V1 input 0 0
R1 input out 1k
R2 out 0 3k
.dc V1 5 -5 -0.25
.save v(input) v(out) i(v1)
Vout = Vin × 3000/4000; source current = −Vin/4000. Reversing traversal preserves each steady-state result; it does not introduce hysteresis.
DC sweep · current source
Sweep −2 mA to +2 mA into 1 kΩ. The horizontal axis is amperes, not volts or seconds.
* DC current sweep
I1 0 out 0
R1 out 0 1k
.dc I1 -2m 2m 0.1m
.save v(out)
Vout = Iin × R = Iin × 1000. The current-source orientation injects positive current into out.
DC sweep · diode load line
Sweep 0–5 V through 1 kΩ into the generic diode. See the curved voltage and source-current response.
* Generic diode with series load
V1 input 0 0
R1 input out 1k
D1 out 0 FB_D
.dc V1 0 5 0.05
.save v(input) v(out) i(v1)
Solve Is × (exp(Vd/Vt) − 1) = (Vin − Vd)/R by an independent bracketed root, R=1 kΩ, Is=1 pA and Vt=kT/q at 27 °C. IV1 = −(Vin−Vd)/R. The generic diode excludes breakdown, self-heating and series resistance.
DC sweep · diode current bias
Sweep 0–1 mA into the generic diode and compare its logarithmic forward voltage.
* Generic diode current sweep
I1 0 out 0
D1 out 0 FB_D
.dc I1 0 1m 10u
.save v(out)
Vd = Vt × ln(1+I/Is), Is=1 pA and Vt=kT/q at 27 °C. At zero current, the expected ideal-model voltage is zero. This model has no manufacturer identity.
DC sweep · idealized amplifier
Sweep −2 to +2 V through a gain-two idealized amplifier. Its model has finite gain but no supply rails or clipping.
* Idealized finite-gain amplifier
V1 input 0 0
X1 input feedback out FB_OPAMP
R1 out feedback 1k
R2 feedback 0 1k
.dc V1 -2 2 0.04
.save v(out) v(feedback)
Vout = A × (Vin − Vout/2), A=100,000, hence Vout=2Vin/(1+2/A). No supply pins, current limit, offset or saturation exists in FB_OPAMP; this is not an LM358 model.
Save, export and recover
- Save analog setup adds the draft and its breadboard origin to the workspace and Undo history. Save project syncs that setup; use project version history for recovery. Captures need to be run again.
- Export SPICE downloads the circuit as a .cir file. Import SPICE validates the supported netlist syntax and opens an independent draft. A SPICE file does not contain FluxBench’s breadboard-origin metadata.
- Export analog CSV downloads the current result columns and samples. Times are seconds, frequencies are hertz, voltages are volts, and currents are amperes. AC files preserve both real and imaginary components; display and gain choices do not change the raw export.
When a result is unavailable
- Breadboard changed
- The saved circuit origin no longer matches. Preview and adopt a new snapshot, or deliberately keep the old netlist independent. Previous results are hidden to avoid showing them for a changed circuit.
- Unsupported part or model
- Check the reported part or pin. Breadboard copying currently accepts only resistors, capacitors and known ideal supply connections. Handwritten netlists support the listed generic models; manufacturer model files and arbitrary subcircuits are not accepted.
- Analysis did not converge
- Check ground, disconnected islands and conflicting ideal voltage sources. An incomplete capture is a failed analysis; changing an expectation cannot turn it into a passing reference.
- Unexpected value or units
- In SPICE, m means milli; use meg for mega. Confirm which signal is selected, and remember that current into a voltage source is positive. Read the model limits before comparing a generic model with a device datasheet.
What has been checked
Twenty-one reference circuits pass 21,727 numerical checks on Windows and Linux ngspice 47. Six DC sweep references contribute 893 checks, with changed divider/load/feedback, reversed current and conflicting-source faults detected. Seven AC references contribute 4,016 of those checks and detect changed cutoff, damping, current direction, source phase, excitation amplitude and DC bias, plus a conflicting-source failure. The three inductor references add 15,609 checks and detect changed inductance, reversed current direction and an invalid ideal-source loop. Ten generated breadboard circuits retain their separate 21,630 voltage/current checks. Their twenty AC/DC sweep variants pass another 7,890 checks, with changed capacitance, divider resistance and a disconnected split rail detected. Changed capacitance and a disconnected split-rail bridge fail their original expectations. Browser checks cover probing, stale snapshots, Undo, save/reopen, version recovery and SPICE/CSV export.
The original operating-point/transient references use 2% relative error with 1 mV / 1 µA absolute floors. AC references use independent complex circuit equations with 0.0001% relative error and 1 nV / 1 pA absolute floors. DC sweeps use 0.01% relative error and 1 µV / 1 nA absolute floors. Tiny Windows/Linux transient and diode-sweep differences remain inside those tolerances; identical bytes across platforms are not promised. These checks cover the declared examples, rather than every circuit the solver can accept.
Supported analyses are one DC operating point, transient, AC sweep or DC source sweep per netlist, with up to 128 elements, 64 nodes, eight saved signals and 4,096 intervals. Transients stop within two seconds; AC spans 0.001 Hz to 1 GHz with both endpoints on the selected grid. Breadboard import allows up to 64 resistor/capacitor parts and 256 wires. Manufacturer models, arbitrary MCU/analog co-simulation, physical validation and competitor timing comparisons remain pending.