Component guide · Beginner · 3 min read
Solenoids and Linear Actuators
How They Work and How to Drive Them
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A solenoid is a coil that pulls an iron plunger in when powered, giving a short, fast push or pull. A linear actuator uses a motor and lead screw to push a rod much further with more force, slowly. Both draw too much current for a microcontroller pin: switch a solenoid with a logic-level MOSFET and flyback diode, and reverse an actuator with a relay pair or H-bridge.
Key specs at a glance
- Solenoid stroke
- About 3 to 20 mm
- Solenoid current
- Often 0.3 to 2 A at 12 V; check coil resistance
- Duty cycle
- Many solenoids are rated for short pulses, not continuous on
- Linear actuator stroke
- 50 to 300 mm and more
- Actuator force
- Hundreds to thousands of newtons; speed a few to tens of mm/s
- Driver
- MOSFET + flyback diode (solenoid); H-bridge or 2 relays (actuator)
This part can carry many amps. Use wire thick enough for the current, put a fuse close to the battery, check that connectors are rated for the load and give drivers and motors room to cool. A short at these currents melts wires in seconds.
Types you will meet
| Device | What it does | Typical use |
|---|---|---|
| Push-pull solenoid | Plunger moves when powered; spring returns it | Strikers, small latches, pinball, door chimes |
| Solenoid lock | Latch retracts when powered | Cabinet and door locks (fail-secure) |
| Solenoid valve | Opens or closes a water or air path | Irrigation, coffee machines, water tanks |
| Lifting electromagnet | Holds iron when powered | Magnetic holders, sorting, door holders |
| Electric linear actuator | Motor and screw extend and retract a rod | Hatches, TV lifts, adjustable desks, solar trackers |
- Push-pull solenoid
- What it does:
- Plunger moves when powered; spring returns it
- Typical use:
- Strikers, small latches, pinball, door chimes
- Solenoid lock
- What it does:
- Latch retracts when powered
- Typical use:
- Cabinet and door locks (fail-secure)
- Solenoid valve
- What it does:
- Opens or closes a water or air path
- Typical use:
- Irrigation, coffee machines, water tanks
- Lifting electromagnet
- What it does:
- Holds iron when powered
- Typical use:
- Magnetic holders, sorting, door holders
- Electric linear actuator
- What it does:
- Motor and screw extend and retract a rod
- Typical use:
- Hatches, TV lifts, adjustable desks, solar trackers
Driving a solenoid from Arduino or ESP32
Use a logic-level N-channel MOSFET (for example IRLZ44N) as a low-side switch: solenoid between +12 V and the drain, source to ground, gate to the microcontroller pin through a 100 to 220 Ω resistor, with a 10 kΩ pull-down from gate to ground. Put a flyback diode (1N4007 or a faster 1N5819) across the solenoid, cathode to +12 V. Without it, the voltage spike when the coil switches off can destroy the MOSFET. A relay module also works for slow on/off control. See transistors and MOSFETs.
Heat and duty cycle
A solenoid draws its full current the whole time it is on, and most small ones are designed for short pulses. Holding one on for minutes can overheat the coil. If it must stay on, choose a continuous-duty solenoid, or pulse it fully on for 100 to 200 ms and then reduce power with PWM (a 'hit and hold' drive). Solenoid locks and valves sold for continuous use are labelled as such; check the datasheet.
Driving a linear actuator
A typical 12 V linear actuator is a DC motor with two wires: reverse the polarity to reverse direction. Use an H-bridge sized for its current (an actuator may draw 2 to 5 A under load, so a BTS7960 or Cytron driver suits better than an L298N), or a pair of relays wired as a reversing circuit. Most actuators have built-in limit switches that stop the motor at each end. For position control, choose an actuator with a potentiometer or Hall feedback output.
Try it: Ohm's law calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Driving a solenoid straight from a GPIO pin.
- Leaving out the flyback diode.
- Holding a pulse-rated solenoid on for minutes.
- Using a power supply too small for the inrush current.
- Picking an L298N for a 5 A actuator.
Frequently asked questions
How do I control a 12 V solenoid with Arduino?
Use a logic-level MOSFET or a relay module with a separate 12 V supply, shared ground and a flyback diode across the solenoid.
Why does my solenoid get hot?
It draws full current while on. Many small solenoids are rated for short pulses only; use hit-and-hold PWM or a continuous-duty model.
What is the difference between a solenoid and a linear actuator?
A solenoid gives a short, fast stroke from a magnetic coil. A linear actuator uses a motor and screw for a long, slow, powerful stroke.
How do I reverse a linear actuator?
Reverse the polarity of its two wires, using an H-bridge motor driver or two relays wired as a reversing circuit.
Is a solenoid lock fail-safe or fail-secure?
Most cheap cabinet solenoid locks are fail-secure: they stay locked without power and unlock while powered. Check before using one on an exit door.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 9 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Solenoid and actuator manufacturer datasheets
- Infineon IRLZ44N datasheet
- Application notes on inductive load switching
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




