Module 4/5 · Weeks 10–12 · 27 h

Semiconductors, transistors and PWM

UAT 103 Fundamentals of Electrical and Electronics

About 90 minDraft, awaiting reviewLast updated 30 September 2026

Lesson

By the end of this module you will be able to

  1. Explain diodes and LEDs and calculate forward-voltage losses
  2. Explain the MOSFET as an electronic switch and calculate Rds(on) losses
  3. Explain pulse-width modulation (PWM) and calculate average voltage from duty cycle
  4. Explain PWM and DShot ESC control signals and the ESC's role in driving a BLDC motor
  5. Compare linear and switching voltage regulators (BECs)
  6. Compare analog and digital signals, read logic levels, and calculate ADC resolution and the Nyquist sampling rate

Prerequisites: UAT 103 Modules 1–3

The parts that make electricity “smart”

Resistors, capacitors and inductors behave in fixed ways. But a drone must adjust motor speed hundreds of times per second. What makes that possible are semiconductor devices that switch current on and off under control. This module covers diodes, MOSFETs and PWM, the heart of every ESC and power system on a drone.

Diodes and LEDs

A diode lets current flow one way. When forward-biased (positive at the anode) it conducts with a roughly constant voltage across it, the forward voltage : about 0.7 V for silicon and 0.3–0.4 V for a Schottky diode. Reverse-biased, it barely conducts.

An LED is a diode that emits light. Its is higher (about 1.8–3.3 V depending on colour) and it always needs a current-limiting resistor, as calculated in Module 1.

Example 1. A reverse-polarity diode

A Schottky diode in series with the main lead to guard against reversed battery connection, at 30 A with V:

12 W of heat in a small part is far too much. High-current circuits therefore use a MOSFET acting as an “ideal diode”, or polarised connectors that cannot be plugged in backwards.

Transistors and MOSFETs

A transistor is a switch or amplifier controlled by a small signal. Drone power circuits mostly use MOSFETs, because they are controlled by voltage at the gate, need almost no gate current and switch very fast.

With enough gate voltage, a MOSFET turns on with a very low drain–source resistance, . With low gate voltage it turns off and almost no current flows. Its conduction loss is

Example 2. Heat in an ESC MOSFET

A MOSFET with mΩ carries 30 A:

ESCs therefore need heat sinks or mounting where propeller airflow can cool them. There are also switching losses, which rise with switching frequency.

Pulse-width modulation (PWM)

To give a motor “half” voltage, there is no need to burn energy in a resistor. Instead, switch fully on for half the time and fully off for the other half, very quickly. This is PWM, and the fraction of time on is the duty cycle:

Three rows of square waves at 25, 50 and 75 percent duty cycle, with dashed lines showing the average voltage rising with duty cycle
Figure 1. Different duty cycles give different average voltages

Because a switch that is fully on or fully off wastes almost no energy, PWM is highly efficient. The motor windings, being inductors (Module 3), smooth the current naturally.

Example 3. Average voltage

A fully charged 4S battery at 16.8 V with 25% duty cycle gives an average of V.

The ESC and control signals

An ESC (Electronic Speed Controller) takes speed commands from the flight controller and switches six MOSFETs in three pairs to feed current into the three phases of a BLDC motor in sequence, creating a rotating magnetic field.

Flight controller sends PWM or DShot to an ESC with six MOSFETs, powered by the battery, driving a three-phase BLDC motor
Figure 2. The command path from flight controller through ESC to motor

Two command signals are common:

  • Servo-style PWM sends pulses 1000–2000 µs wide, repeated tens to hundreds of times per second. 1000 µs means zero throttle and 2000 µs full. ESCs using it must be calibrated to the pulse range.
  • DShot is a digital protocol that sends speed as a number with a checksum. It needs no calibration and resists noise better. It comes in several speeds such as DShot150, DShot300 and DShot600; ArduPilot’s documentation recommends DShot150 for larger aircraft with long signal leads, as the most noise-tolerant.

Example 4. Reading throttle from a pulse

A 1350 µs pulse corresponds to

Voltage regulators and BECs

The flight controller, radios and camera need a steady 5 V or 12 V, but the battery gives 14.8–25.2 V, so a step-down regulator is needed, called a BEC (Battery Eliminator Circuit). There are two main types:

  • Linear regulators drop the excess voltage as heat: .
  • Switching (buck) regulators use a MOSFET with an inductor and capacitor, often reaching about 85–95% efficiency.

Example 5. Comparing losses

Stepping 22.2 V down to 5 V at 1 A:

  • Linear: loss W, over three times the 5 W the load actually uses
  • Switching at 90% efficiency: input W, loss only about 0.56 W

High-voltage drones therefore almost always use switching BECs, but their switching noise must be kept away from video and radio systems.

Op-amp amplifiers

Many sensor signals are too small for an ADC to read with useful resolution. An amplifier scales a signal up by a set ratio, most often with an operational amplifier (op-amp). Horowitz and Hill describe two basic circuits: the non-inverting amplifier with gain , and the inverting amplifier with gain .

