Transistors & MOSFETs
Transistors are the parts that let a small signal control a large current — the switches and amplifiers underneath every active circuit. de:volt ships four: the NPN BJT, the PNP BJT, the N-Channel MOSFET, and the P-Channel MOSFET.
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, and the gate draws essentially no steady current. That makes them efficient to hold on, but the very high gate impedance means a floating gate picks up noise — so they want a pull-down to keep them off when nothing is driving them.
de:volt models the BJTs with the Ebers-Moll transport model and the MOSFETs with the Shichman-Hodges level 1 model — these are the engine’s device models, and the params in the Inspector feed them directly.
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 |
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. For everyday use the one that matters is betaF, the current gain.
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 |
Max collector current (i_c_max) | 0.6 A |
Typical β (beta_typical) | 100 |
Same Ebers-Moll model and the same params as the NPN. Wire the emitter to +V and the collector to the load; pull the base low through ~1 kΩ (typically from an NPN or open-collector signal) 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 |
Max drain current (i_c_max) | 5 A |
The Shichman-Hodges params (vto, k, lambda) are editable in the Inspector. A logic-level part turns fully on with about 5 V on the gate (real-world Vgs(th) is ~2 V for these).
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. The gate draws no steady current, so no series gate resistor is needed for DC switching — but the gate impedance is very high, so add a 10 kΩ pull-down from gate to GND for clean turn-off when nothing drives the gate. Good to 5 A of drain current.
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 |
Max drain current (i_c_max) | 5 A |
Same Shichman-Hodges model and params as the NMOS. Wire the source to +V and the drain to the load; pull the gate low (below the source by more than the threshold) to switch the load on, and let it return to the source voltage to switch off. As with any MOSFET high-side switch, the gate has to be driven below +V, so a small NMOS commonly does the level-shifting.