Skip to main content

Subsection 5.2.4 Part 3: Designing a Low-Side NPN Driver

Now we’ll design the circuit a GPIO pin uses to switch a load: an NPN transistor with a resistor into its base. The reading showed that a transistor can act as a switch, and the first question is where the load is connected. That depends on the transistor’s type: for an NPN the load is connected above the collector, between the supply and C; for a PNP it is connected below the collector, between C and ground.
Figure 5.2.4. NPN low-side switch (left): load connects between the supply and the collector, emitter to ground. PNP high-side switch (right): emitter connects to the supply, load connects below the collector to ground.
In this course we’ll use NPN transistors as low-side switches. The circuit below is one example, and you will analyze it in Lab 3. The load \(R_{\text{heat}}\) is connected between the supply and the collector. A small resistor \(R_{\text{lim}}\text{,}\) the base-current limiting resistor, connects the GPIO pin (\(V_1\)) to the base. The emitter goes to ground.
Figure 5.2.5. NPN low-side driver circuit. \(R_{\text{lim}}\) must be chosen so that base current is large enough to saturate the transistor (fully on) while staying within the GPIO pin’s safe output limit.
The key design question is: what value should \(R_{\text{lim}}\) be? The goal is to supply enough base current to push the transistor into saturation (fully on) while keeping that current within the GPIO pin’s safe limit.

Check Your Understanding 5.2.6. Choosing Rlim.

Given: a load that needs 100 mA from a 5 V supply. The NPN transistor has \(\beta_{\min} = 50\) and \(V_{BE} = 0.7\,\text{V}\text{.}\) The GPIO outputs \(V_{\text{GPIO}} = 3.3\,\text{V}\text{.}\)
Step 1, collector current: the load sets \(I_C = 100\,\text{mA}\text{.}\)
Step 2, minimum base current to saturate:
\begin{equation*} I_{B,\min} = \frac{I_C}{\beta_{\min}} = \frac{100\,\text{mA}}{50} = 2\,\text{mA} \end{equation*}
Step 3, apply a safety margin. Component tolerances and temperature variation mean the real \(\beta\) can be lower than the datasheet minimum. A factor of 2 is standard, so target \(I_B = 4\,\text{mA}\text{.}\)
Step 4, voltage across Rlim: Kirchhoff’s voltage law (KVL) around the base-emitter loop gives
\begin{equation*} V_{R_{\text{lim}}} = V_{\text{GPIO}} - V_{BE} = 3.3 - 0.7 = 2.6\,\text{V} \end{equation*}
Step 5, resistance:
\begin{equation*} R_{\text{lim}} = \frac{V_{R_{\text{lim}}}}{I_B} = \frac{2.6\,\text{V}}{4\,\text{mA}} = 650\,\Omega \end{equation*}
Choose the nearest standard value at or below this (e.g., 620 Ω or 560 Ω) to ensure the transistor stays in saturation.
For a low-side MOSFET switch, no base-current calculation is needed: the gate is purely capacitive and draws no steady current. Check two numbers in the datasheet: \(V_{th}\) must be below 3.3 V (logic-level compatible), and maximum drain current must exceed your load current. If both hold, drive the gate HIGH to switch on and LOW to switch off. No Rlim is needed.
In Lab 3 you will also build a high-side driver with a P-channel MOSFET (PFET), where the transistor is connected between the supply and the load. A PFET turns on when \(V_{GS} \lt V_{th}\text{,}\) so pulling the gate LOW with respect to the supply turns the load on. The full analysis is in the lab handout.