Actuator drivers
Drive the actuators that are not motors on a bridge: hobby servo pulses with PCA9685 registers, ESP32/RP2040 settings and a power budget; solenoid force, peak-and-hold and heat; every flyback clamp simulated; relay, latching relay and SSR drivers; linear actuators; ERM/LRA haptics; Peltier modules; Nitinol wire; and a driver picker.
Added
Works with
- Transistor and MOSFET switches Electronicsthe BJT and MOSFET switch sums — base resistors, gate drive, losses and junction temperature — behind every driver here
- H-bridge and DC motor driver Electronicsbrushed DC motors and the bridge that reverses a linear actuator or a single-coil latching relay
- Brushless motors — inside and how they are driven Electronicsbrushless motors and their ESCs, the motors this page leaves out
- Stepper motors CNC and 3D printingstepper motors, steps per mm and driver current, the other actuator this page leaves out
- Servo and control surfaces RC planeswhat the servo then moves: arm and horn geometry, control-surface throw and the torque a surface needs
- Motion hardware CNC and 3D printinglead screws, gearboxes and servo torque at an arm for the axes these actuators move
- Microcontroller timing calculator IoT and embeddedthe general UART, timer, LEDC and I²C sums behind the servo PWM settings here
- Thermal design Electronicsheat sinks and θ chains for the Peltier hot side and hot solenoid coils
How to use it
Brushed DC motors, brushless motors and steppers have their own pages (H-bridge,
brushless motors, steppers). This one is for the rest: the
hobby servo and the PCA9685 that drives sixteen of them, solenoids and relays and what to put across
their coils, linear actuators, vibration motors, Peltier modules and Nitinol wire — and, for any of them,
which transistor to use. Values accept engineering notation (470n, 25M, 4k7); every tab
recalculates as you type and is remembered, and the share link carries all of it.
How to use it
-
Servo signal — pick a servo (or type its end points) and drag the slider: the pulse train is drawn to scale over one frame with the standard 1–2 ms and extended 0.5–2.5 ms windows shaded, the horn turns on the dial, and the table maps angle to pulse width, duty and a 12-bit count. Switch to Continuous rotation for the speed mapping with its deadband.
-
PCA9685 — the frequency, the oscillator (nominally 25 MHz) and, if you have scoped an output, the frequency you measured: you get PRE_SCALE, the frequency it really gives, the ON/OFF counts and register bytes for a pulse, the I²C write sequence byte by byte, and code for Arduino (Adafruit library), MicroPython (raw I²C) and ESPHome.
-
ESP32 / RP2040 — the LEDC resolution that fits at 50 Hz, the duty for a pulse and Arduino-ESP32 code; the RP2040/RP2350 divider, TOP and level, with MicroPython and Pico SDK code.
-
Servo power — how many servos, how many move together, their idle, moving and stall currents, the supply and its wiring: the start surge, whether the rail browns out the microcontroller, and the bulk capacitor.
-
Solenoids — the coil, the plunger and the load: the force–stroke curve at full and hold current, whether it pulls in, the peak-and-hold current trace with its PWM duty and power saving, and the coil temperature against its duty-cycle rating.
-
Flyback — a coil’s L, R and supply, and the clamp parts: a plain diode, diode + Zener, a TVS, no clamp at all (the MOSFET avalanches), and an RC snubber are simulated side by side — the current decay, the voltage on the switch, the release time and where the energy goes — with release time plotted against clamp voltage.
-
Relays & SSRs — coil drivers (NPN, MOSFET, ULN2803 with its saturation voltage against the must-operate voltage), latching relay pulse energy against an ordinary relay, and an SSR’s heat sink, turn-on delay and off-state leakage.
-
Linear actuators — a preset or the catalogue figures: speed and current against load, time and energy per stroke, and a position loop on the feedback pot with its deadband and coast.
-
Vibration motors — an ERM’s frequency, force and current; an LRA’s response and current around resonance; and the DRV2605’s effect libraries with code for an effect.
-
Peltier — the datasheet’s Imax, Vmax, ΔTmax and Qmax: the module parameters, the Qc–ΔT chart, the operating point with your heat sink (cold side, hot side, voltage, COP), the coldest current, the heat sink a target needs, and what PWM costs against smooth DC.
-
Nitinol wire — diameter, length and contraction: resistance, current, voltage, stroke, force, cooling time, the series resistor or PWM duty from your supply, and the whole Flexinol table.
-
Driver picker — the kind of actuator, the supply, steady and inrush current, logic voltage and PWM frequency: a topology, each listed MOSFET and BJT checked against the voltage, current and temperature margins, and the gate drive.
How it works
-
Servo pulses. pulse = min + angle ÷ range × (max − min). The frame is 20 ms (50 Hz) for analog servos; digital servos accept faster frames. End points vary by brand: 1–2 ms is the conservative standard, 0.5–2.5 ms what most 180° servos actually use.
-
PCA9685 (NXP datasheet, §7.3.3 and §7.3.5). PRE_SCALE = round(osc ÷ (4096 × f)) − 1, from 3 to 255 (200 Hz gives 30, the datasheet’s example). The output goes high when the 12-bit counter reaches LEDn_ON and low at LEDn_OFF, so a pulse of t seconds is round(t × f × 4096) counts after ON; bit 4 of ON_H / OFF_H is full on / full off. PRE_SCALE can only be written in SLEEP, and the chip needs 500 µs after waking before RESTART. Its oscillator is only nominally 25 MHz: from a measured output frequency fm at prescale p, the true oscillator is fm × 4096 × (p + 1).
-
ESP32 LEDC and RP2040. LEDC divides the 80 MHz APB clock by a 10.8 fixed-point divider, so at 50 Hz it needs 11–20 bits (14 at most on the S2/S3/C3/C6); duty = pulse × f × 2^bits. The RP2040 divides the system clock by 1–255 in sixteenths; the tool takes the smallest divider for which TOP ≤ 65535, the finest steps.
-
Servo power. A servo draws near its stall current for the first milliseconds of every move. The surge is the movers at stall plus the rest idling; the dip is the surge times the supply and wiring resistance; the capacitor is max(ΔI × tresponse, deficit × 10 ms) ÷ ΔV.
-
Solenoids — an approximate model. All of the magnetic circuit’s reluctance is put in the air gap (stroke + a residual gap), with no fringing and the flux density capped at saturation: B = µ0·N·I/(x + g0), F = B²·A/(2µ0), L = µ0·N²·A/(x + g0). It gives the right shape — force rising as 1/gap² and flattening once the iron saturates — not a particular solenoid’s curve. The hold current is the one that gives the load (times a margin) at the closed gap; with a freewheel diode and a PWM frequency well above R/(2πL) the current settles at D·V/R, so the hold power is D²·P. Copper’s resistance rises 0.393 %/°C; temperature is ambient + P × θ.
-
Flyback. At turn-off the coil keeps its current I0 = V/R and must lose ½LI0². With a clamp of voltage Vc (and dynamic resistance Rd) across it, L·di/dt = −(R + Rd)·i − Vc, so i(t) = (I0 + Vc/Rt)·e−t/τ − Vc/Rt, τ = L/Rt, reaching zero at τ·ln(1 + I0·Rt/Vc). The clamp takes Vc·Q (Q = ∫i dt) and the resistances the rest; the tests check that the two always add up to ½LI0² and match a numerical integration. A plain diode is Vc = Vf, diode + Zener Vz + Vf, a TVS its breakdown plus Rd·i; with no clamp the MOSFET avalanches at V(BR)DSS, the coil sees V(BR)DSS − Vs and the MOSFET absorbs V(BR)DSS·Q — the coil’s energy plus what the supply adds. The RC snubber is a series RLC loop (coil, Rs, Cs, the capacitor starting at the supply voltage) integrated with RK4, checked for energy balance. A relay releases when the current falls below its drop-out current, so a higher clamp voltage releases sooner — the trade-off plot.
-
Relays. ULN2803A saturation voltages are TI’s typical and maximum figures (0.9/1.1 V at 100 mA, 1.0/1.3 V at 200 mA, 1.2/1.6 V at 350 mA); the coil must still see its must-operate voltage.
-
Linear actuators are DC gear-motors on a lead screw: speed and current are taken as straight lines through the no-load and rated-load points. The position loop is proportional with a deadband, a first-order motor lag and the ADC’s quantisation. Presets are typical catalogue figures.
-
Vibration motors. ERM force F = m·r·ω² at the rotation frequency; an LRA’s response is 1/√(1 + Q²(f/f0 − f0/f)²) with a motional impedance added at resonance. The DRV2605 summary follows TI’s datasheet (libraries 1–5 for ERMs, 6 for LRAs; 123 ROM effects; the waveform sequencer at 0x04–0x0B and GO at 0x0C).
-
Peltier — the standard model. Qc = α·I·Tc − ½·I²·R − K·ΔT, V = α·ΔT + I·R, Qh = Qc + V·I, COP = Qc/(V·I). From the datasheet maxima at the hot-side temperature Th: α = Vmax/Th, R = Vmax(Th − ΔTmax)/(Imax·Th), K = Imax·Vmax(Th − ΔTmax)/(2·Th·ΔTmax) — which reproduces Vmax and ΔTmax exactly and predicts a Qmax about 10–15 % above the TEC1-12706 datasheet’s (real modules lose a little to contacts and ceramics). The second fit chooses α and R to hit Qmax and Vmax as well. With a heat sink, Th = Tamb + θ·Qh; with α, R and K held constant both equations are linear in Tc and Th, so the operating point is solved exactly. PWM at duty D and current I pumps D·αITc but heats D·I²R, losing ½·I²·R·D(1 − D) of cooling against smooth DC at D·I.
-
Nitinol figures are Dynalloy’s Flexinol technical data: resistance per metre, pull force at about 172 MPa, the current for roughly a one-second contraction in still air, and cooling times for the 70 °C and 90 °C alloys.
-
Driver picker. MOSFETs must stand 1.5 × the switch-off voltage and twice the inrush, be specified at the gate voltage you drive (×1.6 Rds(on) when they are only specified a little higher), and stay under 100 °C on θJA alone. Part figures are typical datasheet values — check the part you buy.
Related: transistor and MOSFET switches (the switch sums in full), H-bridge, servo and control surfaces, microcontroller timing, thermal, current sensing.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.