← How-Tos
electronics Sep 9, 2026 ◯ 7 min read

Solenoids and Linear Actuators for Makers: Push, Pull, Latching, and Driving Them Safely

solenoidlinear actuatorlatching solenoidflyback diodemosfet driverh-bridgeesp32arduinoelectromechanical

This site's relay guide covers switching AC and DC loads safely, and it mentions solenoids in passing as one of the inductive loads a relay might drive — but solenoids and linear actuators are worth their own guide because they're not just another switched load, they're mechanical devices with their own selection criteria, driving requirements, and failure modes. A solenoid lock on an escape-room prop, a pinball-style kicker, a pellet feeder, or a linear actuator raising a camera slider are all built around the same basic electromagnetic principle but behave very differently depending on type, duty cycle, and how you drive them.

How a Solenoid Actually Works

A solenoid is a coil of wire wound around a movable ferromagnetic plunger. Energize the coil and the resulting magnetic field pulls the plunger toward the center of the coil, converting electrical current into mechanical linear motion. That's the entire mechanism — no gears, no feedback, no fine control over speed or position. A solenoid is fundamentally a binary device: energized, it moves to one end of its travel (usually within milliseconds); de-energized, a spring (or gravity, or the load itself) returns it to the other end.

Push vs Pull vs Latching

TypeBehaviorTypical use Pull-typePlunger retracts into the coil body when energized; a spring or external force pushes it back out when power is removedDoor strikes, locks, most general-purpose solenoids Push-typePlunger extends out of the coil body when energizedKickers, pinball-style strikers, ejector mechanisms Push-pullA single coil moves the plunger in one direction; reversing coil polarity (on some designs) or a second coil moves it backApplications needing active return force rather than relying on a spring Latching (bistable)Uses a small permanent magnet so the plunger stays in its last position with zero holding current — a brief pulse of current in either direction switches stateBattery-powered locks, low-power valve control, anywhere continuous holding current isn't acceptable Rotary solenoidConverts the same electromagnetic pull into a rotational snap, typically 25-45 degrees of travelLatch releases, small index mechanisms

The distinction between latching and non-latching solenoids matters more than it looks: a standard pull-type solenoid draws its rated current continuously for as long as it needs to stay engaged, which for anything running on battery power or needing to hold a lock open for more than a few seconds is a real power budget problem. A 12V solenoid drawing 500mA continuously is a 6W constant load — fine plugged into mains, a battery killer left engaged.

Linear Actuators: When You Need More Than On/Off

A linear actuator looks similar from the outside — a rod that extends and retracts — but internally it's a completely different mechanism: a small DC gear motor turning a lead screw, moving the rod at a controlled (if slow) speed over a defined stroke length, typically 2-12 inches for hobbyist-accessible units. Unlike a solenoid's instant snap, a linear actuator takes real time to travel its full stroke (often several seconds), draws current the whole time it's moving rather than the whole time it's holding a position (a lead screw actuator is usually self-locking and holds position with zero current once the motor stops), and can be fitted with a built-in potentiometer or Hall-effect sensor for position feedback.

Choose a solenoid when you need a fast binary snap and don't care about intermediate positions — a lock, a kicker, a valve. Choose a linear actuator when you need controlled travel, an intermediate stop position, or a slow deliberate motion — a camera slider, a periscope mechanism, a motorized vent or damper.

Driving a Solenoid Safely

Solenoid coils are inductive loads, and switching an inductor off generates a voltage spike (back-EMF) that can exceed the supply voltage by a large margin and destroy a driving transistor or microcontroller pin in microseconds if unprotected. This is the same flyback problem covered in the relay guide, and the fix is identical: a flyback diode (a 1N4001-1N4007 or similar) wired backward across the solenoid coil terminals, cathode to the positive supply side, so it conducts the collapsing field's current safely instead of letting it spike back through the driver.

Driving a Linear Actuator

A linear actuator is, electrically, a DC gear motor — drive it the same way you would any brushed DC motor, through an H-bridge (an L298N, DRV8871, or similar) so you can reverse polarity to extend and retract, rather than a simple one-direction MOSFET switch. Stall current matters more here than with almost any other DC motor application: an actuator that hits the end of its mechanical travel, or an obstruction, will stall and draw several times its running current indefinitely if not stopped, which is a real fire and burnout risk on cheap actuators without internal current limiting.

Sizing and Selection Checklist

Common Problems

SymptomLikely cause Solenoid buzzes or chatters instead of snapping cleanlyInsufficient current (undersized power supply or driver, voltage drop under load) — the plunger is only partially pulling in Driver MOSFET or microcontroller pin fails after repeated cyclesMissing or incorrectly oriented flyback diode Solenoid coil gets hot / smells like burning insulationContinuous-duty use of an intermittent-duty-rated coil, or a stuck/jammed plunger holding the coil energized against resistance Linear actuator draws excessive current and stallsMechanical obstruction or reaching end-of-travel with no position feedback cutting the drive signal in time

Solenoids and linear actuators are simple devices individually, but the electrical side — inductive kickback, duty cycle limits, and stall current — is where projects go wrong. Match the mechanism (fast snap vs controlled travel) to what the project actually needs, drive it through a properly protected MOSFET or H-bridge rather than straight off a GPIO pin, and respect the duty cycle rating on the datasheet rather than the assumption that "it's just a coil, it'll be fine."