Schematex

Circuit schematic

Analog and digital circuit schematics from SPICE-style netlist or positional DSL. Auto-routed power/ground rails, orthogonal signal wiring, IEEE standard component symbols.

circuit·§ IEEE 315
↘ preview
100%
CE Amp (netlist) Circuit schematic with 6 components CE Amp (netlist) +V19VRc2.2kRb100kQ1Re1k
UTF-8 · LF · 6 lines · 97 chars✓ parsed·0.8 ms·5.0 KB SVG

IEEE 315 / ANSI Y32.2 symbol standard + IEC 60617 international standard + Schemdraw positional DSL approach.

Primary References:

  • IEEE Std 315-1975 (ANSI Y32.2): Graphic Symbols for Electrical and Electronics Diagrams
  • IEC 60617 (BS 3939): International graphical symbols for diagrams
  • Schemdraw documentation: https://schemdraw.readthedocs.io
  • SPICE netlist conventions (for declarative netlist DSL)

1. Component Symbol Set

1.1 DSL Approach: Positional + Declarative Hybrid

Circuit schematic layout is fundamentally different from tree/graph diagram types:

  • Schemdraw approach (positional): each component specifies a placement direction, chained sequentially
  • Netlist approach (declarative): declare components + connections, auto-layout

Schematex uses positional DSL (more intuitive, more controllable to implement), where components chain in a direction and branch via at: anchor points.

1.2 Passive Components

Resistor

  • ANSI symbol: zigzag line (6 peaks and valleys)
  • IEC symbol: rectangle 20×8px + lead wires at both ends
  • Size: 40px wide × 16px tall (occupies 40px along placement direction)
  • Pins: start (left/input end), end (right/output end)
  • SVG Path (ANSI, horizontal):
    M 0,0 L 5,0 L 8,-8 L 12,8 L 16,-8 L 20,8 L 24,-8 L 28,8 L 32,-8 L 35,0 L 40,0
    y offsets of ±8px represent the zigzag amplitude

Capacitor (non-polar)

  • Symbol: two parallel lines, 4px gap, lead wires at both ends
  • Size: 16px in horizontal direction (including leads)
  • SVG:
    <!-- Left plate -->
    <line x1="8" y1="-12" x2="8" y2="12" stroke="#333" stroke-width="2"/>
    <!-- Right plate -->
    <line x1="12" y1="-12" x2="12" y2="12" stroke="#333" stroke-width="2"/>
    <!-- Lead wires -->
    <line x1="0" y1="0" x2="8" y2="0" stroke="#333" stroke-width="2"/>
    <line x1="12" y1="0" x2="20" y2="0" stroke="#333" stroke-width="2"/>

Capacitor (polar/electrolytic)

  • Right plate changed to curved arc or marked with +
  • Curved right plate: <path d="M 12,-12 Q 16,0 12,12" fill="none"/>
  • + mark: add + text outside the left plate

Inductor

  • Symbol: 4 semicircular arcs (coils)
  • Size: 40px in horizontal direction
  • SVG Path:
    M 0,0 L 5,0
    A 5,5 0 0 1 15,0     # coil 1
    A 5,5 0 0 1 25,0     # coil 2
    A 5,5 0 0 1 35,0     # coil 3
    L 40,0
    Arcs face upward (negative y half-circle)

Transformer

  • Two inductor groups back-to-back + coupling line between them
  • Primary coils: left side, 4 semicircles
  • Secondary coils: right side, 4 semicircles (mirrored)
  • Core line: vertical line between the two groups (optional dashed line for iron core)

1.3 Sources

Voltage Source

<!-- Circle Ø24px -->
<circle cx="12" cy="0" r="12" fill="white" stroke="#333" stroke-width="2"/>
<!-- Plus sign (upper half) -->
<text x="12" y="-3" font-size="10" text-anchor="middle">+</text>
<!-- Minus sign (lower half) -->
<text x="12" y="9" font-size="10" text-anchor="middle">−</text>
<!-- Lead wires (vertical) -->
<line x1="12" y1="-20" x2="12" y2="-12"/>
<line x1="12" y1="12" x2="12" y2="20"/>

Current Source

<!-- Circle Ø24px -->
<circle cx="12" cy="0" r="12" fill="white" stroke="#333" stroke-width="2"/>
<!-- Arrow inside (pointing up = conventional current direction) -->
<line x1="12" y1="8" x2="12" y2="-3"/>
<polygon points="12,-8 9,-3 15,-3"/>

AC Source

  • Circle + sine wave symbol inside
  • Sine: <path d="M 4,0 Q 7,-6 10,0 Q 13,6 16,0" fill="none"/>

Battery

  • Series of long/short lines alternating (IEC convention)
  • Long line = positive terminal, short line = negative
  • 1-cell: one long + one short
  • Multi-cell: 3 pairs of long/short