A familiar example is the power module that measures battery current. The current flows through a very small resistor (a shunt), producing only a few millivolts, and an amplifier raises that to fit the ADC range.

Example 6 Amplifying a current-sense signal

R_SHUNT = 0.5e-3               # 0.5 mΩ current-sense resistor
I_MAX = 60                      # A
RF, RG = 100e3, 1e3             # non-inverting amplifier
VREF, BITS = 3.3, 12            # flight controller ADC

v_shunt = I_MAX * R_SHUNT
gain = 1 + RF / RG
v_out = v_shunt * gain
lsb = VREF / 2 ** BITS
print(f"shunt voltage at {I_MAX} A: {v_shunt * 1000:.0f} mV, gain {gain:.0f}, output {v_out:.2f} V (ADC max {VREF} V)")
print(f"ADC step {lsb * 1000:.3f} mV -> current resolution {lsb / (gain * R_SHUNT) * 1000:.0f} mA")
shunt voltage at 60 A: 30 mV, gain 101, output 3.03 V (ADC max 3.3 V)
ADC step 0.806 mV -> current resolution 16 mA

A gain of 101 turns 60 A into 3.03 V, still under the ADC’s 3.3 V, and resolves current to about 16 mA. Too much gain would saturate the signal before the maximum current is reached.

Analog and digital signals

Everything that travels along a drone’s wires is a signal: an electrical quantity, usually a voltage, that changes over time to carry information. Signals fall into two broad kinds.

  • Analog signals can take any value continuously within a range, such as the voltage from the Module 2 voltage divider, which changes smoothly with battery voltage, or the shunt voltage in Example 6. They can carry unlimited detail, but any noise that gets in becomes part of the value at once and cannot be separated out.
  • Digital signals use only a few levels, most often two, standing for bits 0 and 1, such as DShot data that sends the speed as a binary number one bit at a time. Small amounts of noise do not corrupt the data, because the receiver only decides “high” or “low”, and correctness can be checked with a checksum.

A simple comparison: an analog signal is like a ramp you can stand on at any height, a digital signal like a staircase where you can only stand on the steps. A servo PWM signal sits in between: its voltage levels are digital (high or low), but the information is in the pulse width, which varies continuously like an analog value, so it needs calibration. DShot sends pure bits.

Logic levels

Digital circuits do not need exactly 0 V or 3.3 V; they define logic levels as ranges. A microcontroller datasheet gives four values:

SymbolMeaningRP2350 with 3.3 V pin supply
lowest input voltage still read as 12.0 V
highest input voltage still read as 00.8 V
lowest output voltage when sending 12.62 V
highest output voltage when sending 00.5 V

Voltages between and give no guaranteed result. The differences and are called the noise margins: the amount of noise that can be added before data is read wrongly. The maximum voltage also matters. A normal pin of a 3.3 V microcontroller accepts no more than its supply plus 0.3 V, so connecting a 5 V signal directly can damage it. Check the datasheet to see whether the pin is 5 V tolerant, or use a level-shifter circuit.

Sampling and ADC resolution

A computer reads an analog signal through an ADC (analog-to-digital converter), which works in two steps:

  1. Sampling: reading the value at regular instants, times per second
  2. Quantization: rounding each reading to the nearest of steps, where is the number of bits

One step (1 LSB) and the rounding error of an ideal ADC are

Sampling must satisfy the Nyquist criterion: the sampling rate must be more than twice the highest frequency in the signal, . If sampling is slower, a high-frequency signal shows up as a false low frequency, which is called aliasing; for it appears at . The cures are to sample fast enough and to put a low-pass filter (Module 3) before the ADC to remove frequencies above half the sampling rate.

As a real example, the ADC in the RP2350 chip is 12-bit and samples 500 000 times per second, but the maker states about 9.2 effective bits (ENOB), because internal noise uses up the lowest bits. The bit count on a datasheet is therefore not always the accuracy you actually get.

Example 7. How many ADC bits are enough to measure battery voltage?

Using the 100 kΩ and 13 kΩ voltage divider from Module 2 to measure a 22.2 V battery, compare a 10-bit and a 12-bit ADC with V:

R1, R2 = 100e3, 13e3            # voltage divider from module 2
VREF = 3.3                       # ADC reference voltage (V)
V_BATT = 22.2                    # battery voltage being measured (V)

ratio = (R1 + R2) / R2
v_pin = V_BATT / ratio
for bits in (10, 12):
    levels = 2 ** bits
    lsb = VREF / levels
    code = round(v_pin / lsb)                # an ideal ADC picks the nearest step
    v_read = code * lsb * ratio
    print(f"{bits}-bit: {levels} levels, step {lsb * 1000:.3f} mV at pin = {lsb * ratio * 1000:.1f} mV of battery")
    print(f"   pin {v_pin:.4f} V -> code {code} -> battery reads {v_read:.3f} V (error {(v_read - V_BATT) * 1000:.1f} mV)")
