# EmbeddedEra circuit simulator: how to build a circuit for someone > A free circuit simulator that runs in the browser: https://embeddedera.com/tools/circuit-sim/ > You (an AI assistant) write the circuit as a short text netlist inside a link. The person opens the link and the > schematic appears, ready to run Live (moving current, glowing LEDs, meters, switches they can click) or to plot > (transient, DC sweep, AC sweep). Nothing to install, nothing uploaded. ## What to reply with One link, in this exact form, with no spaces anywhere in it: https://embeddedera.com/tools/circuit-sim/#n= Then say in a sentence or two what the circuit does and what to look at (press Live; or Plot, then Run). The link carries everything; there is no account and no file. The schematic is drawn from the netlist: parts placed left to right from the sources, every net drawn as real wires between the pins, the supply and ground as lines along the top and bottom. No coordinates needed: name the nets correctly and the wiring follows. The person can drag parts to tidy it. ## The netlist - Entries are separated by `;`. Each part is one entry: `ID,kind,net,net,...,key=value,...` - ID: a letter then letters/digits (R1, Q2, U1), unique. - kind: one of the kinds listed below, lower case. - Nets: one per pin, in the pin order given below (count must match). A net is a name you choose (vin, out, n1); pins with the same net name are connected. `0` (or gnd) is ground. Every circuit needs a ground. `-` leaves a pin unconnected (only pins that may stay open: a spare relay contact, mux channel, 555 ctrl). - Properties come after the nets, `key=value`. Leave out any you do not need: the defaults below apply. Numbers in engineering notation: 4.7k, 10u, 100n, 1meg, 2m (use u for micro, meg for mega; no units, no spaces). - Use only letters, digits and `, ; = . _ -` . Write a space as %20 and a semicolon inside a value as %3B. - Directives (optional, any order): - `.name,Title` (spaces as %20) - `.tran,STOP[,STEP]` time plot, e.g. `.tran,10m` or `.tran,3,1m` (seconds) - `.dc,SOURCE_ID,FROM,TO[,POINTS]` sweep a source's value - `.ac,SOURCE_ID,FSTART,FSTOP[,POINTS_PER_DECADE]` frequency response from that source (gain in dB and phase of each plotted net; the source's own amplitude does not matter) - `.plot,net,net,...` what to plot: net names (voltage), or I:R1 (current through a two-pin part) - `.temp,50` ambient temperature in °C (default 27) ## Examples LED with a series resistor (5 V, about 21 mA): https://embeddedera.com/tools/circuit-sim/#n=V1,dcv,vin,0,v=5;R1,resistor,vin,a,r=150;D1,led,a,0,color=red 555 astable blinking an LED at about 1 Hz, with a 3 s time plot of the capacitor and the output: https://embeddedera.com/tools/circuit-sim/#n=.name,555%20blinker;V1,dcv,vcc,0,v=9;RA,resistor,vcc,dis,r=10k;RB,resistor,dis,thr,r=68k;C1,capacitor,thr,0,c=10u;U1,timer555,0,thr,out,vcc,ctl,thr,dis,vcc;C2,capacitor,ctl,0,c=10n;R3,resistor,out,led,r=470;D1,led,led,0;.tran,3,1m;.plot,thr,out ## Parts (kind: pins in order. properties with their defaults) - rail (Supply rail): pins out. v=5 V. a supply of v volts to ground, one pin (no return pin needed) - dcv (DC source): pins +, -. v=5 V - battery (Battery): pins +, -. v=9 V, rint=500m Ω - dci (Current source): pins out, in. i=10m A. current i flows out of pin out into the circuit - acv (AC source): pins +, -. amp=5 V, freq=60 Hz, offset=0 V, phase=0 °. sine; amp is the peak (not RMS) around offset - fgen (Function gen.): pins +, -. wave=square (square|triangle|sawtooth|sine|pulse), amp=2.5 V, offset=2.5 V, freq=1k Hz, duty=500m. wave: amp is the peak around offset (square 0–5 V = amp=2.5,offset=2.5) - pwl (Piecewise source): pins +, -. points=0 0, 1m 5, 3m 5, 3.1m 0, repeat=false. points = "time value" pairs separated by commas, e.g. points=0%200,1m%205,2m%200 (%20 = space) - vstep (Step source): pins +, -. v0=0 V, v1=5 V, tstep=1m s, trise=1u s. v0 until tstep, then ramps to v1 in trise - vcvs (Voltage-controlled voltage source (E)): pins out+, out-, ctrl+, ctrl-. av=10. out = av × V(ctrl+ − ctrl−) - vccs (Voltage-controlled current source (G)): pins out+, out-, ctrl+, ctrl-. gm=1m S. output current = gm × V(ctrl+ − ctrl−) - cccs (Current-controlled current source (F)): pins out+, out-, ctrl+, ctrl-. ai=100. output current = ai × the current through ctrl+ → ctrl− (a 0 V path) - ccvs (Current-controlled voltage source (H)): pins out+, out-, ctrl+, ctrl-. rm=1k Ω. out = rm × the current through ctrl+ → ctrl− - resistor (Resistor): pins a, b. r=1k Ω, pmax=250m W - pot (Pot): pins a, b, w. r=10k Ω, pos=500m. pos = wiper position, 0 at a, 1 at b - capacitor (Capacitor): pins a, b. c=1u F, ic="". Datasheet (optional, 0 = off): esr, esl, rleak, vmax - electrolytic (Electrolytic cap): pins +, -. c=100u F, vmax=25 V, ic="". Datasheet (optional, 0 = off): esr, esl, rleak - inductor (Inductor): pins a, b. l=1m H, rdc=100m Ω, ic="". Datasheet (optional, 0 = off): isat - transformer (Transformer): pins p1, p2, s1, s2. lp=100m H, ratio=100m, k=999m, rp=1 Ω, rs=100m Ω. ratio = Ns/Np; dots on p1 and s1; no DC path between the windings - ctxfmr (Center-tapped transformer): pins p1, p2, s1, ct, s2. lp=100m H, ratio=200m, k=999m, rp=1 Ω, rs=200m Ω. centre-tapped secondary: ratio is the whole secondary s1–s2, each half gives ratio/2 - lamp (Lamp): pins a, b. r=48 Ω, prated=3 W. brightness = power / prated - spst (Switch): pins a, b. closed=false, schedule="". closed=true/false; schedule=1s%20close%3B2s%20open toggles it in time (%20 = space, %3B = ;) - spdt (Changeover switch): pins com, a, b. pos=0, schedule="". pos=0 connects com–a, pos=1 connects com–b - button (Push button): pins a, b. pressed=false, nc=false, schedule="". momentary; the person presses it in Live; nc=true for normally closed - relay (Relay (SPDT)): pins coil1, coil2, com, nc, no. rcoil=70 Ω, lcoil=100m H, vpull=3.75 V, vdrop=500m V, ron=50m Ω. coil between coil1 and coil2; contact com goes to no when the coil voltage passes vpull, back to nc below vdrop; put a diode across the coil. Datasheet (optional, 0 = off): cw - diode (Diode): pins a, k. is=10f A, n=1, rth=300 °C/W, tjmax=150 °C, tauth=2 s. a = anode, k = cathode. Datasheet (optional, 0 = off): rser, cjo, tt, vrrm, ifmax - opto (Optocoupler): pins a, k, c, e. ctr=100 %, vf=1.2 V. LED a–k, phototransistor c–e; ctr = Ic/If in % - zener (Zener diode): pins a, k. vz=5.1 V, is=10f A, rth=300 °C/W, tjmax=150 °C, tauth=2 s. reverse breakdown at vz: cathode k to the positive side. Datasheet (optional, 0 = off): zzt, izt, rser, cjo, ifmax - led (LED): pins a, k. color=red (red|orange|yellow|green|blue|white), imax=20m A, rth=400 °C/W, tjmax=125 °C, tauth=2 s. a = anode, k = cathode; color sets Vf (red 1.8, orange 2.0, yellow 2.1, green 2.2, blue/white 3.0 V); needs a series resistor R = (Vsupply − Vf) / I with I about 10–15 mA (imax 20 mA). Datasheet (optional, 0 = off): rser, vrrm - npn (NPN transistor): pins b, c, e. beta=100, is=10f A, rth=250 °C/W, tjmax=150 °C, tauth=2 s. b, c, e. Datasheet (optional, 0 = off): vaf, vcesat, icsat, cje, cjc, vceo, icmax - pnp (PNP transistor): pins b, c, e. beta=100, is=10f A, rth=250 °C/W, tjmax=150 °C, tauth=2 s. b, c, e (emitter to the positive side). Datasheet (optional, 0 = off): vaf, vcesat, icsat, cje, cjc, vceo, icmax - nmos (N-MOSFET): pins g, d, s. vt=2 V, kp=50m A/V², lambda=10m, rth=250 °C/W, tjmax=150 °C, tauth=2 s. g, d, s. Datasheet (optional, 0 = off): rdson, vgsrds, ciss, coss, crss, vdss, idmax - pmos (P-MOSFET): pins g, d, s. vt=2 V, kp=50m A/V², lambda=10m, rth=250 °C/W, tjmax=150 °C, tauth=2 s. g, d, s (source to the positive side). Datasheet (optional, 0 = off): rdson, vgsrds, ciss, coss, crss, vdss, idmax - opamp (Op-amp): pins -, +, out. model=ideal (ideal|real), gain=100k, gbw=1M Hz, slew=500k V/s, vpos=12 V, vneg=-12 V, rout=75 Ω. supply rails are the props vpos/vneg (no supply pins); model=real adds GBW, slew, rout. Datasheet (optional, 0 = off): vos, ib, headroom - comparator (Comparator): pins -, +, out. output=push-pull (push-pull|open-collector), hyst=0 V, vpos=5 V, vneg=0 V, rout=50 Ω. rails are props vpos/vneg; output=open-collector needs a pull-up resistor - timer555 (555 timer): pins gnd, trig, out, rst, ctrl, thr, dis, vcc. family=bipolar (bipolar|cmos). pins in DIP order 1–8: gnd, trig, out, rst, ctrl, thr, dis, vcc; tie rst to vcc - regulator (Voltage regulator / LDO): pins in, gnd, out. vout=5 V, dropout=2 V, ilim=1 A, iq=5m A, rth=50 °C/W, tjmax=125 °C, tauth=20 s. Vout = min(vout, Vin − dropout) - inverter (Inverter (NOT)): pins in, out. input=standard (standard|schmitt), vdd=5 V, rout=50 Ω. no supply pins: runs on the vdd prop; input=schmitt for a 74HC14 - gate (Logic gate): pins a, b, out. fn=nand (and|nand|or|nor|xor|xnor), vdd=5 V, rout=50 Ω. two-input gate, fn picks the function; no supply pins (vdd prop) - dff (D flip-flop): pins d, clk, q, qn, pre, clr. vdd=5 V, rout=50 Ω. rising-edge D flip-flop; pre/clr active low, may be left on their own net (held high inside) - mux (Mux / demux): pins ch0, ch1, ch2, ch3, com, s0, s1. dir=mux (mux|demux), type=analog (analog|digital), ch=4 (2|3|4|5|6|7|8), vdd=5 V, ron=100 Ω, rout=50 Ω. select code = s0 (low bit) + 2·s1 + 4·s2, logic high above vdd/2; pins ch0…ch(n−1), com, s0…s(k−1) with n = ch and k = select bits (2 ch → s0; 3–4 → s0,s1; 5–8 → s0,s1,s2). dir=demux routes com out to the channels; type=analog is a switch (ron, both ways), digital drives 0/vdd - voltmeter (Voltmeter): pins +, -. shows its reading in Live - ammeter (Ammeter): pins +, -. in series; shows its reading in Live - probe (Probe): pins p. a named voltage marker on a net ## Before you send the link - Count the nets of each part against its pins. A wrong count is the most common error. - Every net should reach at least two pins; a lone name is reported as unconnected. Write `-` for a pin that may stay open (unused mux channels, relay nc/no, 555 rst/ctrl, flip-flop qn/pre/clr). - .tran and .plot are optional; without .plot the first four nets are plotted. Default step: STOP/1000. - A voltage source must not be shorted or placed directly across another source; an LED needs a series resistor. - Op-amps, comparators and logic parts have no supply pins: their rails are properties. - Keep Live signals slow enough to watch (below about 50 Hz); use .tran for anything faster. - If the person reports an error, the message quotes the entry and the reason: fix that entry and send a new link. ## Limits Behavioural models (good to a few percent, not a vendor SPICE model). Logic has no propagation delay; the relay has no operate time; the optocoupler has no speed limit. Not a replacement for the datasheet.