Small Parts

JellyBean

class pcbdl.small_parts.JellyBean(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.base.Part

2 pin Jelly Bean components (this includes Resistors and Capacitors).

The main attraction to subclass this is because of the to= argument, it’s very easy to chain connections with such a part because its pins are pretty flexible therefore easy tochoose automatically. The use of this class is to allow quick connections of 2 pin devices (both pins at the same time).

One way to do this is the to= argument, allows to connect the SECONDARY pin (usually in the same expression) easily without having to save the JellyBean part to a variable first:

supply >> IC.VCC << C("100nF", to=gnd) # note how decoupling cap is fully connected

The other way these types of parts are cool and unique is the ^ operator; it allows us to describe series connections through Jellybean components. Here’s an example with a resistor divider:

some_net ^ R("1k") ^ attenuated_net ^ R("1k") ^ gnd
PINS = [('P1', '1'), ('P2', '2')]
UNITS = ''
get_pin_to_connect(pin_type, net=None)[source]
__rxor__(left_net)[source]

Implements left_net ^ jellybean. Connects the left_net to the PRIMARY pin, then returns the JellyBean part so it can keep chaining.

Note

This is similar to left_net << JellyBean(), but with the slight difference in how it can chain.

__xor__(right_net)[source]

Implements jellybean ^ right_net. Connects the right_net to the SECONDARY pin, then returns the JellyBean part so it can keep chaining.

Note

This is similar to JellyBean(to=right_net) but a little cleaner looking.

Test Point

class pcbdl.small_parts.TP(value=None, refdes=None, package=None, part_number=None, populated=True, to=None)[source]

Bases: pcbdl.small_parts.OnePinPart

Test Point

REFDES_PREFIX = 'TP'
package = 'TP'
part_number = 'TP'
class pcbdl.small_parts.OnePinPart(value=None, refdes=None, package=None, part_number=None, populated=True, to=None)[source]

Bases: pcbdl.base.Part

PINS = [('PIN', 'P')]
get_pin_to_connect(pin_type, net=None)[source]
property net

Predefined Parts

Using the previous simple classes a ton of predefined parts are available:

class pcbdl.small_parts.R(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.JellyBean

Resistor

REFDES_PREFIX = 'R'
UNITS = 'Ω'
class pcbdl.small_parts.C(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.JellyBean

Capacitor

REFDES_PREFIX = 'C'
UNITS = 'F'
class pcbdl.small_parts.C_POL(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.C

Polarized Capacitor

PINS = [('+', 'P', 'PLUS', 'P2'), ('-', 'M', 'MINUS', 'P1')]
class pcbdl.small_parts.L(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.JellyBean

Inductor

REFDES_PREFIX = 'L'
UNITS = 'H'
class pcbdl.small_parts.D(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.JellyBean

Diode

REFDES_PREFIX = 'D'
PINS = [('A', 'ANODE', 'P1'), ('K', 'CATHODE', 'KATHODE', 'P2')]
class pcbdl.small_parts.LED(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]

Bases: pcbdl.small_parts.D

Light Emitting Diode

REFDES_PREFIX = 'LED'
PINS = [('A', '+'), ('K', '-')]
class pcbdl.small_parts.BJT(value=None, refdes=None, package=None, part_number=None, populated=True)[source]

Bases: pcbdl.base.Part

BJT Transistor

REFDES_PREFIX = 'Q'
PINS = [('B', 'BASE'), ('E', 'EMITTER'), ('C', 'COLLECTOR')]
class pcbdl.small_parts.FET(value=None, refdes=None, package=None, part_number=None, populated=True)[source]

Bases: pcbdl.base.Part

FET Transistor

REFDES_PREFIX = 'Q'
PINS = [('G', 'GATE'), ('S', 'SOURCE'), ('D', 'DRAIN')]