Justin Gu
01Running live in this page. A counter drives the four inputs, and the output climbs through all 16 codes.
04

SPICEy

Circuit simulator

2026JavaScript, modified nodal analysis

The problem
A schematic shows where the parts go. Seeing what the voltages and currents do takes a simulator.
My part
I wrote the simulator and its solver in plain JavaScript, so it runs in the browser with nothing to install.
The result
Circuits run as they are drawn. Two of the examples are my own boards, the R-2R DAC and the LDO regulator.

SPICEy is a circuit simulator that runs in the browser. Circuits are drawn on a grid rather than typed as a netlist, and they run the moment they are drawn. Every wire takes the colour of its voltage. Moving dots show which way the current flows and how strongly.

It handles resistors, capacitors, inductors, diodes, LEDs, switches and an adjustable regulator modelled on the LM1117. Sources can be DC, sine, square or triangle, and logic inputs can be clocked to count in binary. A four-channel scope plots any voltage or current, and any circuit can be shared as a single link. Two of the examples are my own boards, the R-2R DAC and the 3.3 V regulator from my LDO project.

The solver uses modified nodal analysis, the same method as SPICE. Capacitors and inductors use the trapezoidal rule, and diodes use Newton-Raphson iteration. Tests check the solver against answers worked out by hand. There is nothing to install.

More projects