Electrical Elements¶
Two-Terminal Elements¶
Two-terminal element definitions
-
class
schemdraw.elements.twoterm.
Breaker
(*d, dots: bool = True, **kwargs)¶ Circuit breaker
- Parameters
dots – Show connection dots
-
class
schemdraw.elements.twoterm.
CPE
(*d, **kwargs)¶ Constant Phase Element
-
class
schemdraw.elements.twoterm.
Capacitor
(flat plates)¶ - Parameters
polar – Add polarity + sign
-
class
schemdraw.elements.twoterm.
Capacitor2
(*d, polar: bool = False, **kwargs)¶ Capacitor (curved bottom plate)
- Parameters
polar – Add polarity + sign
-
class
schemdraw.elements.twoterm.
CapacitorTrim
(*d, **kwargs)¶ Trim capacitor
-
class
schemdraw.elements.twoterm.
CapacitorVar
(*d, **kwargs)¶ Variable capacitor
-
class
schemdraw.elements.twoterm.
Crystal
(*d, **kwargs)¶ Crystal oscillator
-
class
schemdraw.elements.twoterm.
Diac
(*d, **kwargs)¶ Diac (diode for alternating current)
-
class
schemdraw.elements.twoterm.
Diode
(*d, **kwargs)¶
-
class
schemdraw.elements.twoterm.
DiodeShockley
(*d, **kwargs)¶ Shockley Diode
-
class
schemdraw.elements.twoterm.
DiodeTunnel
(*d, **kwargs)¶ Tunnel Diode
-
schemdraw.elements.twoterm.
Fuse
¶ alias of
schemdraw.elements.twoterm.FuseIEEE
-
class
schemdraw.elements.twoterm.
FuseIEC
(*d, **kwargs)¶ Fuse (IEC Style)
-
class
schemdraw.elements.twoterm.
FuseIEEE
(*d, **kwargs)¶ Fuse (IEEE Style)
-
class
schemdraw.elements.twoterm.
FuseUS
(*d, dots: bool = True, **kwargs)¶ Fuse (U.S. Style)
- Parameters
dots – Show dots on connections to fuse
-
fill
(color: bool | str = True) → Element¶ Set element fill
-
class
schemdraw.elements.twoterm.
Inductor
(*d, **kwargs)¶
-
class
schemdraw.elements.twoterm.
Inductor2
(*d, loops: int = 4, **kwargs)¶ Inductor, drawn as cycloid (loopy)
- Parameters
loops – Number of inductor loops
-
class
schemdraw.elements.twoterm.
Josephson
(*d, **kwargs)¶ Josephson Junction
-
class
schemdraw.elements.twoterm.
LED
(*d, **kwargs)¶ Light emitting diode
-
class
schemdraw.elements.twoterm.
LED2
(*d, **kwargs)¶ Light emitting diode (curvy light lines)
-
class
schemdraw.elements.twoterm.
Memristor
(*d, **kwargs)¶ Memristor (resistor with memory)
-
class
schemdraw.elements.twoterm.
Memristor2
(*d, **kwargs)¶ Memristor (resistor with memory), alternate style
-
class
schemdraw.elements.twoterm.
Photodiode
(*d, **kwargs)¶ Photo-sensitive diode
-
schemdraw.elements.twoterm.
Photoresistor
¶
-
schemdraw.elements.twoterm.
PhotoresistorBox
¶
-
class
schemdraw.elements.twoterm.
PhotoresistorIEC
(*d, **kwargs)¶ Photo-resistor (European style)
-
class
schemdraw.elements.twoterm.
PhotoresistorIEEE
(*d, **kwargs)¶ Photo-resistor (U.S. style)
-
schemdraw.elements.twoterm.
PotBox
¶
-
schemdraw.elements.twoterm.
Potentiometer
¶
-
class
schemdraw.elements.twoterm.
PotentiometerIEC
(*d, **kwargs)¶ Potentiometer (European style)
- Anchors:
tap
-
class
schemdraw.elements.twoterm.
PotentiometerIEEE
(*d, **kwargs)¶ Potentiometer (U.S. style)
- Anchors:
tap
-
schemdraw.elements.twoterm.
RBox
¶
-
schemdraw.elements.twoterm.
RBoxVar
¶
-
schemdraw.elements.twoterm.
Resistor
¶
-
class
schemdraw.elements.twoterm.
ResistorIEC
(*d, **kwargs)¶ Resistor as box (IEC/European style)
-
class
schemdraw.elements.twoterm.
ResistorIEEE
(*d, **kwargs)¶ Resistor (IEEE/U.S. style)
-
schemdraw.elements.twoterm.
ResistorVar
¶
-
class
schemdraw.elements.twoterm.
ResistorVarIEC
(*d, **kwargs)¶ Variable resistor (European style)
-
class
schemdraw.elements.twoterm.
ResistorVarIEEE
(*d, **kwargs)¶ Variable resistor (U.S. style)
-
class
schemdraw.elements.twoterm.
SCR
(*d, **kwargs)¶ Silicon controlled rectifier (or thyristor)
- Anchors:
gate
-
class
schemdraw.elements.twoterm.
Schottky
(*d, **kwargs)¶ Schottky Diode
-
class
schemdraw.elements.twoterm.
Thermistor
(*d, **kwargs)¶
-
class
schemdraw.elements.twoterm.
Triac
(*d, **kwargs)¶ - Anchors:
gate
-
class
schemdraw.elements.twoterm.
Varactor
(*d, **kwargs)¶ Varactor Diode/Varicap/Variable Capacitance Diode
-
class
schemdraw.elements.twoterm.
Zener
(*d, **kwargs)¶ Zener Diode
Sources, meters, and lamp elements
-
class
schemdraw.elements.sources.
Battery
(*d, **kwargs)¶
-
class
schemdraw.elements.sources.
BatteryCell
(*d, **kwargs)¶ Cell
-
class
schemdraw.elements.sources.
Lamp
(*d, **kwargs)¶ Incandescent Lamp
-
class
schemdraw.elements.sources.
MeterA
(*d, **kwargs)¶ Ammeter
-
class
schemdraw.elements.sources.
MeterI
(*d, **kwargs)¶ Current Meter (I)
-
class
schemdraw.elements.sources.
MeterOhm
(*d, **kwargs)¶ Ohm meter
-
class
schemdraw.elements.sources.
MeterV
(*d, **kwargs)¶ Volt meter
-
class
schemdraw.elements.sources.
Neon
(*d, **kwargs)¶ Neon bulb
-
class
schemdraw.elements.sources.
Solar
(*d, **kwargs)¶ Solar source
-
class
schemdraw.elements.sources.
Source
(*d, **kwargs)¶ Generic source element
-
class
schemdraw.elements.sources.
SourceControlled
(*d, **kwargs)¶ Generic controlled source
-
class
schemdraw.elements.sources.
SourceControlledI
(*d, **kwargs)¶ Controlled current source
-
class
schemdraw.elements.sources.
SourceControlledV
(*d, **kwargs)¶ Controlled voltage source
-
class
schemdraw.elements.sources.
SourceI
(*d, **kwargs)¶ Current source
-
class
schemdraw.elements.sources.
SourcePulse
(*d, **kwargs)¶ Pulse source
-
class
schemdraw.elements.sources.
SourceRamp
(*d, **kwargs)¶ Ramp/sawtooth source
-
class
schemdraw.elements.sources.
SourceSin
(*d, **kwargs)¶ Source with sine
-
class
schemdraw.elements.sources.
SourceSquare
(*d, **kwargs)¶ Square wave source
-
class
schemdraw.elements.sources.
SourceTriangle
(*d, **kwargs)¶ Triangle source
-
class
schemdraw.elements.sources.
SourceV
(*d, **kwargs)¶ Voltage source
One-terminal Elements¶
One terminal element definitions
-
class
schemdraw.elements.oneterm.
Antenna
(*d, **kwargs)¶
-
class
schemdraw.elements.oneterm.
AntennaLoop
(*d, **kwargs)¶ Loop antenna (diamond style)
-
class
schemdraw.elements.oneterm.
AntennaLoop2
(*d, **kwargs)¶ Loop antenna (square style)
-
class
schemdraw.elements.oneterm.
Ground
(*d, **kwargs)¶ Ground connection
-
class
schemdraw.elements.oneterm.
GroundChassis
(*d, **kwargs)¶ Chassis ground
-
class
schemdraw.elements.oneterm.
GroundSignal
(*d, **kwargs)¶ Signal ground
-
class
schemdraw.elements.oneterm.
Vdd
(*d, **kwargs)¶ Vdd connection
-
class
schemdraw.elements.oneterm.
Vss
(*d, **kwargs)¶ Vss connection
Switches¶
Switches and buttons
-
class
schemdraw.elements.switches.
Button
(*d, nc: bool = False, **kwargs)¶ Push button switch
- Parameters
nc – Normally closed
-
class
schemdraw.elements.switches.
Switch
(*d, action: Optional[Literal[open, close]] = None, **kwargs)¶ Toggle Switch
- Parameters
action – action arrow (‘open’ or ‘close’)
-
class
schemdraw.elements.switches.
SwitchDIP
(*d, n: int = 3, pattern: Optional[Sequence[bool]] = None, switchcolor: str = '#333333', swidth: float = 0.4, spacing: float = 0.2, **kwargs)¶ DIP switch
- Parameters
n – Number of switches
pattern – Boolean sequence indicating whether each switch is flipped up or down
switchcolor – Fill color for flipped switches
swidth – Width of one switch
spacing – Spacing between switches
-
class
schemdraw.elements.switches.
SwitchDpdt
(*d, link: bool = True, **kwargs)¶ Double-pole double-throw switch
- Parameters
link – Show dotted line linking switch levers
- Anchors:
p1
p2
t1
t2
t3
t4
-
class
schemdraw.elements.switches.
SwitchDpst
(*d, link: bool = True, **kwargs)¶ Double-pole single-throw switch
- Parameters
link – Show dotted line linking switch levers
- Anchors:
p1
p2
t1
t2
-
class
schemdraw.elements.switches.
SwitchReed
(*d, **kwargs)¶ Reed Switch
-
class
schemdraw.elements.switches.
SwitchRotary
(*d, n: int = 4, dtheta: Optional[float] = None, theta0: Optional[float] = None, radius: float = 1, arrowlen: float = 0.75, arrowcontact: int = 0, **kwargs)¶ Rotary Switch
- Parameters
n – number of contacts
dtheta – angle in degrees between each contact
theta0 – angle in degrees of first contact
radius – radius of switch
arrowlen – length of switch arrow
arrowcontact – index of contact to point to
Values for dtheta and theta will be calculated based on n if not provided.
- Anchors:
P
T[x] for each contact (starting at 1)
-
class
schemdraw.elements.switches.
SwitchSpdt
(*d, action: Optional[Literal[open, close]] = None, **kwargs)¶ Single-pole double throw switch.
- Parameters
action – action arrow (‘open’ or ‘close’)
- Anchors:
a
b
c
-
class
schemdraw.elements.switches.
SwitchSpdt2
(*d, action: Optional[Literal[open, close]] = None, **kwargs)¶ Single-pole double throw switch, throws above and below.
- Parameters
action – action arrow (‘open’ or ‘close’)
- Anchors:
a
b
c
Lines¶
Lines, Arrows, and Labels
-
class
schemdraw.elements.lines.
Arrow
(*d, double: bool = False, headwidth: float = 0.15, headlength: float = 0.2, **kwargs)¶ - Parameters
double – Show arrowhead on both ends
headwidth – Width of arrow head
headlength – Length of arrow head
-
class
schemdraw.elements.lines.
Arrowhead
(*d, headwidth: float = 0.15, headlength: float = 0.2, **kwargs)¶
-
class
schemdraw.elements.lines.
CurrentLabel
(ofst: float = 0.4, length: float = 2, top: bool = True, reverse: bool = False, **kwargs)¶ Current label arrow drawn above an element
Use .at() method to place the label over an existing element.
- Parameters
ofst – Offset distance from element
length – Length of the arrow
top – Draw arrow on top or bottom of element
reverse – Reverse the arrow direction
-
class
schemdraw.elements.lines.
CurrentLabelInline
(direction: Literal[in, out] = 'in', ofst: float = 0.8, start: bool = True, headlength: float = 0.3, headwidth: float = 0.3, **kwargs)¶ Current direction arrow, inline with element.
Use .at() method to place arrow on an Element instance
- Parameters
direction – arrow direction ‘in’ or ‘out’ of element
ofst – Offset along lead length
start – Arrow at start or end of element
headlength – Length of arrowhead
headwidth – Width of arrowhead
-
class
schemdraw.elements.lines.
Dot
(*d, radius: float = 0.075, open: bool = False, **kwargs)¶ Connection Dot
- Parameters
radius – Radius of dot
open – Draw as an open circle
-
class
schemdraw.elements.lines.
DotDotDot
(*d, radius: float = 0.075, open: bool = False, **kwargs)¶ Ellipsis element
- Parameters
radius – Radius of dots
open – Draw dots as open circles
“Ellipsis” is a reserved keyword in Python used for slicing, thus the name DotDotDot.
-
class
schemdraw.elements.lines.
Gap
(*d, **kwargs)¶ Gap for labeling port voltages, for example. Draws nothing, but provides place to attach a label such as (‘+’, ‘V’, ‘-‘).
-
class
schemdraw.elements.lines.
Label
(*d, label: Optional[str] = None, **kwargs)¶ Label element.
For more options, use Label().label() method.
- Parameters
label – text to display.
-
class
schemdraw.elements.lines.
Line
(*d, **kwargs)¶ Straight Line
-
class
schemdraw.elements.lines.
LineDot
(*d, double: bool = False, radius: float = 0.075, fill: bool = True, **kwargs)¶ Line with a dot at the end
- Parameters
double – Show dot on both ends
radius – Radius of the dot
fill – Color to fill the dot, or True to fill with element color
-
class
schemdraw.elements.lines.
LoopCurrent
(elm_list: Optional[Sequence[schemdraw.elements.elements.Element]] = None, direction: Literal[cw, ccw] = 'cw', theta1: float = 35, theta2: float = - 35, pad: float = 0.2, **kwargs)¶ Loop current label, for mesh analysis notation
- Parameters
elm_list – List of 4 elements surrounding loop, in order (top, right, bottom, left)
direction – loop direction ‘cw’ or ‘ccw’
theta1 – Angle of start of loop arrow
theta2 – Angle of end of loop arrow
width – Width of loop
height – Height of loop
-
class
schemdraw.elements.lines.
Rect
(*d, corner1: Union[Sequence[float], schemdraw.util.Point] = (0, 0), corner2: Union[Sequence[float], schemdraw.util.Point] = (1, 1), **kwargs)¶ Rectangle Element
Used mainly for buliding more complex elements. Corner arguments are relative to Element coordinates, not Drawing coordinates.
- Parameters
corner1 – Position of top-left corner
corner2 – Position of bottom-right corner
-
class
schemdraw.elements.lines.
Tag
(*d, width: float = 1.5, height: float = 0.625, **kwargs)¶ Tag/flag element for labeling signal names.
Because text size is unknown until drawn, must specify width manually to fit a given text label.
- Parameters
width – Width of the tag
height – Height of the tag
Cables and Connectors¶
Cable elements, coaxial and triaxial
-
class
schemdraw.elements.cables.
Coax
(*d, length: float = 3, radius: float = 0.3, leadlen: float = 0.6, **kwargs)¶ Coaxial cable element.
- Parameters
length – Total length of the cable, excluding lead extensions.
radius – Radius of shield
leadlen – Distance (x) from start of center conductor to start of shield.
- Anchors:
shieldstart
shieldstart_top
shieldend
shieldend_top
shieldcenter
shieldcenter_top
-
class
schemdraw.elements.cables.
Triax
(*d, length: float = 3, leadlen: float = 0.6, radiusinner: float = 0.3, radiusouter: float = 0.6, shieldofststart: float = 0.3, shieldofstend: float = 0.3, **kwargs)¶ Triaxial cable element.
- Parameters
length – Total length of the cable
radiusinner – Radius of inner guard
radiusouter – Radius of outer shield
leadlen – Distance (x) from start of center conductor to start of guard.
shieldofststart – Distance from start of inner guard to start of outer shield
shieldofstend – Distance from end of outer shield to end of inner guard
- Anchors:
shieldstart
shieldstart_top
shieldend
shieldend_top
shieldcenter
shieldcenter_top
guardstart
guardstart_top
guardend
guardend_top
Connectors and bus lines
-
class
schemdraw.elements.connectors.
BusConnect
(*d, n: int = 1, dy: float = 0.6, up: bool = True, lwbus: float = 4, l: float = 3, **kwargs)¶ Data bus connection.
Adds the short diagonal lines that break out a bus (wide line) to connect to an Ic or Header element.
- Parameters
n – Number of parallel lines
dy – Distance between parallel lines
up – Slant up or down
lwbus – Line width of bus line
l – length of connection lines
- Anchors:
start
end
p[X] where X is int for each data line
-
class
schemdraw.elements.connectors.
BusLine
(*d, lw: float = 4, **kwargs)¶ Data bus line. Just a wide line.
Use BusConnect to break out connections to the BusLine.
- Parameters
lw – Line width
-
class
schemdraw.elements.connectors.
CoaxConnect
(*d, radius: float = 0.4, radiusinner: float = 0.12, fillinner: str = 'bg', **kwargs)¶ Coaxial connector
- Parameters
radius – Radius of outer shell
radiusinner – Radius of inner conductor
fillinner – Color to fill inner conductor
- Anchors:
center
N
S
E
W
-
class
schemdraw.elements.connectors.
DB25
(*d, pinspacing: float = 0.6, edge: float = 0.3, number: bool = False, pinfill: str = 'bg', **kwargs)¶ DB25 Connector
- Parameters
pinspacing – Distance between pins
edge – Distance between edge and pins
number – Draw pin numbers
pinfill – Color to fill pin circles
- Anchors:
pin1 thru pin25
-
class
schemdraw.elements.connectors.
DB9
(*d, pinspacing: float = 0.6, edge: float = 0.3, number: bool = False, pinfill: str = 'bg', **kwargs)¶ DB9 Connector
- Parameters
pinspacing – Distance between pins
edge – Distance between edge and pins
number – Draw pin numbers
pinfill – Color to fill pin circles
- Anchors:
pin1 thru pin9
-
class
schemdraw.elements.connectors.
Header
(*d, rows: int = 4, cols: int = 1, style: Literal[round, square, screw] = 'round', numbering: Literal[lr, ud, ccw] = 'lr', shownumber: bool = False, pinsleft: Optional[Sequence[str]] = None, pinsright: Optional[Sequence[str]] = None, pinalignleft: Literal[center, top, bottom] = 'bottom', pinalignright: Literal[center, top, bottom] = 'bottom', pinfontsizeright: float = 9, pinfontsizeleft: float = 9, pinspacing: float = 0.6, edge: float = 0.3, pinfill: str = 'bg', **kwargs)¶ Header connector element
- Parameters
rows – Number of rows
cols – Number of columns. Pin numbering requires 1 or 2 columns
style – Connector style, ‘round’, ‘square’, or ‘screw’
numbering – Pin numbering order. ‘lr’ for left-to-right numbering, ‘ud’ for up-down numbering, or ‘ccw’ for counter-clockwise (integrated-circuit style) numbering. Pin 1 is always at the top-left corner, unless flip method is also called.
shownumber – Draw pin numbers outside the header
pinsleft – List of pin labels for left side
pinsright – List of pin labels for right side
pinalignleft – Vertical alignment for pins on left side (‘center’, ‘top’, ‘bottom’)
pinalignright – Vertical alignment for pins on right side (‘center’, ‘top’, ‘bottom’)
pinfontsizeleft – Font size for pin labels on left
pinfontsizeright – Font size for pin labels on right
pinspacing – Distance between pins
edge – Distance between header edge and first pin row/column
pinfill – Color to fill pin circles
- Anchors:
pin[X] for each pin
-
class
schemdraw.elements.connectors.
Jack
(*d, **kwargs)¶ Jack (female connector)
-
class
schemdraw.elements.connectors.
Jumper
(*d, pinspacing: float = 0.6, **kwargs)¶ Jumper for use on a Header element
Set position using at() method with a Header pin location, e.g. Jumper().at(H.in1)
- Parameters
pinspacing – Spacing between pins
-
class
schemdraw.elements.connectors.
OrthoLines
(*d, n: int = 1, dy: float = 0.6, xstart: Optional[float] = None, **kwargs)¶ Orthogonal connection lines
Use at() and to() methods to specify starting and ending location of OrthoLines.
The default lines are spaced to provide connection to pins with default spacing on Ic element or connector such as a Header.
- Parameters
n – Number of parallel lines
dy – Distance between parallel lines
xstart – Fractional distance (0-1) to start vertical portion of first ortholine
-
to
(xy: Union[Sequence[float], schemdraw.util.Point]) → Element¶ Specify ending position of OrthoLines
-
class
schemdraw.elements.connectors.
Plug
(*d, **kwargs)¶ Plug (male connector)
-
class
schemdraw.elements.connectors.
RightLines
(*d, n: int = 1, dy: float = 0.6, **kwargs)¶ Right-angle line connector
Use at() and to() methods to specify starting and ending location.
The default lines are spaced to provide connection to pins with default spacing on Ic element or connector such as a Header.
- Parameters
n – Number of parallel lines
dy – Distance between parallel lines
-
to
(xy: Union[Sequence[float], schemdraw.util.Point]) → Element¶ Specify ending position of OrthoLines
Transistors¶
Transistor elements
-
class
schemdraw.elements.transistors.
Bjt
(*d, circle: bool = False, **kwargs)¶ Bipolar Junction Transistor (untyped)
- Parameters
circle – Draw circle around the transistor
- Anchors:
collector
emitter
base
-
class
schemdraw.elements.transistors.
BjtNpn
(*d, circle: bool = False, **kwargs)¶ NPN Bipolar Junction Transistor
- Parameters
circle – Draw circle around the transistor
- Anchors:
collector
emitter
base
-
class
schemdraw.elements.transistors.
BjtPnp
(*d, circle: bool = False, **kwargs)¶ PNP Bipolar Junction Transistor
- Parameters
circle – Draw circle around the transistor
- Anchors:
collector
emitter
base
-
class
schemdraw.elements.transistors.
BjtPnp2c
(*d, circle: bool = False, **kwargs)¶ PNP Bipolar Junction Transistor with 2 collectors
- Parameters
circle – Draw circle around the transistor
- Anchors:
collector
emitter
base
C2
-
class
schemdraw.elements.transistors.
JFet
(*d, **kwargs)¶ Junction Field Effect Transistor (untyped)
- Anchors:
source
drain
gate
-
class
schemdraw.elements.transistors.
JFetN
(*d, circle: bool = False, **kwargs)¶ N-type Junction Field Effect Transistor
- Parameters
circle – Draw circle around the transistor
- Anchors:
source
drain
gate
-
class
schemdraw.elements.transistors.
JFetP
(*d, circle: bool = False, **kwargs)¶ P-type Junction Field Effect Transistor
- Parameters
circle – Draw circle around the transistor
- Anchors:
source
drain
gate
-
class
schemdraw.elements.transistors.
NFet
(*d, bulk: bool = False, **kwargs)¶ N-type Field Effect Transistor
- Parameters
bulk – Draw bulk contact
- Anchors:
source
drain
gate
-
class
schemdraw.elements.transistors.
PFet
(*d, bulk: bool = False, **kwargs)¶ P-type Field Effect Transistor
- Parameters
bulk – Draw bulk contact
- Anchors:
source drain gate
Transformers¶
Transformer element definitions
-
class
schemdraw.elements.xform.
Transformer
(*d, t1: int = 4, t2: int = 4, core: bool = True, loop: bool = False, **kwargs)¶ Add taps to the windings on either side using the .taps method.
- Parameters
t1 – Turns on primary (left) side
t2 – Turns on secondary (right) side
core – Draw the core (parallel lines)
loop – Use spiral/cycloid (loopy) style
- Anchors:
p1: primary side 1
p2: primary side 2
s1: secondary side 1
s2: secondary side 2
Other anchors defined by taps method
-
tap
(name: str, pos: int, side: Literal[primary, secondary, left, right] = 'primary')¶ Add a tap
A tap is simply a named anchor definition along one side of the transformer.
- Parameters
name – Name of the tap/anchor
pos – Turn number from the top of the tap
side – Primary (left) or Secondary (right) side
Opamp and Integrated Circuits¶
Operation amplifier
-
class
schemdraw.elements.opamp.
Opamp
(*d, sign: bool = True, **kwargs)¶ Operational Amplifier.
- Parameters
sign – Draw +/- labels at each input
- Anchors:
in1
in2
out
vd
vs
n1
n2
n1a
n2a
Integrated Circuit Element
-
class
schemdraw.elements.intcircuits.
DFlipFlop
(*d, preclr: bool = False, preclrinvert: bool = True, size=(2, 3), **kwargs)¶ D-Type Flip Flop
- Parameters
preclr – Show preset and clear inputs
preclrinvert – Add invert bubble to preset and clear inputs
size – Size of the box
- Anchors:
D
CLK
Q
Qbar
PRE
CLR
-
class
schemdraw.elements.intcircuits.
Ic
(size: XY = None, pins: list[IcPin] = None, pinspacing: float = 0.6, edgepadH: float = 0.25, edgepadW: float = 0.25, leadlen: float = 0.5, lofst: float = 0.15, lsize: float = 14, plblofst: float = 0.05, plblsize: float = 11, slant: float = 0, w: float = None, h: float = None, **kwargs)¶ Integrated Circuit element, or any other black-box element with arbitrary pins on any side.
- Parameters
size – (Width, Height) of box
pins – List of IcPin instances defining the inputs/outputs
pinspacing – Spacing between pins
edgepadH – Padding between top/bottom and first pin
edgepadW – Padding between left/right and first pin
lofst – Offset between edge and label (inside box)
lsize – Font size of labels (inside box)
plblofst – Offset between edge and pin label (outside box)
plblsize – Font size of pin labels (outside box)
slant – Slant angle of top/bottom edges (e.g. for multiplexers)
If a pin is named ‘>’, it will be drawn as a proper clock signal input.
- Anchors:
inL[X] - Each pin on left side
inR[X] - Each pin on right side
inT[X] - Each pin on top side
inB[X] - Each pin on bottom side
pin[X] - Each pin with a number
CLK (if clock pin is defined with ‘>’ name)
Pins with names are also defined as anchors (if the name does not conflict with other attributes).
-
class
schemdraw.elements.intcircuits.
Ic555
(*d, **kwargs)¶
-
class
schemdraw.elements.intcircuits.
IcDIP
(*d, pins: int = 8, names: Optional[Sequence[str]] = None, notch: bool = True, width: float = 3, pinw: float = 0.6, spacing: float = 0.5, number: bool = True, fontsize: float = 12, pfontsize: float = 10, **kwargs)¶ Dual-inline Package Integrated Circuit.
- Parameters
pins – number of pins
names – List of names for each pin to display inside the box
notch – Show the notch at top of box
width – Width of the box
pinw – Width and height of each pin
spacing – Distance between each pin
number – Show pin numbers inside each pin
fontsize – Size for pin name labels
pfontsize – Size for pin number labels
- Anchors:
p[x] - Each pin
p[x]_in - Inside contact for each pin
If signal names are provided, they will also be added as anchors along with _in inside variants.
-
class
schemdraw.elements.intcircuits.
IcPin
(name: str | None = None, pin: str | None = None, side: Literal[left, right, top, bottom, L, R, T, B] = 'L', pos: float | None = None, slot: str | None = None, invert: bool = False, invertradius: float = 0.15, color: str | None = None, rotation: float = 0, anchorname: str | None = None, lblsize: float | None = None)¶ Integrated Circuit Pin
- Parameters
name – Input/output name (inside the box)
pin – Pin name/number (outside the box)
side – Side of box for the pin, ‘left’, ‘right’, ‘top’, ‘bottom’
pos – Pin position along the side, fraction from 0-1
slot – Slot definition of pin location, given in ‘X/Y’ format. ‘2/4’ is the second pin on a side with 4 pins.
invert – Add an invert bubble to the pin
invertradius – Radius of invert bubble
color – Color for the pin and label
rotation – Rotation for label text
anchorname – Named anchor for the pin
-
class
schemdraw.elements.intcircuits.
JKFlipFlop
(*d, preclr: bool = False, preclrinvert: bool = True, size=(2, 3), **kwargs)¶ J-K Flip Flop
- Parameters
preclr – Show preset and clear inputs
preclrinvert – Add invert bubble to preset and clear inputs
size – Size of the box
- Anchors:
J
K
CLK
Q
Qbar
PRE
CLR
-
class
schemdraw.elements.intcircuits.
Multiplexer
(demux: bool = False, size: XY = None, pins: list[IcPin] = None, pinspacing: float = 0.6, edgepadH: float = 0.25, edgepadW: float = 0.25, leadlen: float = 0.5, lofst: float = 0.15, lsize: float = 14, plblofst: float = 0.05, plblsize: float = 11, slant: float = 25, **kwargs)¶ - Parameters
demux – Draw as demultiplexer
size – (Width, Height) of box
pins – List of IcPin instances defining the inputs/outputs
pinspacing – Spacing between pins
edgepadH – Padding between top/bottom and first pin
edgepadW – Padding between left/right and first pin
lofst – Offset between edge and label (inside box)
lsize – Font size of labels (inside box)
plblofst – Offset between edge and pin label (outside box)
plblsize – Font size of pin labels (outside box)
slant – Slant angle of top/bottom edges
If a pin is named ‘>’, it will be drawn as a proper clock signal input.
- Anchors:
inL[X] - Each pin on left side
inR[X] - Each pin on right side
inT[X] - Each pin on top side
inB[X] - Each pin on bottom side
pin[X] - Each pin with a number
CLK (if clock pin is defined with ‘>’ name)
Pins with names are also defined as anchors (if the name does not conflict with other attributes).
-
class
schemdraw.elements.intcircuits.
SevenSegment
(*d, decimal: bool = False, digit: int | str = 8, segcolor: str = 'red', tilt: float = 10, labelsegments: bool = True, anode: bool = False, cathode: bool = False, size=(2, 1.5), **kwargs)¶ A seven-segment display digit.
- Parameters
decimal – Show decimal point segment
digit – Number to display
segcolor – Color of segments
tilt – Tilt angle in degrees
labelsegments – Add a-g labels to each segment
anode – Add common anode pin
cathode – Add common cathode pin
size – Total size of the box
- Anchors:
a
b
c
d
e
f
g
dp
cathode
anode
-
class
schemdraw.elements.intcircuits.
VoltageRegulator
(*d, size=(2, 1.5), **kwargs)¶ Voltage regulator
- Parameters
size – Size of the box
- Anchors:
in
out
gnd
-
schemdraw.elements.intcircuits.
sevensegdigit
(bottom: float = 0, left: float = 0, seglen: float = 1.5, segw: float = 0.3, spacing: float = 0.12, decimal: bool = False, digit: int | str = 8, segcolor: str = 'red', tilt: float = 10, labelsegments: bool = True) → list[SegmentType]¶ Generate drawing segments for a 7-segment display digit. Use for building new elements incorporating a 7-segment display.
- Parameters
bottom – Location of bottom of digit
left – Location of left side of digit
seglen – Length of one segment
segw – Width of one segment
spacing – Distance between segments in corners
decimal – Show decimal point segment
digit – Number to display
segcolor – Color of segments
tilt – Tilt angle in degrees
labelsegments – Add a-g labels to each segment
anode – Add common anode pin
cathode – Add common cathode pin
size – Total size of the box
- Returns
List of Segments making the digit
Other¶
Other elements
-
class
schemdraw.elements.misc.
AudioJack
(*d, radius: float = 0.075, ring: bool = False, ringswitch: bool = False, dots: bool = True, switch: bool = False, open: bool = True, **kwargs)¶ Audio Jack with 2 or 3 connectors and optional switches.
- Parameters
ring – Show ring (third conductor) contact
switch – Show switch on tip contact
ringswitch – Show switch on ring contact
dots – Show connector dots
radius – Radius of connector dots
- Anchors:
tip
sleeve
ring
ringswitch
tipswitch
-
class
schemdraw.elements.misc.
Mic
(*d, **kwargs)¶ Microphone element with two inputs.
- Anchors:
in1
in2
-
class
schemdraw.elements.misc.
Motor
(*d, **kwargs)¶
-
class
schemdraw.elements.misc.
Speaker
(*d, **kwargs)¶ Speaker element with two inputs.
- Anchors:
in1
in2
Compound elements made from groups of other elements
-
class
schemdraw.elements.compound.
ElementCompound
(*d, **kwargs)¶ Element onto which other elements can be added like a drawing
-
add
(element: schemdraw.elements.elements.Element, **kwargs) → schemdraw.elements.elements.Element¶ Add an element to the segments list
-
-
class
schemdraw.elements.compound.
Optocoupler
(*d, box: bool = True, boxfill: str = 'none', boxpad: float = 0.2, base: bool = False, **kwargs)¶ Optocoupler element
- Parameters
box – Draw a box around the optocoupler
boxfill – Color to fill the box
boxpad – Padding between phototransistor and box
base – Add a base contact to the phototransistor
- Anchors:
anode
cathode
emitter
collector
base (if base==True)
-
class
schemdraw.elements.compound.
Relay
(*d, unit: float = 2, cycl: bool = False, switch: str = 'spst', core: bool = True, box: bool = True, boxfill: str = 'none', boxpad: float = 0.25, swreverse: bool = False, swflip: bool = False, link: bool = True, **kwargs)¶ Relay element with an inductor and switch
- Parameters
unit – Unit length of the inductor
cycloid – Use cycloid style inductor
switch – Switch style ‘spst’, ‘spdt’, ‘dpst’, ‘dpdt’
swreverse – Reverse the switch
swflip – Flip the switch up/down
core – Show inductor core bar
link – Show dotted line linking inductor and switch
box – Draw a box around the relay
boxfill – Color to fill the box
boxpad – Spacing between components and box