10-bit: 1024 levels, step 3.223 mV at pin = 28.0 mV of battery
   pin 2.5540 V -> code 793 -> battery reads 22.214 V (error 13.8 mV)
12-bit: 4096 levels, step 0.806 mV at pin = 7.0 mV of battery
   pin 2.5540 V -> code 3170 -> battery reads 22.200 V (error -0.2 mV)

The ADC outputs a whole number (the code), which software multiplies back into a voltage. The divider magnifies each ADC step by , so a 10-bit ADC resolves battery voltage in 28 mV steps and can be off by up to half a step (14 mV), while 12 bits give 7 mV steps. Both are enough for a low-battery warning, because a 6S battery’s voltage differs by several volts between full and nearly empty. Measuring the difference between cells to about 10 mV, however, needs a finer ADC or measuring each cell directly.

Example 8. Noise margin and aliasing

a. Noise margin. Two RP2350 chips on a 3.3 V supply send a digital signal to each other over a long wire.

  • High-level margin V
  • Low-level margin V

Noise above 0.3 V while a 0 is being sent may therefore be misread by the receiver. Signal wires run alongside high-current motor wires are a common cause.

b. Aliasing. A propeller at 6000 rpm, or Hz, makes the frame vibrate at 100 Hz. If acceleration is logged at 150 samples per second (assumed), below per second, the data will show a false vibration at Hz. An analyst might hunt for a 50 Hz cause that does not exist. Logging must be faster than 200 samples per second, and in practice several times faster.

Module lab

In class

  1. Measure the forward voltage of silicon and Schottky diodes and LEDs of several colours with a multimeter’s diode mode.
  2. Use a microcontroller to generate PWM driving a MOSFET and a small DC motor. Measure duty cycle on an oscilloscope and average voltage on a multimeter.
  3. Connect a servo tester to an ESC with propellers removed and view the 1000–2000 µs pulses on the oscilloscope.

Safety. Always remove propellers when testing ESCs on the bench, and use a smoke stopper at first power-up.

Common mistakes

Watch out

  • Using an ordinary diode in a high-current path, causing heat and waste.
  • Driving a MOSFET gate with too little voltage. It only partly turns on; is high and it runs very hot.
  • Using servo PWM without calibrating the ESCs. Motors may spin unevenly or not start.
  • Using a linear regulator across a large voltage difference. It gets very hot.
  • Connecting a 5 V signal straight to a 3.3 V microcontroller pin. The pin may be damaged; check whether it is 5 V tolerant or use a level shifter.
  • Sampling slower than twice the highest frequency. Aliasing puts false frequencies in the data.

Summary

  • A diode conducts one way with a forward voltage , losing .
  • A MOSFET is a voltage-controlled switch with conduction loss .
  • PWM sets the average voltage efficiently.
  • An ESC switches six MOSFETs to drive a three-phase motor, commanded by 1000–2000 µs PWM or digital DShot.
  • Switching BECs are far more efficient than linear regulators for large voltage drops.
  • Analog signals vary continuously; digital signals use logic levels with noise margins. An ADC converts analog to digital in steps of and must sample faster than twice the highest frequency.
  • Op-amps scale small signals, such as shunt voltages, to fit the ADC range with gain

Check your understanding

  1. What is one step of a 12-bit ADC with V in millivolts, and how fast must you sample to record a 400 Hz vibration?
  2. How many watts does a 3 mΩ MOSFET dissipate at 40 A?
  3. A PWM period is 50 µs and on-time 20 µs. What is the duty cycle?
  4. What throttle percentage does an 1800 µs pulse represent?
  5. A linear regulator drops 12 V to 5 V at 0.5 A. How much power does it lose?
Answers
  1. mV, and faster than samples per second
  2. W
  3. , or 40%
  4. W

Key formulas

Diode loss
MOSFET conduction loss
Duty cycle
PWM average voltage
Throttle from pulse width
Linear regulator loss
Non-inverting amplifier gain
ADC resolution
Nyquist criterion

Key references

  1. Boylestad, R. L., & Nashelsky, L. (2013). Electronic devices and circuit theory (11th ed.). Pearson.
  2. Horowitz, P., & Hill, W. (2015). The art of electronics (3rd ed.). Cambridge University Press.
  3. ArduPilot Dev Team. ESCs and motors; DShot ESCs. link
  4. Ling, S. J., Sanny, J., & Moebs, W. (2016). University physics volume 2. OpenStax. link
  5. Raspberry Pi Ltd. RP2350 datasheet. link
  6. Kester, W. Taking the mystery out of the infamous formula, "SNR = 6.02N + 1.76dB," and why you should care (Tutorial MT-001). Analog Devices. link
  7. Kester, W. What the Nyquist criterion means to your sampled data system design (Tutorial MT-002). Analog Devices. link
  8. Shannon, C. E. (1949). Communication in the presence of noise. Proceedings of the IRE, 37(1), 10–21. link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Electrical, electronics and power systems · Aircraft, structures and design