Ground Symbols

TypeVisualUse
Earth GroundInverted triangle + 3 decreasing horizontal linesAC circuit common reference
Signal GroundInverted triangle (filled)Digital signal reference
Chassis GroundInverted trapezoid + diagonal linesChassis connection
Digital GroundInverted triangle (hollow)Digital circuits
<!-- Earth Ground (standard 3-line style) -->
<line x1="0" y1="-5" x2="0" y2="8"/>
<line x1="-12" y1="8" x2="12" y2="8"/>
<line x1="-8" y1="12" x2="8" y2="12"/>
<line x1="-4" y1="16" x2="4" y2="16"/>

1.4 Semiconductor Symbols

Diode

  • Triangle pointing in forward direction + cathode vertical bar
  • SVG:
    <!-- Triangle (anode side) -->
    <polygon points="-12,8 -12,-8 8,0" fill="#333"/>
    <!-- Cathode bar -->
    <line x1="8" y1="-10" x2="8" y2="10" stroke-width="2.5"/>
    <!-- Lead wires -->
    <line x1="-20" y1="0" x2="-12" y2="0"/>
    <line x1="8" y1="0" x2="20" y2="0"/>

Zener Diode

  • Same as Diode, with small Z-shaped bends added at both ends of the cathode bar

LED

  • Same as Diode, + two diagonal emission arrows (light rays)
    <line x1="12" y1="-8" x2="20" y2="-16" marker-end="url(#lt-arrow)"/>
    <line x1="10" y1="-5" x2="18" y2="-13" marker-end="url(#lt-arrow)"/>

NPN Bipolar Transistor (BJT)

<!-- Circle Ø32px -->
<circle cx="0" cy="0" r="16" fill="white" stroke="#333" stroke-width="1.5"/>
<!-- Base vertical line (left, inside circle) -->
<line x1="-5" y1="-14" x2="-5" y2="14" stroke-width="2.5"/>
<!-- Base wire -->
<line x1="-16" y1="0" x2="-5" y2="0"/>
<!-- Collector (upper right, going up-right) -->
<line x1="-5" y1="-8" x2="14" y2="-14"/>
<!-- Emitter (lower right, going down-right, with arrow pointing outward) -->
<line x1="-5" y1="8" x2="14" y2="14"/>
<polygon points="14,14 8,10 11,16"/> <!-- NPN arrow: pointing outward -->

PNP BJT

  • Same as NPN, but emitter arrow points inward (toward the base line)

N-Channel MOSFET

<!-- Gate lead (left) -->
<line x1="-16" y1="0" x2="-8" y2="0"/>
<!-- Gate insulation (vertical line) -->
<line x1="-8" y1="-14" x2="-8" y2="14"/>
<!-- Channel (offset right of gate) -->
<line x1="-4" y1="-10" x2="-4" y2="10"/>
<!-- Drain -->
<line x1="-4" y1="-10" x2="16" y2="-10"/>
<line x1="16" y1="-14" x2="16" y2="-10"/>
<!-- Source with arrow -->
<line x1="-4" y1="10" x2="16" y2="10"/>
<line x1="16" y1="10" x2="16" y2="14"/>
<polygon points="-4,0 -8,-4 -8,4"/> <!-- Arrow pointing toward channel -->

1.5 Active Components

Op-Amp

  • Triangle (pointing right), differential inputs on the left (-/+), output at right vertex
  • Size: 50px wide × 40px tall
  • SVG Path: M 0,40 L 0,0 L 50,20 Z
  • Input (+): (0, 10) — upper left input (non-inverting)
  • Input (−): (0, 30) — lower left input (inverting)
  • Output: (50, 20) — right vertex
  • Power (+V, −V): top/bottom midpoints of the triangle (optional display)

2. Element Connection Model

2.1 Pin Anchors

Each component has named anchor points:

AnchorMeaning
startSignal input end (typically left/top depending on direction)
endSignal output end (typically right/bottom depending on direction)
centerGeometric center of the component
Component-specifice.g. opamp: plus, minus, out, supply+, supply-
BJT-specificbase, collector, emitter
Transformer-specificp1, p2 (primary), s1, s2 (secondary)

2.2 Direction Model

Each component in the DSL specifies a placement direction (relative to the end point of the previous component):

DirectionMeaningStart → End
right (default)Extends rightwardLeft → Right
leftExtends leftwardRight → Left
downExtends downwardTop → Bottom
upExtends upwardBottom → Top

2.3 Branching with at:

R1: resistor right label="1kΩ"
at: R1.end                          # jump back to R1's end point
C1: capacitor down label="100nF"    # extend downward from R1.end

3. Layout Rules

3.1 DSL-Driven Positioning (Positional)

Circuit component coordinates are entirely determined by direction + at: in the DSL:

  • First component starts at (0, 0) (or specified origin)
  • Each subsequent component starts from the end point of the previous component
  • at: switches the starting point to a specified anchor (used for branching)
  • wire right {len} draws a bare wire segment (no component)

