← All course materialsLecture 04 · Motor control & field-effect transistorsReading notes →

Lecture 04: Field-Effect Transistors and Motor Control

1 / 33
PHYS 351 · Lecture 0401

Lecture 04

Field-Effect Transistors and Motor Control

Part 1 · PN junction to MOSFET · Part 2 · inside the enhancement N-channel MOSFET · Part 3 · switching a motor · Part 4 · PWM and RPM

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0402

Rewind: a PN junction builds its own barrier

A PN junction: P-type silicon with mobile holes on the left, N-type with mobile electrons on the right, and between them a depletion region holding only fixed negative and positive ions. The built-in field points from N to P; the barrier is about 0.7 V in silicon.

Boron leaves holes, phosphorus leaves free electrons. Where they meet, carriers recombine and leave fixed ions behind, whose field stops further flow.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0403

A diode conducts one way

Forward bias (P to the battery's positive terminal) thins the depletion region and current flows; reverse bias widens it and only leakage flows. The diode I–V curve stays near zero in reverse and rises steeply near 0.7 V forward.

Forward bias pushes carriers into the barrier until it collapses near 0.7 V. Reverse bias pulls them out: the barrier widens and only leakage flows.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0404

A BJT: a small base current steers a large one

NPN transistor: electrons injected from the heavily doped N+ emitter cross the thin P base to the N collector, a few leaving as base current. The symbol shows I_C = beta I_B and I_E = I_C + I_B; a 1 A load at beta 100 needs 10 mA of base current continuously.

Base–emitter forward biased, base–collector reverse biased. The base current must flow for as long as the transistor is on.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0405

A FET is controlled by a field, not a current

FET family tree: JFETs are depletion mode, N- or P-channel; MOSFETs are depletion mode (N-channel) or enhancement mode (N- or P-channel). Each leaf shows its circuit symbol. The enhancement N-channel MOSFET, the IRL510, is highlighted.

Drain and source are the two ends of the channel. The gate voltage VGSV_{GS} sets how well it conducts. Lab 4 uses the highlighted one.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0406

JFET: a reverse-biased gate pinches the channel

N-channel JFET cross-sections. At V_GS = 0 the depletion regions around the P gates are thin and the channel is wide; at V_GS = -2 V they are wider and the channel narrow. The transfer curve shows maximum current I_DSS at 0 V falling to zero at pinch-off.

Normally on. The gate is a PN junction that must stay reverse biased; more negative VGSV_{GS} widens the depletion until the channel closes.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0407

MOSFET: the gate sits on glass

Left: MOSFET cross-section showing the metal gate on an oxide layer over p-type silicon between two n+ regions; the insulated gate draws no DC current. Right: drain current against V_GS for a depletion-mode device, which conducts at 0 V, and an enhancement-mode device, which is off until V_th.

A thin oxide insulates the gate, so it is a capacitor, not a diode. Depletion mode conducts at 0 V; enhancement mode waits for VGS>VthV_{GS}>V_{th}.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0408

Part 2 · Inside an enhancement N-channel MOSFET

Enhancement N-channel MOSFET cross-section: n+ source and drain islands in a p-type substrate with mobile holes, a metal gate on SiO2 oxide between them, and the body wired to the source.

Two n+ islands in p-type silicon.

Gate: metal on a thin SiO₂ layer.

Body tied to source.

Nothing yet connects the islands.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0409

Gate at 0 V: two diodes back to back

The MOSFET at V_GS = 0: the p substrate forms a PN junction with each n+ island, drawn as two diodes back to back, so one is always reverse biased and no current can flow from drain to source.

Whatever the sign of VDSV_{DS}, one of the two junctions blocks. The device is normally off.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0410

A small gate voltage pushes the holes away

The MOSFET with a gate voltage below threshold: positive charge on the gate pushes holes away from the surface, leaving a depletion layer of fixed negative ions under the gate. There are still no free carriers between source and drain.

The positive gate repels holes and leaves fixed negative boron ions. There are still no free carriers between the islands.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0411

Above threshold, an electron channel forms

The MOSFET above threshold: the gate's positive charge draws a thin layer of electrons to the surface under the oxide, forming an n-type channel that joins source and drain; electrons flow from source to drain.

Past VthV_{th} the gate pulls enough electrons to the surface to invert it to n-type. IRL510: VGS(th)V_{GS(th)} = 1–2 V.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0412

The gate is a capacitor

The MOS gate as a capacitor: positive charge on the gate metal, the oxide as dielectric, and an equal negative charge of channel electrons below. Seen from the pin it is a capacitance C_iss of about 250 pF from gate to source; steady gate leakage is at most 100 nA.

Gate charge = channel charge: more VGSV_{GS}, more electrons, lower resistance. Holding a voltage costs no current; changing it does.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0413

Threshold is where it starts, not where it is fully on

IRL510 datasheet Figure 3, typical transfer characteristics: drain current on a logarithmic scale against V_GS from 2 to 5 V at V_DS = 50 V, 20 microsecond pulses, for 25 and 175 degrees C. Near 3.3 V the drain current is about 2 A.
IRL510 datasheet, Fig. 3

VGS(th)V_{GS(th)} = 1.0–2.0 V, defined at only IDI_D = 250 µA.

Current rises steeply above it.

At 3.3 V: about 2 A (typical, 25 °C, pulsed).

Enough for a small motor, but not a guarantee.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0414

More gate voltage, lower resistance

Sketch of IRL510 on-resistance against gate voltage, R = 1/[k(V_GS - V_t)], passing through the datasheet maxima of 0.76 ohm at 4 V and 0.54 ohm at 5 V. The threshold band is 1 to 2 V. At the Pi's 3.3 V the model gives about 1.1 ohm, a value the datasheet does not specify.

Guaranteed only at 4 V and 5 V. At 3.3 V it is higher and unspecified: measure VDSV_{DS} and IDI_D on the bench.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0415

Raise the drain voltage and the channel pinches

Three MOSFET cross-sections as V_DS increases: at small V_DS the channel is even and acts as a resistor; at V_DS = V_GS - V_th it tapers to nothing at the drain end; at larger V_DS the pinch point moves toward the source and the current saturates.

The drain end sees only VGS−VDSV_{GS}-V_{DS}; when that falls to VthV_{th}, the channel pinches.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0416

Ohmic region for switches, saturation for amplifiers

Square-law sketch of drain current against V_DS for gate voltages of 2.5, 3.3, 4 and 5 V, with the ohmic region shaded left of the pinch-off boundary. A load line for a 5 V supply and 1.25 ohm load crosses the 5 V curve in the ohmic region (ON) and the 3.3 V curve in saturation, where V_DS is large and the device heats. OFF is at 5 V and zero current.

Vov=VGS−VthV_{ov}=V_{GS}-V_{th}

Ohmic:

ID≈k VovVDSI_D\approx k\,V_{ov}V_{DS}

Saturation:

ID=k2 Vov2I_D=\tfrac{k}{2}\,V_{ov}^2

A switch lives at ON or OFF.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0417

The IRL510: pinout

IRL510 in a TO-220 package seen from the printed face with legs down: pin 1 gate, pin 2 drain, pin 3 source; the metal tab is the drain. Beside it the N-channel MOSFET symbol with its body diode, labeled with the same pins.

Printed face towards you, legs down: G, D, S. The metal tab is the drain, so keep it off other conductors.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0418

The datasheet numbers that matter

IRL510 datasheet page 1: the TO-220AB package with leads G, D, S and the N-channel MOSFET symbol with its body diode.
Vishay IRL510, page 1
VDSV_{DS} max100 V
VGSV_{GS} max±10 V
VGS(th)V_{GS(th)}1.0–2.0 V
RDS(on)R_{DS(on)}≤ 0.54 Ω at 5 V, ≤ 0.76 Ω at 4 V
IDI_D5.6 A (case at 25 °C)
CissC_{iss}, IGSSI_{GSS}250 pF, ≤ 100 nA
Gate charge QgQ_g≤ 6.1 nC to 5 V
Rise, fall47 ns, 18 ns (typical)
No heatsink62 °C per watt
© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0419

Part 3 · The MOSFET as a switch

Three models of a low-side MOSFET under a load on 5 V. OFF at V_GS = 0: an open switch, no current, no power. ON at V_GS = 5 V: a resistor of at most 0.54 ohm, 0.14 W at 0.5 A. Half on near threshold: a current limiter dropping 2.5 V at 0.5 A, 1.25 W.

Fully on or fully off, it wastes almost nothing. Half on, it burns the difference: 1.25 W × 62 °C/W ≈ 78 °C rise with no heatsink.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0420

Why not drive the motor from the pin?

Currents on a logarithmic scale: IRL510 steady gate leakage 100 nA, GPIO pin rating 16 mA, all GPIO pins together 50 mA, a small DC motor running about 400 mA, a 5 V, 2.5 ohm motor at stall 2 A, and the IRL510 continuous rating 5.6 A. A line marks what a pin may supply.

At stall, 5 V/2.5 Ω=25\,\mathrm{V}/2.5\,\Omega=2 A: 125 times a pin's 16 mA. The gate needs almost nothing. Measure your motor's winding resistance.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0421

The Pi sends the signal; the supply sends the power

Low-side motor drive: a +5 V bench supply feeds the motor, with a flyback diode across it, into the MOSFET drain; the source goes to a common ground bus shared with the Pi. BCM 12 drives the gate through 470 ohm, with a 10 kilohm pull-down. The power path (amps, 5 V) and signal path (milliamps only at edges, 3.3 V) are highlighted separately.

The two paths meet only at the gate and at one shared ground. Without that ground, VGSV_{GS} is undefined.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0422

Put the switch on the low side

Low side: motor between +5 V and the drain, source grounded, so V_GS equals the full 3.3 V. High side: MOSFET between +5 V and the motor; as it turns on the source rises until V_GS is about V_th, so the gate drive collapses and it needs a P-channel device or a gate driver.

VGSV_{GS} is measured from the source. Grounded source: the pin's 3.3 V is all gate drive.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0423

Two resistors on the gate

Gate network: GPIO through a 470 ohm gate resistor to the gate capacitance, with a 10 kilohm pull-down to ground that holds the gate at 0 V when the pin is undriven. Plots: V_GS rises to 3.3 V with time constant R_G C_iss of about 118 ns; the gate current peaks at 7 mA and decays within half a microsecond.

470 Ω keeps the charging peak at 7 mA, inside the pin rating, and the edge still takes under a microsecond. 10 kΩ holds the gate low while the Pi boots.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0424

A motor is an inductor: add the flyback diode

Three circuits of a motor coil, switch and +5 V: ON, current flows through coil and switch; OFF without a diode, the interrupted coil current produces a drain spike; OFF with a flyback diode across the coil, the current circulates through the diode. Below, the drain voltage spikes (illustrative height) without the diode and is clamped near 5.7 V with it.

Band (cathode) to +5 V, anode to the drain. Fitted backwards, it shorts the supply.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0425

Example: an IRL510 LED driver

Simulated IRL510 low-side LED driver: a supply feeds a resistor and LED into the drain; the source is grounded, the gate receives a pulse waveform, and a gate pull-down holds it off when undriven.

5 V through 100 Ω and the LED.

Gate: 0–5 V square wave, 2 Hz.

20 kΩ pull-down.

I≈5 V−2 V100 Ω=30 mAI\approx\frac{5\,\mathrm{V}-2\,\mathrm{V}}{100\,\Omega}=30\,\mathrm{mA}

Too much for a pin, easy for the FET.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0426

Example: how much current reaches the motor?

Illustrative power-MOSFET motor driver: a motor connects between a 30 V supply and the drain, source is grounded, and a diode lies across the motor. The gate waveform is labeled 0 to 10 V.

MTP4N80E at 10 V gate: RDS(on)R_{DS(on)} = 1.95 Ω.

ID(sat)=30 V30 Ω=1 A<ID(on)=2 AI_{D(\mathrm{sat})}=\frac{30\,\mathrm{V}}{30\,\Omega}=1\,\mathrm{A}<I_{D(\mathrm{on})}=2\,\mathrm{A}

So it is ohmic, a small resistor:

ID=30 V30 Ω+1.95 Ω=0.939 AI_D=\frac{30\,\mathrm{V}}{30\,\Omega+1.95\,\Omega}=0.939\,\mathrm{A}

Heat in the FET: 0.9392×1.95=1.70.939^2\times1.95=1.7 W.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0427

Lab 4: build it in two steps

Low-side motor driver: the motor lies between positive supply and MOSFET drain, source connects to ground, and the GPIO drives the gate through a resistor with a pull-down to ground. A flyback diode across the motor is reverse-biased during normal operation.
  1. Gate to +5 V from the bench. Instructor checks, then power up: the motor runs (Task 2).

  2. Gate to BCM 12 (pin 32); pin 34 GND to supply − (Task 3).

  3. PWM the gate and vary the speed.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0428

Part 4 · Rewind: PWM from Lecture 03

Three 3.3 V PWM waveforms with equal period and duty cycles of 20, 50, and 80 percent. Their ideal average voltages are 0.66, 1.65, and 2.64 V.
D=tonT,⟨V⟩=D VhighD=\frac{t_{on}}{T},\qquad \langle V\rangle = D\,V_{high}

p = GPIO.PWM(12, f)

p.start(D), duty in percent

p.ChangeDutyCycle(D)

Software PWM: check it on the scope.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0429

PWM on the gate sets the motor's average voltage

Illustration at 60 percent duty: the gate switches between 0 and 3.3 V, the motor voltage between 0 and 5 V with an average of 3 V, and the motor current rises and falls in small ramps around a steady average because the coil smooths it.

The coil and the rotor's inertia average the pulses. Task 1: find where the Pi's PWM still gives the frequency and duty you asked for.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0430

Rewind: the light detector from Lecture 01

Photodiode equivalent circuit: photocurrent source Iph is in parallel with diode resistance rd and capacitance Cd; series resistance rs connects that parallel network to the output terminal.
Photodiode: a light-controlled current source
Transimpedance amplifier schematic. Photocurrent enters the inverting node, a feedback resistor connects output to that node, and the non-inverting input is grounded. Negative feedback holds the inverting node near zero volts.
The TIA turns that current into a voltage

Vout=−IphotoRfV_{out}=-I_{photo}R_f: block the light and the output steps. That step is a tachometer pulse.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0431

A slotted disc turns rotation into pulses

Optical tachometer: a slotted disc on the motor shaft passes between an LED and a photodiode; the photodiode feeds the transimpedance amplifier from Lab 1, whose output, a pulse each time a slot passes the beam, goes to a scope or GPIO input where the period T is measured.

NN slots give NN pulses per revolution. Count them on the scope first. A GPIO input takes only 0 to 3.3 V logic, never the ±15 V TIA output.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0432

From pulse frequency to RPM

Illustrative TIA output over 50 ms: pulses repeating every 12.5 ms, so f = 80 Hz, with a small 120 Hz ripple on the baseline from room lighting.

RPM=60f/N\mathrm{RPM}=60f/N. With N=2N=2 and f=80f=80 Hz: 60×80/2=240060\times80/2=2400 RPM. Assume N=1N=1 by mistake and you would report 4800.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0433

Task 4: RPM against duty

Conceptual motor speed versus PWM duty: an initial dead zone is followed by an approximately linear rise and then flattening at high duty. Actual values must be measured.

Below D0D_0: friction wins, no rotation.

Then roughly linear:

RPM≈k (D−D0)\mathrm{RPM}\approx k\,(D-D_0)

Flattens near 100 %.

Crowd points near D0D_0; sweep up and down.

© Ran Yang, Ph.D.Advanced Instrumentation

Use ← → to move, Home / End to jump, and F for fullscreen.

Figure descriptions

Slide 2 · Rewind: a PN junction builds its own barrier

A PN junction: P-type silicon with mobile holes on the left, N-type with mobile electrons on the right, and between them a depletion region holding only fixed negative and positive ions. The built-in field points from N to P; the barrier is about 0.7 V in silicon.

Slide 3 · A diode conducts one way

Forward bias (P to the battery's positive terminal) thins the depletion region and current flows; reverse bias widens it and only leakage flows. The diode I–V curve stays near zero in reverse and rises steeply near 0.7 V forward.

Slide 4 · A BJT: a small base current steers a large one

NPN transistor: electrons injected from the heavily doped N+ emitter cross the thin P base to the N collector, a few leaving as base current. The symbol shows I_C = beta I_B and I_E = I_C + I_B; a 1 A load at beta 100 needs 10 mA of base current continuously.

Slide 5 · A FET is controlled by a field, not a current

FET family tree: JFETs are depletion mode, N- or P-channel; MOSFETs are depletion mode (N-channel) or enhancement mode (N- or P-channel). Each leaf shows its circuit symbol. The enhancement N-channel MOSFET, the IRL510, is highlighted.

Slide 6 · JFET: a reverse-biased gate pinches the channel

N-channel JFET cross-sections. At V_GS = 0 the depletion regions around the P gates are thin and the channel is wide; at V_GS = -2 V they are wider and the channel narrow. The transfer curve shows maximum current I_DSS at 0 V falling to zero at pinch-off.

Slide 7 · MOSFET: the gate sits on glass

Left: MOSFET cross-section showing the metal gate on an oxide layer over p-type silicon between two n+ regions; the insulated gate draws no DC current. Right: drain current against V_GS for a depletion-mode device, which conducts at 0 V, and an enhancement-mode device, which is off until V_th.

Slide 8 · Part 2 · Inside an enhancement N-channel MOSFET

Enhancement N-channel MOSFET cross-section: n+ source and drain islands in a p-type substrate with mobile holes, a metal gate on SiO2 oxide between them, and the body wired to the source.

Slide 9 · Gate at 0 V: two diodes back to back

The MOSFET at V_GS = 0: the p substrate forms a PN junction with each n+ island, drawn as two diodes back to back, so one is always reverse biased and no current can flow from drain to source.

Slide 10 · A small gate voltage pushes the holes away

The MOSFET with a gate voltage below threshold: positive charge on the gate pushes holes away from the surface, leaving a depletion layer of fixed negative ions under the gate. There are still no free carriers between source and drain.

Slide 11 · Above threshold, an electron channel forms

The MOSFET above threshold: the gate's positive charge draws a thin layer of electrons to the surface under the oxide, forming an n-type channel that joins source and drain; electrons flow from source to drain.

Slide 12 · The gate is a capacitor

The MOS gate as a capacitor: positive charge on the gate metal, the oxide as dielectric, and an equal negative charge of channel electrons below. Seen from the pin it is a capacitance C_iss of about 250 pF from gate to source; steady gate leakage is at most 100 nA.

Slide 13 · Threshold is where it starts, not where it is fully on

IRL510 datasheet Figure 3, typical transfer characteristics: drain current on a logarithmic scale against V_GS from 2 to 5 V at V_DS = 50 V, 20 microsecond pulses, for 25 and 175 degrees C. Near 3.3 V the drain current is about 2 A.

Slide 14 · More gate voltage, lower resistance

Sketch of IRL510 on-resistance against gate voltage, R = 1/[k(V_GS - V_t)], passing through the datasheet maxima of 0.76 ohm at 4 V and 0.54 ohm at 5 V. The threshold band is 1 to 2 V. At the Pi's 3.3 V the model gives about 1.1 ohm, a value the datasheet does not specify.

Slide 15 · Raise the drain voltage and the channel pinches

Three MOSFET cross-sections as V_DS increases: at small V_DS the channel is even and acts as a resistor; at V_DS = V_GS - V_th it tapers to nothing at the drain end; at larger V_DS the pinch point moves toward the source and the current saturates.

Slide 16 · Ohmic region for switches, saturation for amplifiers

Square-law sketch of drain current against V_DS for gate voltages of 2.5, 3.3, 4 and 5 V, with the ohmic region shaded left of the pinch-off boundary. A load line for a 5 V supply and 1.25 ohm load crosses the 5 V curve in the ohmic region (ON) and the 3.3 V curve in saturation, where V_DS is large and the device heats. OFF is at 5 V and zero current.

Slide 17 · The IRL510: pinout

IRL510 in a TO-220 package seen from the printed face with legs down: pin 1 gate, pin 2 drain, pin 3 source; the metal tab is the drain. Beside it the N-channel MOSFET symbol with its body diode, labeled with the same pins.

Slide 18 · The datasheet numbers that matter

IRL510 datasheet page 1: the TO-220AB package with leads G, D, S and the N-channel MOSFET symbol with its body diode.

Slide 19 · Part 3 · The MOSFET as a switch

Three models of a low-side MOSFET under a load on 5 V. OFF at V_GS = 0: an open switch, no current, no power. ON at V_GS = 5 V: a resistor of at most 0.54 ohm, 0.14 W at 0.5 A. Half on near threshold: a current limiter dropping 2.5 V at 0.5 A, 1.25 W.

Slide 20 · Why not drive the motor from the pin?

Currents on a logarithmic scale: IRL510 steady gate leakage 100 nA, GPIO pin rating 16 mA, all GPIO pins together 50 mA, a small DC motor running about 400 mA, a 5 V, 2.5 ohm motor at stall 2 A, and the IRL510 continuous rating 5.6 A. A line marks what a pin may supply.

Slide 21 · The Pi sends the signal; the supply sends the power

Low-side motor drive: a +5 V bench supply feeds the motor, with a flyback diode across it, into the MOSFET drain; the source goes to a common ground bus shared with the Pi. BCM 12 drives the gate through 470 ohm, with a 10 kilohm pull-down. The power path (amps, 5 V) and signal path (milliamps only at edges, 3.3 V) are highlighted separately.

Slide 22 · Put the switch on the low side

Low side: motor between +5 V and the drain, source grounded, so V_GS equals the full 3.3 V. High side: MOSFET between +5 V and the motor; as it turns on the source rises until V_GS is about V_th, so the gate drive collapses and it needs a P-channel device or a gate driver.

Slide 23 · Two resistors on the gate

Gate network: GPIO through a 470 ohm gate resistor to the gate capacitance, with a 10 kilohm pull-down to ground that holds the gate at 0 V when the pin is undriven. Plots: V_GS rises to 3.3 V with time constant R_G C_iss of about 118 ns; the gate current peaks at 7 mA and decays within half a microsecond.

Slide 24 · A motor is an inductor: add the flyback diode

Three circuits of a motor coil, switch and +5 V: ON, current flows through coil and switch; OFF without a diode, the interrupted coil current produces a drain spike; OFF with a flyback diode across the coil, the current circulates through the diode. Below, the drain voltage spikes (illustrative height) without the diode and is clamped near 5.7 V with it.

Slide 25 · Example: an IRL510 LED driver

Simulated IRL510 low-side LED driver: a supply feeds a resistor and LED into the drain; the source is grounded, the gate receives a pulse waveform, and a gate pull-down holds it off when undriven.

Slide 26 · Example: how much current reaches the motor?

Illustrative power-MOSFET motor driver: a motor connects between a 30 V supply and the drain, source is grounded, and a diode lies across the motor. The gate waveform is labeled 0 to 10 V.

Slide 27 · Lab 4: build it in two steps

Low-side motor driver: the motor lies between positive supply and MOSFET drain, source connects to ground, and the GPIO drives the gate through a resistor with a pull-down to ground. A flyback diode across the motor is reverse-biased during normal operation.

Slide 28 · Part 4 · Rewind: PWM from Lecture 03

Three 3.3 V PWM waveforms with equal period and duty cycles of 20, 50, and 80 percent. Their ideal average voltages are 0.66, 1.65, and 2.64 V.

Slide 29 · PWM on the gate sets the motor's average voltage

Illustration at 60 percent duty: the gate switches between 0 and 3.3 V, the motor voltage between 0 and 5 V with an average of 3 V, and the motor current rises and falls in small ramps around a steady average because the coil smooths it.

Slide 30 · Rewind: the light detector from Lecture 01

Photodiode equivalent circuit: photocurrent source Iph is in parallel with diode resistance rd and capacitance Cd; series resistance rs connects that parallel network to the output terminal.

Transimpedance amplifier schematic. Photocurrent enters the inverting node, a feedback resistor connects output to that node, and the non-inverting input is grounded. Negative feedback holds the inverting node near zero volts.

Slide 31 · A slotted disc turns rotation into pulses

Optical tachometer: a slotted disc on the motor shaft passes between an LED and a photodiode; the photodiode feeds the transimpedance amplifier from Lab 1, whose output, a pulse each time a slot passes the beam, goes to a scope or GPIO input where the period T is measured.

Slide 32 · From pulse frequency to RPM

Illustrative TIA output over 50 ms: pulses repeating every 12.5 ms, so f = 80 Hz, with a small 120 Hz ripple on the baseline from room lighting.

Slide 33 · Task 4: RPM against duty

Conceptual motor speed versus PWM duty: an initial dead zone is followed by an approximately linear rise and then flattening at high duty. Actual values must be measured.