Transistors & MOSFETs
Transistors let a small signal control a larger current. de:volt ships four editable generic devices: the NPN BJT, the PNP BJT, the N-Channel MOSFET, and the P-Channel MOSFET. They are compact teaching models, not guaranteed vendor fits for a particular 2N2222, 2N2907, 2N7000, or BS250.
BJT vs. MOSFET
The two families control current in fundamentally different ways, and that difference decides how you drive them:
- BJTs are current-controlled. A small base current sets a much larger collector current (roughly
βtimes bigger). To turn one on you push current into the base, which is why BJT switches always want a series base resistor. - MOSFETs are voltage-controlled. A gate voltage opens or closes the channel. The model omits DC gate leakage, but its Cgs and Cgd capacitances draw displacement current during transitions. A floating gate therefore retains charge and needs an explicit pull-up or pull-down when you want a defined idle state.
de:volt models BJTs with an Ebers-Moll large-signal model and MOSFETs with a Shichman-Hodges level 1 model. Authored Inspector parameters feed those models directly. Exact catalog identity supplies the representative defaults listed below; a legacy or mismatched identity uses a labelled fallback instead of guessing a device.
NPN BJT
A 2N2222-class small-signal NPN: the default low-side switch. Conducts collector-to-emitter when you push current into the base; the base-emitter junction sits at ~0.7 V (Vbe) when on, and a saturated NPN drops only ~0.2 V (Vce) across collector-emitter.
Pinout
| Pin | Label | Function |
|---|---|---|
| c | C | Collector |
| b | B | Base |
| e | E | Emitter |
Specs
| Property | Value |
|---|---|
Saturation current (Is) | 1e-14 A |
Forward beta (betaF) | 100 |
Reverse beta (betaR) | 1 |
Forward / reverse emission (nF, nR) | 1 / 1 |
Forward Early voltage (earlyVoltage) | 75 V |
Max collector current (i_c_max) | 0.6 A |
Typical β (beta_typical) | 100 |
The Ebers-Moll params (Is, betaF, betaR, nF, nR) are editable in the Inspector. earlyVoltage adds a fixed forward Early-effect slope; set it to 0 to disable that effect. Ambient temperature changes the junction thermal voltage, but the model does not heat itself.
Low-side switch
The emitter goes to GND, the load sits between the collector and +V, and the microcontroller drives the base through a series resistor:
+V ──── Load ──── C
│
GPIO ─ 1kΩ ─── B (NPN)
│
E ──── GND
10kΩ from B to GND (pull-down)Drive the base through ~1 kΩ to set the base current; add a 10 kΩ base pull-down so the transistor stays firmly off when the GPIO floats (during reset or before the pin is configured). Use this for motors, relays, and high-current LEDs that a GPIO can’t drive directly: see /parts/diodes for the freewheeling diode an inductive load needs.
PNP BJT
The complement of the NPN, used as a high-side switch. Everything is mirrored: the emitter goes to +V, the load hangs off the collector to GND, and you turn it on by pulling the base low (so current flows out of the base).
Pinout
| Pin | Label | Function |
|---|---|---|
| c | C | Collector |
| b | B | Base |
| e | E | Emitter |
Specs
| Property | Value |
|---|---|
Saturation current (Is) | 1e-14 A |
Forward beta (betaF) | 100 |
Reverse beta (betaR) | 1 |
Forward / reverse emission (nF, nR) | 1 / 1 |
Forward Early voltage (earlyVoltage) | 100 V |
Max collector current (i_c_max) | 0.6 A |
Typical β (beta_typical) | 100 |
The PNP uses the complementary Ebers-Moll model with its own 100 V representative Early value. Wire the emitter to +V and the collector to the load; pull the base low through a suitable resistor to switch the load on. Because the controlling signal has to swing below +V, a PNP high-side switch is commonly paired with a small NPN driving its base.
N-Channel MOSFET
A logic-level enhancement NMOS, 2N7000 / IRLZ44N class: the voltage-driven equivalent of the NPN low-side switch, and the better choice for higher currents because it has no continuous base-drive loss.
Pinout
| Pin | Label | Function |
|---|---|---|
| d | D | Drain |
| g | G | Gate |
| s | S | Source |
Specs
| Property | Value |
|---|---|
Threshold voltage (vto) | 0.7 V |
Transconductance (k) | 0.02 A/V² |
Channel-length modulation (lambda) | 0.02 1/V |
Gate-source capacitance (cgs) | 55 pF |
Gate-drain capacitance (cgd) | 5 pF |
Max drain current (i_c_max) | 5 A |
The Shichman-Hodges params (vto, k, lambda) and fixed gate capacitances are editable in the Inspector. vto marks the start of conduction, not a guarantee of low on-resistance. Use a real device’s transfer and on-resistance curves when choosing hardware.
Low-side switch
+V ──── Load ──── D
│
GPIO ───────── G (NMOS)
│
S ──── GND
10kΩ from G to GND (pull-down)Source to GND, drain to the load. Add a 10 kΩ pull-down from gate to GND for clean turn-off when nothing drives it. The fixed Cgs/Cgd model makes edge current and Miller coupling visible, but it omits gate resistance and a complete voltage-dependent gate-charge curve. The 5 A catalog field is a reference limit for diagnostics, not a simulated current clamp or proof of safe hardware operation.
P-Channel MOSFET
The complementary high-side MOSFET: source to +V, drain to the load, and the gate driven low (relative to the source) to turn it on. The voltage-driven counterpart to the PNP.
Pinout
| Pin | Label | Function |
|---|---|---|
| d | D | Drain |
| g | G | Gate |
| s | S | Source |
Specs
| Property | Value |
|---|---|
Threshold voltage (vto) | 0.7 V |
Transconductance (k) | 0.02 A/V² |
Channel-length modulation (lambda) | 0.02 1/V |
Gate-source capacitance (cgs) | 40 pF |
Gate-drain capacitance (cgd) | 20 pF |
Max drain current (i_c_max) | 5 A |
The PMOS uses the complementary level-1 model. Wire the source to +V and the drain to the load; pull the gate low relative to the source to switch the channel on, and return it to the source voltage to switch off. A small NMOS commonly provides the level shift.
Model limits
BJTs include Ebers-Moll DC transport, gain, ambient-temperature dependence, and optional forward Early effect. They omit junction capacitance, charge storage, reverse Early effect, high-injection beta roll-off, breakdown, noise, and self-heating.
MOSFETs include cutoff, triode and saturation regions, a body diode, optional channel-length modulation, and fixed Cgs/Cgd Miller coupling. They omit voltage-dependent capacitance and full gate-charge curves, DC gate leakage, gate resistance, subthreshold conduction, avalanche, mobility-temperature drift, switching-energy failure, and self-heating.
The catalog current fields are not enforced safe-operating-area curves. Select the part to see exact identity, signed terminal-current information, and Included / Not included before relying on a result.