C536 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C5 · Lesson 36 · Sandbox

Choosing parts so devices do what you want

A microcontroller pin can deliver a few milliamps at 3.3 or 5 V. That's enough for an LED, with the right resistor, but not for a motor that wants half an amp at 12 V. A transistor bridges the gap: the pin drives the base (or gate), and the transistor switches the heavy current. Getting it right means checking currents at both ends: enough base current to switch fully on, not more than the pin can give, and a diode to absorb the motor's kick (C2.8).

Play

  • A logic output (5 V) drives an NPN transistor through RB; the transistor switches a small DC motor (20 Ω, 10 mH) from 12 V, with a flyback diode across it.
  • Raise RB until the transistor stops saturating. What happens to the collector voltage, and to the power the transistor burns (VCEIC)?

Predict

The motor needs 0.6 A and the transistor's β is 200. What's the least base current that will switch it fully on?

Name it

Driver design

LED from a logic pin. R=(Vpin−VF)/IF, keeping IF within the pin's limit (often 10 to 20 mA).

BJT low-side switch. The load goes between the supply and the collector; the emitter goes to ground.

  1. Load current: IC=Vsupply/Rload (less a little for VCE,sat).
  2. Base current: at least IC/βmin, times a margin of 2 to 5.
  3. RB=(Vpin−VBE)/IB, with VBE about 0.7 to 0.9 V when saturated.
  4. Check that IB is within the pin's rating.
  5. Check the transistor's power: VCE,satIC when on, which is small. A transistor that's only half on burns far more.
  6. A flyback diode across any inductive load (motor, relay, solenoid).

MOSFET low-side switch. Gate driven straight from the pin (through a small resistor to limit ringing); choose a "logic-level" MOSFET that's fully on at the pin's voltage. No steady drive current, and a much lower drop at high currents.

Worked example

A 3.3 V logic pin drives a red LED (VF = 2.0 V) at 10 mA. What resistor?

Show the solution
  1. Resistor. R=3.3−2.00.01=130Ω
  2. Check the pin. 10 mA is within a typical pin's 10 to 20 mA limit.

Answer use 130 Ω.

Worked example

The same pin must switch a 12 V, 200 mA motor through a BJT with a forced β of 10. What base resistor, and is that wise?

Show the solution
  1. Base current. IB=200mA10=20mA
  2. Base resistor. RB=3.3−0.80.02=125Ω
  3. Is it wise. 20 mA is more than most pins should source, so a logic-level MOSFET, which needs no steady gate current, is the better switch.

Answer it needs 125 Ω, but the 20 mA of base current is more than most pins should source, so a logic-level MOSFET is the better choice.

Check

A 5 V pin drives a red LED through R1. Choose R1 to set the LED current to 10 mA.

Type values the way you would write them on a schematic: 4.7k, 100n, 10m. Then try them: the circuit runs with your values and is measured.

Check

Choose RB so the transistor fully switches on the 0.6 A motor (VCE below 0.3 V) while the 5 V pin supplies less than 5 mA.

Type values the way you would write them on a schematic: 4.7k, 100n, 10m. Then try them: the circuit runs with your values and is measured.

Check

A 5.1 V Zener regulator runs from 9 V and must hold its output above 5 V with a 20 mA load, without drawing more than 40 mA from the supply. Choose RS.

Type values the way you would write them on a schematic: 4.7k, 100n, 10m. Then try them: the circuit runs with your values and is measured.

Explain why

Why is a transistor switch driven with several times the minimum base current it needs?

Practice

Keep practicing

4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.