Sensors, Actuators, and Drivers
Sensors bring information into an embedded system. Actuators push energy back into the world. Both need more than a GPIO pin: they need correct power, signal conditioning, protection, drivers, connectors, and diagnostics.
Learning Objectives
By the end of this lesson, you should be able to classify sensor and actuator interfaces, choose basic driver circuits, size flyback protection, estimate driver power, and review fault cases such as shorts, stalls, and disconnected loads.
Interface Types
Sensors may be:
- resistive, such as NTC thermistors and potentiometers;
- voltage-output, such as analog pressure sensors;
- current-output, such as
4 mAto20 mAtransmitters; - frequency or pulse-output, such as tachometers;
- digital, such as I2C, SPI, UART, or one-wire sensors.
Actuators may be:
- LEDs and indicators;
- relays and solenoids;
- brushed DC motors;
- stepper motors;
- heaters;
- buzzers, speakers, and piezo elements.
Each class has different current, voltage, timing, protection, and thermal needs.
Driver Selection
Do not select a driver from nominal current alone. Check startup current, stall current, inductive energy, duty cycle, ambient temperature, and fault behavior.
GPIO LED Example
For an LED resistor:
$$
R = \frac{V_{SUPPLY} - V_F}{I_F}
$$
With 3.3 V supply, red LED VF = 2.0 V, and IF = 5 mA:
$$
R = \frac{3.3 - 2.0}{0.005} = 260 \Omega
$$
Use 270 Ohm or 330 Ohm. Confirm total GPIO current and package current limits, not only the single-pin limit.
Low-Side MOSFET Driver
A low-side N-MOSFET driver is common for relays, solenoids, LEDs, and small DC loads:
- load from supply to MOSFET drain;
- MOSFET source to ground;
- gate driven through a small resistor;
- gate pulldown so it stays off during reset;
- flyback diode or clamp for inductive loads.
Check MOSFET:
VDSrating above supply and transients;IDrating above load and fault current;RDS(on)at the actual gate voltage;- power dissipation and thermal resistance.
MOSFET conduction loss is:
$$
P = I^2R_{DS(on)}
$$
Temperature rise estimate:
$$
\Delta T = P\theta_{JA}
$$
Inductive Loads and Flyback
Inductors resist sudden current change. A relay coil or solenoid needs a safe path when switched off.
Stored energy is:
$$
E = \frac{1}{2}LI^2
$$
A simple diode across the coil is safe and cheap, but it slows release. A Zener clamp or TVS releases faster by allowing a higher clamp voltage. Check MOSFET voltage rating accordingly.
Motor Loads
Motor current is not fixed. Important values:
- no-load current;
- rated-load current;
- stall current;
- startup current;
- reverse and braking current;
- PWM frequency and driver switching loss.
For brushed DC motors, stall current can be estimated from winding resistance:
$$
I_{stall} = \frac{V_{SUPPLY}}{R_{winding}}
$$
Size the driver and supply for stall or add current limiting.
Sensor Excitation and Readout
Sensors need stable excitation:
- bridge sensors need quiet voltage or current excitation;
- NTC dividers need a known resistor and ADC reference strategy;
- current-loop inputs need a shunt resistor and protection;
- digital sensors need pull-ups, level shifting, and bus timing.
For a current-loop shunt:
$$
V_{shunt} = I_{loop}R_{shunt}
$$
With 20 mA and 165 Ohm, full-scale voltage is 3.3 V.
Fault and Diagnostic Planning
Design for:
- open sensor wire;
- short to ground or supply;
- actuator disconnected;
- actuator shorted;
- overtemperature;
- reverse connector insertion;
- firmware pin configured incorrectly at reset.
Diagnostics can include pull resistors, current sense resistors, ADC feedback, driver fault pins, and firmware plausibility checks.
Practical Checks
- Confirm GPIO reset state does not turn actuators on.
- Add gate pulldowns or driver enable controls.
- Verify flyback clamp polarity and voltage.
- Calculate MOSFET heat at worst-case current.
- Check connector pin current rating.
- Keep high-current actuator loops away from analog sensor traces.
- Add local bulk capacitance for pulsed loads.
Common Mistakes
- Driving a relay coil directly from a GPIO.
- Forgetting the flyback diode or TVS.
- Sizing a motor driver from running current instead of stall current.
- Ignoring MOSFET
RDS(on)at3.3 Vgate drive. - Sharing sensor ground with actuator current.
- Not defining safe output state during reset and firmware update.
Summary
Sensors and actuators turn embedded hardware into a physical system. Reliable designs classify the interface, provide correct excitation or drive, protect against faults, control reset states, budget thermal rise, and separate noisy load current from sensitive measurement paths.
Further Reading
- Texas Instruments, "Low-Side Driver and Relay Driver" application notes.
- Infineon, MOSFET gate-drive and thermal design notes.
- Analog Devices, sensor signal-conditioning application notes.
- IEC 60730 and IEC 61508 overviews for safety-related actuator control context.