Basic Circuit Elements

See Electrical Elements for complete class definitions for these elements.

Two-terminal Elements

Two-terminal devices subclass schemdraw.elements.Element2Term, and have leads that will be extended to make the element the desired length depending on the arguments. All two-terminal elements define start, end, and center anchors for placing, and a few define other anchors as shown in blue in the tables below. Some elements have optional parameters, shown in parenthesis in the table below.

Styled Elements

These elements change based on IEEE/U.S. vs IEC/European style configured by schemdraw.elements.style(). Selectable elements, such as Resistor, point to either ResistorIEEE or ResistorIEC, for example.

IEEE Style

IEEE style, common in the U.S., is the default, or it can be configured using

elm.style(elm.STYLE_IEEE)
../_images/electrical_1_0.svg

IEC/European Style

IEC style can be enabled using

elm.style(elm.STYLE_IEC)
../_images/electrical_2_0.svg

Resistors

Both styles of resistors are always available using these classes.

../_images/electrical_3_0.svg

Capacitors and Inductors

../_images/electrical_4_0.svg

Diodes

../_images/electrical_5_0.svg

Miscellaneous

../_images/electrical_6_0.svg

Sources and Meters

../_images/electrical_7_0.svg

Switches

../_images/electrical_8_0.svg

Lines and Arrows

../_images/electrical_9_0.svg

Single-Terminal Elements

Single terminal elements are drawn about a single point, and do not move the current drawing position.

Power and Ground

../_images/electrical_10_0.svg

Antennas

../_images/electrical_11_0.svg

Connection Dots

../_images/electrical_12_0.svg

Switches

The standard toggle switch is listed with other two-terminal elements above. Other switch configurations are shown here.

Single-pole double-throw

Two options for SPDT switches can be also be drawn with arrows by adding action=’open’ or action=’close’ parameters.

../_images/electrical_13_0.svg

Double-pole

DPST and DPDT switches have a link parameter for disabling the dotted line lnking the poles.

../_images/electrical_14_0.svg

Rotary Switch

The rotary switch schemdraw.elements.switches.SwitchRotary takes several parameters, with n being the number of contacts and other parameters defining the contact placement.

../_images/electrical_15_0.svg

DIP Switch

A set of switches in a dual-inline package, where can show each switch flipped up or down. See schemdraw.elements.switches.SwitchDIP for options.

../_images/electrical_16_0.svg

Audio Elements

Speakers, Microphones, Jacks

../_images/electrical_17_0.svg
../_images/electrical_18_0.svg

Labels

The Label element can be used to add a label anywhere. The Gap is like an “invisible” element, useful for marking the voltage between output terminals.

../_images/electrical_19_0.svg

Operational Amplifiers

The schemdraw.elements.opamp.Opamp element defines several anchors for various inputs, including voltage supplies and offset nulls.

../_images/electrical_20_0.svg

Transistors

Bipolar Junction Transistors

../_images/electrical_21_0.svg

Field-Effect Transistors

../_images/electrical_22_0.svg

Cables

schemdraw.elements.cables.Coax and schemdraw.elements.cables.Triax cables are 2-Terminal elements that can be made with several options and anchors. Coax parameters include length, radius, and leadlen for setting the distance between leads and the shell. Triax parameters include length, radiusinner, radiusouter, leadlen, and shieldofststart for offseting the outer shield from the inner guard.

../_images/electrical_23_0.svg
../_images/electrical_24_0.svg

Transformers

The schemdraw.elements.xform.Transformer element is used to create various transformers. Anchors p1, p2, s1, and s2 are defined for all transformers. Other anchors can be created using the taps method to add tap locations to either side.

../_images/electrical_25_0.svg

Here is a transformers with anchor “B” added using the tap method. Note the tap by itself does not draw anything, but defines a named anchor to connect to.

d = schemdraw.Drawing(fontsize=12)
x = d.add(elm.Transformer(t1=4, t2=8)
          .tap(name='B', pos=3, side='secondary'))
d.add(elm.Line().at(x.s1).length(d.unit/4).label('s1', 'rgt').color('blue'))
d.add(elm.Line().at(x.s2).length(d.unit/4).label('s2', 'rgt').color('blue'))
d.add(elm.Line().at(x.p1).length(d.unit/4).left().label('p1', 'lft').color('blue'))
d.add(elm.Line().at(x.p2).length(d.unit/4).left().label('p2', 'lft').color('blue'))
d.add(elm.Line().at(x.B).length(d.unit/4).right().label('B', 'rgt').color('blue'))
d.draw()
../_images/electrical_26_0.svg