3.2 Default Element Lengths

ComponentDefault Length (along direction axis)
Resistor40px
Capacitor (non-polar)20px
Inductor40px
Voltage source40px (circle diameter + leads)
Diode30px
BJT40px (including circle)
Wire segment20px (default)

3.3 Coordinate System

  • SVG origin (0, 0) = starting point of the first component
  • right = x+, down = y+ (SVG standard)
  • Renderer automatically adds padding after computing bounding box (20px all sides)

3.4 Node/Net Labels

Named nets are declared with net:, allowing non-adjacent components to be "implicitly connected" (avoids long wire detours):

net VOUT
R1: resistor right
net VOUT: dot        # place a dot at R1.end and name this net
C1: capacitor down at: VOUT   # start from the net point with the same name

4. DSL Grammar (Circuit Schematic)

document      = header? statement*
header        = "circuit" quoted_string? NEWLINE

statement     = comment | component_stmt | wire_stmt | net_stmt | at_stmt | label_stmt

comment       = "#" [^\n]* NEWLINE

component_stmt = id ":" component_type direction? attrs? NEWLINE
component_type = "resistor" | "capacitor" | "inductor" | "diode" | "led"
               | "zener" | "npn" | "pnp" | "nmos" | "pmos"
               | "vsource" | "isource" | "acsource" | "battery"
               | "ground" | "opamp" | "transformer" | "switch" | "fuse"
               | "wire" | "dot"
direction      = "right" | "left" | "up" | "down"
attrs          = attr+
attr           = "label=" quoted_string
               | "value=" quoted_string
               | "length=" INT
               | "flip"             # flip symbol around axis
               | "reverse"          # reverse polarity direction
               | "dashed"           # dashed line (for RF/shield)

wire_stmt      = "wire" direction length_spec? NEWLINE
length_spec    = INT "px"

net_stmt       = "net" IDENTIFIER ":" NEWLINE    # declare net name at current point
               | "at:" anchor_ref NEWLINE        # jump to anchor
anchor_ref     = IDENTIFIER "." pin_name
               | IDENTIFIER                      # net name as anchor
pin_name       = "start" | "end" | "center" | "base" | "collector" | "emitter"
               | "plus" | "minus" | "out" | "p1" | "p2" | "s1" | "s2"

label_stmt     = "label" quoted_string direction? NEWLINE

id             = IDENTIFIER
IDENTIFIER     = /[a-zA-Z][a-zA-Z0-9_]*/
INT            = /[0-9]+/
quoted_string  = '"' /[^"]*/ '"'
NEWLINE        = /\n/

DSL Example: RC Low-Pass Filter

circuit "RC Low-Pass Filter"

V1: vsource down label="Vin" value="5V"
wire right
R1: resistor right label="R1" value="1kΩ"
wire right 20px
dot
C1: capacitor down label="C1" value="100nF"
wire down 10px
ground

at: C1.start
wire right 20px
label "Vout" right

DSL Example: Inverting Op-Amp

circuit "Inverting Amplifier"

V1: vsource down value="Vin"
wire right 20px
Rin: resistor right label="Rin" value="10kΩ"

at: Rin.end
dot
net: INV_IN

Rf: resistor right label="Rf" value="100kΩ" at: INV_IN

U1: opamp right
at: U1.minus
wire left 10px
at: INV_IN

at: U1.plus
wire down 10px
ground

at: U1.out
wire right 20px
label "Vout" right

at: Rf.end
wire down  # connect feedback from Vout back to Rf end (feedback loop)
at: U1.out

5. SVG Structure

<svg class="lt-schematic" data-diagram-type="circuit">
  <defs>
    <style>
      .lt-component { stroke: #333; stroke-width: 2; fill: none; }
      .lt-wire      { stroke: #333; stroke-width: 2; fill: none; }
      .lt-label     { font: 11px sans-serif; fill: #333; }
      .lt-value     { font: italic 10px sans-serif; fill: #555; }
      .lt-node-dot  { fill: #333; }
      .lt-no-connect { stroke: #333; stroke-width: 1.5; }
    </style>
    <!-- Arrow markers for current source / direction -->
    <marker id="lt-circ-arrow" markerWidth="6" markerHeight="6"
            refX="5" refY="3" orient="auto">
      <polygon points="0 0, 6 3, 0 6" fill="#333"/>
    </marker>
  </defs>
  <title>Circuit Schematic — [name]</title>
  <desc>[description]</desc>

  <!-- Components (each in its own group with transform) -->
  <g id="lt-components">
    <g id="R1" data-type="resistor" data-value="1kΩ" transform="translate(x,y) rotate(0)">
      <path class="lt-component" d="..."/>
      <text class="lt-label" ...>R1</text>
      <text class="lt-value" ...>1kΩ</text>
    </g>
  </g>

  <!-- Wires -->
  <g id="lt-wires">
    <line class="lt-wire" x1="" y1="" x2="" y2=""/>
  </g>

  <!-- Net dots (junction points) -->
  <g id="lt-nodes">
    <circle class="lt-node-dot" cx="x" cy="y" r="3" data-net="VOUT"/>
  </g>

  <!-- Net labels -->
  <g id="lt-net-labels">
    <text class="lt-label" ...>VOUT</text>
  </g>
</svg>

6. Test Cases

Case 1: Voltage Divider

circuit "Voltage Divider"
V1: vsource down value="12V"
wire right 20px
R1: resistor down label="R1" value="10kΩ"
dot
R2: resistor down label="R2" value="10kΩ"
wire down 10px
ground
at: V1.start
wire right 20px
at: R1.start
wire right 20px
label "Vout" right

Verify: V1 on the left, R1/R2 connected in series downward, Vout tapped from midpoint, ground at the bottom.

Case 2: LED Circuit

circuit "LED Driver"
V1: vsource down value="5V"
wire right
R1: resistor right label="R1" value="220Ω"
D1: led right label="D1"
wire down 20px
ground
at: V1.start
wire right
at: V1.start

Verify: LED symbol correct (triangle + emission rays), polarity correct.

Case 3: Common Emitter Amplifier

circuit "Common Emitter"
# Base resistor
Rb: resistor down label="Rb" value="100kΩ" at: (0, 0)
Q1: npn at: Rb.end
# Collector resistor to VCC
Rc: resistor up label="Rc" value="1kΩ" at: Q1.collector
wire up 10px
label "VCC" up
# Emitter to ground
at: Q1.emitter
wire down 10px
ground

Verify: NPN BJT symbol correct (circle + base line + outward emitter arrow).

Case 4: Inverting Op-Amp

(See Section 4 DSL example) Verify: Opamp triangle, Rin and Rf correctly connected, feedback path from output back to inverting input.

Case 5: Simple LC Filter

circuit "LC Filter"
V1: acsource down value="Vs"
wire right
L1: inductor right label="L1" value="10mH"
wire right 10px
dot
C1: capacitor down label="C1" value="1µF"
wire down 10px
ground
at: L1.start
wire down
at: V1.start

Verify: Inductor has correct arc coil symbol, capacitor has parallel plates.


7. Implementation Priority

PriorityFeatureComplexityUser Value
P0 (MVP)Resistor, Capacitor, Inductor, Voltage Source, GroundMediumCore — basic RC/RL circuits
P0Wire segments + Node dotLowCore
P0Positional DSL parser (direction chaining)MediumCore
P0Component labels + valuesLowCore
P1Diode, LED, ZenerMediumHigh
P1Battery, Current Source, AC SourceMediumHigh
P1NPN/PNP BJTMediumHigh — required for amplifier circuits
P1Op-AmpMediumHigh — required for op-amp circuits
P2MOSFET (N/P channel)MediumHigh
P2TransformerMediumMedium
P2Named net labels (implicit connection)MediumMedium
P2flip / reverse modifiersLowMedium
P3Switch variants (SPST/SPDT)MediumLow
P3555 timer / IC boxMediumLow
P3IEC resistor symbol (rectangle)LowLow

6. Expanded Professional Symbol Library (v2)

The following symbols extend the v1 standard to cover components used frequently in engineering practice. All paths are in the rightward direction (direction="right"); other directions are handled via SVG rotate transforms during rendering. The coordinate origin is at the left-center of the component.


6.1 Passive Variants

Potentiometer

  • Pins: 3-pin — start (left), wiper (center/top), end (right)
  • Size: 60px long × 24px tall (including wiper arrow)
  • SVG Path:
    /* Base zigzag (same as resistor) */
    M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0
    /* Wiper arrow pointing downward from top to center */
    M 25,-22 L 25,-10   /* vertical line */
    M 20,-22 L 25,-16 L 30,-22  /* arrowhead */
  • Wiper pin: (25, -22) i.e. center X, above body

Rheostat (variable resistor, 2-pin)

  • Pins: 2-pin — start, end
  • SVG Path: Same as potentiometer, but wiper points to end terminal (diagonal arrow through zigzag)
    M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0
    /* diagonal arrow */
    M 5,-12 L 45,12  /* diagonal line */
    M 40,8 L 45,12 L 41,7   /* arrowhead */

Thermistor NTC

  • Pins: 2-pin — start, end
  • SVG Path: Resistor zigzag + "-t°" text annotation in top-right corner
    M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0
    /* Symbol mark — rendered as <text> element */
    /* text: "-t°" at (44, -6), font-size: 8px */

Thermistor PTC

  • Same as NTC, text mark changed to "+t°"

LDR (Light Dependent Resistor)

  • Pins: 2-pin — start, end
  • SVG Path: Resistor zigzag + two inward-pointing light arrows
    M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0
    /* Left light arrow (upper-left to lower-right) */
    M 2,-18 L 14,-6   M 11,-6 L 14,-6 L 14,-9   /* arrow1 */
    /* Right light arrow */
    M 10,-20 L 22,-8  M 19,-8 L 22,-8 L 22,-11  /* arrow2 */

Varistor (MOV)

  • Pins: 2-pin — start, end
  • SVG Path: Resistor zigzag in a rounded box with "V" text
    M 0,0 H 8  M 8,-10 H 42 V 10 H 8 V -10  /* box */
    /* zigzag inside box — scaled down */
    M 10,0 L 13,-6 L 17,6 L 21,-6 L 25,6 L 29,-6 L 33,6 L 37,0
    M 42,0 H 50
    /* "V" text in renderer at (44, -14) */

Fuse

  • Pins: 2-pin — start, end
  • IEEE 315 symbol: small rectangle (representing the fusible element)
    M 0,0 H 14  /* left wire */
    M 14,-6 H 36 V 6 H 14 V -6  /* fuse body rect */
    M 36,0 H 50  /* right wire */

Fuse (Slow-Blow)

  • Same as Fuse, with an additional "T" text annotation inside the rectangle

Electrolytic Capacitor (polar)

  • Pins: 2-pin — start (negative), end (positive)
  • SVG Path:
    M 0,0 H 18   /* lead to negative plate */
    M 18,-12 V 12  /* negative plate (straight line) */
    M 22,-12 Q 26,-12 26,0 Q 26,12 22,12  /* positive plate (curved) */
    M 26,0 H 40   /* positive lead */
    /* Polarity marks */
    /* "+" text at (30, -15), font-size: 9px */
    /* "−" text at (14, -15), font-size: 9px */

Variable Capacitor

  • Pins: 2-pin — start, end
  • SVG Path: two parallel plates + diagonal arrow
    M 0,0 H 17  M 17,-12 V 12  M 23,-12 V 12  M 23,0 H 40
    /* diagonal arrow */
    M 10,-16 L 32,8   M 28,6 L 32,8 L 30,4

Crystal (quartz crystal)

  • Pins: 2-pin — start, end
  • IEEE symbol: two lines + rectangular body + two lines
    M 0,0 H 14
    M 14,-10 V 10  /* left plate */
    M 18,-8 H 32 V 8 H 18 V -8  /* crystal body rect */
    M 32,-10 V 10  /* right plate */
    M 36,0 H 50

Ferrite Bead

  • Pins: 2-pin — start, end
  • Symbol: filled small rectangle overlaid on the wire
    M 0,0 H 50   /* continuous wire */
    /* filled rect overlay */
    M 20,-5 H 30 V 5 H 20 V -5  fill="#555"

Inductor (Iron Core)

  • Same as inductor, with two parallel lines added (core):
    /* same 4-hump arcs as inductor */
    M -2,-14 H 52   /* core line 1 */
    M -2,-10 H 52   /* core line 2 */

Inductor (Ferrite Core)

  • Same as inductor, with a single filled line added:
    M -2,-12 H 52   stroke-width:3 fill="none"

Variable Inductor

  • Same as inductor + diagonal arrow (same approach as rheostat)

6.2 Power Semiconductors

IGBT (Insulated Gate Bipolar Transistor)

  • Pins: 3-pin — gate (left), collector (top-right), emitter (bottom-right)
  • Standard: IEC/IEEE N-channel IGBT = MOSFET gate + BJT collector/emitter structure + body diode
  • SVG Path (centered at origin, 60×60px body):
    /* Gate lead */
    M -20,0 H -8   /* gate input wire */
    /* Gate insulation line */
    M -8,-20 V 20   stroke-width:2
    /* Channel lines */
    M -4,-18 V -4   /* upper channel segment */
    M -4,4 V 18    /* lower channel segment */
    /* Collector/Emitter base line */
    M -4,-18 H 8   M -4,18 H 8
    /* Collector wire (top) */
    M 8,-18 V -30  /* upward */
    /* Emitter wire (bottom, with arrow) */
    M 8,18 V 30    /* downward */
    /* Emitter arrow (outward = N-type) */
    M 2,14 L 8,18 L 2,22
    /* Body diode (anti-parallel) */
    M 8,-18 L 8,18   /* diode series with emitter path */
    /* diode symbol: small triangle + bar at midpoint */
    M 12,-4 L 12,4 L 20,0 Z   /* triangle */
    M 20,-5 V 5    /* bar */

SCR / Thyristor

  • Pins: 3-pin — anode (left), cathode (right), gate (bottom)
  • Symbol: diode + gate lead extending from the cathode side
    M 0,0 H 16   /* anode lead */
    M 16,-14 L 32,0 L 16,14 Z   /* triangle */
    M 32,-12 V 12   /* cathode bar */
    M 32,0 H 50   /* cathode lead */
    M 32,8 L 32,20 H 50  /* gate lead from cathode junction downward */

TRIAC

  • Pins: 3-pin — T1 (left), T2 (right), gate (bottom)
  • Symbol: two SCRs connected in anti-parallel (head-to-head triangles)
    M 0,0 H 14
    /* Upper triangle (T1→T2 direction) */
    M 14,-12 L 30,0 L 14,12  /* triangle outline */
    M 14,-12 V 12  /* left bar */
    /* Lower triangle (T2→T1 direction, inverted) */
    M 30,-12 L 14,0 L 30,12  /* inverted triangle */
    M 30,-12 V 12  /* right bar */
    M 30,0 H 44
    /* Gate */
    M 30,8 L 44,20   /* gate lead from right junction */

DIAC

  • Pins: 2-pin — T1 (left), T2 (right)
  • Symbol: two triangles back-to-back, no gate
    M 0,0 H 14
    M 14,-12 L 28,0 L 14,12  M 14,-12 V 12
    M 28,-12 L 14,0 L 28,12  M 28,-12 V 12
    M 28,0 H 42

JFET N-Channel

  • Pins: 3-pin — gate (left), drain (top), source (bottom)
  • Symbol: vertical channel bar + gate arrow pointing inward
    /* Channel bar */
    M 20,-20 V 20   stroke-width:2
    /* Drain connection (top) */
    M 20,-20 H 40 V -30  /* horizontal + upward */
    /* Source connection (bottom) */
    M 20,20 H 40 V 30
    /* Gate with arrow */
    M -20,0 H 10  /* gate wire */
    M 10,-5 H 16  /* upper gate segment */
    M 10,5 H 16   /* lower gate segment */
    /* Arrow: pointing toward channel (N-type) */
    M 10,0 L 16,-4 L 16,4 Z   fill

JFET P-Channel

  • Same as JFET N, gate arrow direction reversed (pointing away from channel)

Darlington NPN

  • Pins: base (left), collector (top), emitter (bottom)
  • Symbol: two nested NPNs with an outer rectangle border
    M 0,-20 H 60 V 60 H 0 Z   stroke-dashed  /* outer box */
    /* inner NPN1 */
    /* inner NPN2 — emitter of NPN1 feeds base of NPN2 */
    /* simplified: show "Darlington" label inside */
    Implementation note: use generic_ic variant + "Q" label, specify darlington=true in attrs

Bridge Rectifier

  • Pins: 4-pin — ac1, ac2 (left side), dc_pos (top), dc_neg (bottom)
  • Symbol: 4 diodes arranged in a diamond pattern
    /* Rotated 45° diamond outline */
    M 0,0 L 20,-20 L 40,0 L 20,20 Z   stroke dashed (envelope)
    /* 4 diodes — simplified: arrows pointing from AC to DC rail */
    /* D1: bottom-left→top (ac1→dc_pos) */
    /* D2: bottom-right→top (ac2→dc_pos) */
    /* D3: bottom→bottom-left (dc_neg→ac1) */
    /* D4: bottom→bottom-right (dc_neg→ac2) */
    /* In renderer: draw as 40×40px diamond with internal arrows */

6.3 Optoelectronics

Photodiode

  • Pins: 2-pin — anode (left), cathode (right)
  • Symbol: standard diode + two inward-pointing arrows (indicating light reception)
    M 0,0 H 14
    M 14,-12 L 28,0 L 14,12 Z   /* triangle */
    M 28,-12 V 12   /* bar */
    M 28,0 H 42
    /* incoming light arrows (from upper-left) */
    M 0,-22 L 10,-10   M 8,-10 L 10,-10 L 10,-13
    M 6,-26 L 16,-14   M 14,-14 L 16,-14 L 16,-17

Phototransistor

  • Pins: 3-pin — collector (top), base (optional, left), emitter (bottom)
  • Symbol: NPN BJT shape + two inward arrows (light replaces base bias)
    /* NPN BJT paths (same as npn) */
    /* incoming light arrows — same as photodiode */
    M -6,-22 L 4,-10   M 2,-10 L 4,-10 L 4,-13
    M -2,-26 L 8,-14   M 6,-14 L 8,-14 L 8,-17

Optocoupler

  • Pins: 4-pin — a (LED anode), k (LED cathode), c (transistor collector), e (transistor emitter)
  • Symbol: LED + light arrows + phototransistor, enclosed in a dashed rectangle
    /* dashed isolation box */
    M 0,-20 H 80 V 60 H 0 V -20   stroke-dasharray:4,3
    /* LED symbol at x=15 */
    /* light arrows between LED and transistor */
    M 30,-5 L 50,15   /* arrow1 */
    M 30,5 L 50,25    /* arrow2 */
    /* arrowheads */
    /* phototransistor at x=55 */
    Size: 80×80px body, larger than standard components

6.4 Switches

Switch SPST (Normally Open)

  • Pins: 2-pin — start, end
  • Symbol: wire + 45° tilted arm + gap
    M 0,0 H 14   /* left wire */
    M 14,0 L 34,-12  /* contact arm (open position, 35° tilt) */
    /* contact point */
    M 36,0 H 50  /* right wire */
    /* contact dot: circle r=2 at (14,0) */
    /* contact dot: circle r=2 at (36,0) */

Switch SPDT

  • Pins: 3-pin — common (left), nc (top-right), no (bottom-right)
  • Symbol: common contact + two output terminals
    M 0,0 H 14   /* common wire */
    M 14,0 L 36,-14  /* arm pointing to NC position */
    M 38,-16 H 50   /* NC output */
    M 38,8 H 50    /* NO output (open gap) */
    /* dots at connection points */

Push Button NO (Normally Open)

  • Pins: 2-pin — start, end
  • IEEE symbol: circle representing button mechanism + horizontal broken contact
    M 0,0 H 14
    M 14,0 H 22  /* left contact */
    /* gap (NO state) */
    M 28,0 H 36  /* right contact */
    M 36,0 H 50
    /* actuator (vertical line above gap) */
    M 25,-4 V -14  /* push rod */
    M 18,-14 H 32  /* button top */

Push Button NC (Normally Closed)

  • Same as Push NO, contact connected (solid line), opens when pressed, plus slash through contact

Switch DPDT

  • Pins: 6-pin — com1, com2, nc1, nc2, no1, no2
  • Symbol: two SPDT switches mechanically ganged (dashed line connecting both arms)
    /* Upper SPDT */
    /* Lower SPDT */
    /* Mechanical link: dashed line connecting both arms */
    M 16,-20 V 40   stroke-dasharray:3,2  /* actuator shaft */

6.5 Relays

Note: Relay coil and contacts are separate independent components, associated by reference designator (e.g. K1 coil + K1 contacts).

Relay Coil

  • Pins: 2-pin — start (pos/A1), end (neg/A2)
  • IEEE symbol: rectangle + wavy line (coil)
    M 0,0 H 8
    M 8,-10 H 42 V 10 H 8 V -10  /* coil body rect */
    /* coil symbol inside */
    M 10,0 Q 12,-7 14,0 Q 16,7 18,0 Q 20,-7 22,0 Q 24,7 26,0 Q 28,-7 30,0
    M 42,0 H 50

Relay Contact NO

  • Pins: 2-pin — start, end
  • Symbol: identical to switch_spst (arm open) — but the data-relay attribute carries the K1 reference designator
    /* Identical to switch_spst SVG */
    /* Label shown as "K1" or "K1-1" (relay tag + contact number) */

Relay Contact NC

  • Symbol: Switch SPST arm + diagonal slash (indicating normally closed)
    /* switch_spst paths */
    M 16,-8 L 34,8   /* NC diagonal slash */

6.6 Measurement Symbols

Ammeter

  • Pins: 2-pin — start, end
  • Symbol: Circle + "A"
    M 0,0 H 10
    <circle cx="25" cy="0" r="14"/>
    <text x="25" y="5" text-anchor="middle" font-size="12" font-weight="bold">A</text>
    M 40,0 H 50

Voltmeter

  • Pins: 2-pin — start, end (placed in parallel with component under test)
  • Symbol: Circle + "V"
    /* same as ammeter, text: "V" */

Wattmeter

  • Pins: 4-pin (2 voltage + 2 current)
  • Symbol: Circle + "W"

Oscilloscope Probe

  • Pins: 1-pin — signal
  • Symbol: probe tip shape
    M 0,0 H 30 L 40,8 L 40,-8 L 30,0  /* probe tip */
    /* ground clip: small line below */

6.7 Special Symbols

Antenna

  • Pins: 1-pin — feed
  • Symbol: vertical mast + upward-radiating diagonal elements
    M 0,30 V 0   /* vertical mast */
    M 0,0 L -12,-16  /* left element */
    M 0,0 L 12,-16   /* right element */
    M 0,8 L -8,-4
    M 0,8 L 8,-4

Test Point

  • Pins: 1-pin — signal
  • Symbol: small circle + "TP" annotation
    <circle cx="0" cy="0" r="5" fill="white" stroke-width="1.5"/>
    /* TP label via renderer */

No-Connect

  • Pins: 0 (annotation only)
  • Symbol: X-shaped mark
    M -5,-5 L 5,5   M 5,-5 L -5,5

Voltage Regulator (3-terminal)

  • Pins: 3-pin — in (left), gnd (bottom), out (right)
  • Symbol: rectangular block + "REG" label + three pins
    M -30,0 H -10  /* input wire */
    M -10,-20 H 10 V 20 H -10 V -20  /* body rect 20×40px */
    M 10,0 H 30    /* output wire */
    M 0,20 V 40    /* ground pin */
    /* "REG" text inside body */
    /* IN/OUT/GND labels in renderer */

DC-DC Converter

  • Pins: 4-pin — vin+, vin− (left), vout+, vout− (right)
  • Symbol: rectangular block + "DC/DC" label + wavy arrow (indicating conversion)
    M -40,-15 H -15  M -40,15 H -15
    M -15,-25 H 15 V 25 H -15 V -25  /* body 30×50px */
    M 15,-15 H 40  M 15,15 H 40
    /* "DC/DC" label in renderer */
    /* internal arrow: M -8,0 L 8,0 with arrowhead */

Comparator

  • Pins: 5-pin — in_pos (top-left), in_neg (bottom-left), out (right), vcc, gnd
  • Symbol: identical to op-amp triangle, but output pin connects to an open-collector symbol
    /* identical to op-amp triangle */
    /* output: add open-circle at tip */
    <circle cx="50" cy="0" r="3" fill="white" stroke-width="1.5"/>

6.8 Updated Implementation Priority Table

PrioritySymbolsEst. Hours
P0 (MVP)resistor, capacitor, inductor, voltage_source, current_source, battery, ground, vcc, wire, dot, label, port2h
P0diode, led, zener, schottky, npn, pnp, opamp1h
P0nmos, pmos, transformer, fuse, electrolytic_cap1h
P1potentiometer, rheostat, thermistor_ntc/ptc, varistor, crystal1h
P1ferrite_bead, ldr, photodiode, phototransistor, optocoupler1h
P1switch_spst, switch_spdt, push_no, push_nc0.5h
P1relay_coil, relay_no, relay_nc0.5h
P1igbt, scr, triac, jfet_n, jfet_p1h
P1ammeter, voltmeter, test_point, no_connect, antenna0.5h
P2voltage_regulator, dc_dc_converter, comparator, schmitt_buffer1h
P2bridge_rectifier, diac, variable_cap, variable_inductor0.5h
P2motor, speaker, microphone, buzzer0.5h
P2generic_ic, 555_timer, ac_source, wattmeter0.5h
P3switch_dpdt, darlington_npn/pnp, inductor_iron/ferrite1h
P3tri_state_buffer, instrumentation_amp, dc_dc_converter0.5h

Total symbol count (v2): 64 symbols (P0: 19, P1: 24, P2: 14, P3: 7)

On this page

1. Component Symbol Set1.1 DSL Approach: Positional + Declarative Hybrid1.2 Passive ComponentsResistorCapacitor (non-polar)Capacitor (polar/electrolytic)InductorTransformer1.3 SourcesVoltage SourceCurrent SourceAC SourceBatteryGround Symbols1.4 Semiconductor SymbolsDiodeZener DiodeLEDNPN Bipolar Transistor (BJT)PNP BJTN-Channel MOSFET1.5 Active ComponentsOp-Amp2. Element Connection Model2.1 Pin Anchors2.2 Direction Model2.3 Branching with at:3. Layout Rules3.1 DSL-Driven Positioning (Positional)3.2 Default Element Lengths3.3 Coordinate System3.4 Node/Net Labels4. DSL Grammar (Circuit Schematic)5. SVG Structure6. Test CasesCase 1: Voltage DividerCase 2: LED CircuitCase 3: Common Emitter AmplifierCase 4: Inverting Op-AmpCase 5: Simple LC Filter7. Implementation Priority6. Expanded Professional Symbol Library (v2)6.1 Passive VariantsPotentiometerRheostat (variable resistor, 2-pin)Thermistor NTCThermistor PTCLDR (Light Dependent Resistor)Varistor (MOV)FuseFuse (Slow-Blow)Electrolytic Capacitor (polar)Variable CapacitorCrystal (quartz crystal)Ferrite BeadInductor (Iron Core)Inductor (Ferrite Core)Variable Inductor6.2 Power SemiconductorsIGBT (Insulated Gate Bipolar Transistor)SCR / ThyristorTRIACDIACJFET N-ChannelJFET P-ChannelDarlington NPNBridge Rectifier6.3 OptoelectronicsPhotodiodePhototransistorOptocoupler6.4 SwitchesSwitch SPST (Normally Open)Switch SPDTPush Button NO (Normally Open)Push Button NC (Normally Closed)Switch DPDT6.5 RelaysRelay CoilRelay Contact NORelay Contact NC6.6 Measurement SymbolsAmmeterVoltmeterWattmeterOscilloscope Probe6.7 Special SymbolsAntennaTest PointNo-ConnectVoltage Regulator (3-terminal)DC-DC ConverterComparator6.8 Updated Implementation Priority Table