Component guide · Beginner · 3 min read
Push-Pull Solenoid 12V

Stroke, Force, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A push-pull solenoid is a coil with a moving iron plunger. When powered, the plunger pulls in, and a spring returns it when power is removed; the far end can push. They are used for door latches, tapping keys, ball kickers and xylophones. Force is strongest near the end of the stroke, and coils heat up if held on too long.
Key specs at a glance
- Voltage
- 12 V DC (5 V and 24 V versions)
- Current
- About 0.5 to 1 A
- Stroke
- About 10 mm
- Force
- Several newtons, highest at short stroke
- Duty cycle
- Intermittent; check the rating
- Return
- Spring
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.
What the Push-pull solenoid is
A push-pull solenoid is an electromagnet with a sliding iron plunger. Power pulls the plunger into the coil, a spring pushes it back out, and either end can do the pushing or pulling.
Use PWM to hold: pull in at full power for 100 ms, then hold at 30 to 50 percent duty. This cuts heat a lot.
The coil causes a large spike when switched off; always add a flyback diode.
Push-pull solenoid pinout
The pins on the Push-pull solenoid and what each one does.
| Pin | Function |
|---|---|
| Lead 1 | +12 V |
| Lead 2 | Switched to ground |
- Lead 1
- +12 V
- Lead 2
- Switched to ground
Wiring the Push-pull solenoid
Connect the Push-pull solenoid like this.
| Push-pull solenoid pin | Arduino Uno | ESP32 |
|---|---|---|
| Load + | 12 V supply + | 12 V supply + |
| Load - | MOSFET module OUT- (or relay NO) | MOSFET module OUT- |
| Module signal | D7 | GPIO 26 |
| GND | GND (shared with 12 V -) | GND |
- Load +
- Arduino Uno:
- 12 V supply +
- ESP32:
- 12 V supply +
- Load -
- Arduino Uno:
- MOSFET module OUT- (or relay NO)
- ESP32:
- MOSFET module OUT-
- Module signal
- Arduino Uno:
- D7
- ESP32:
- GPIO 26
- GND
- Arduino Uno:
- GND (shared with 12 V -)
- ESP32:
- GND
Example code
A minimal sketch to check the part works.
const int SOL = 9; // PWM pin to MOSFET module
void setup() {}
void loop() {
analogWrite(SOL, 255); delay(100); // pull in
analogWrite(SOL, 90); delay(2000); // hold
analogWrite(SOL, 0); delay(2000);
}Setup and tuning
pull in at full power for about 100 ms, then hold at 30 to 50 % duty to cut heat.
always fit one across the coil; switching it off makes a large voltage spike.
keep the working stroke short, because force rises steeply near the end of travel.
keep the plunger straight in its coil to avoid friction and sticking.
check the rating; most small solenoids are for intermittent use only.
What you need
Shop this list4 of 6 found in our store · ₹1,125
Push-Pull Solenoid: the part this guide coversPush-Pull Solenoid₹399- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
MOSFET switch module (D4184 / LR7843): to switch or PWM it from a GPIOMOSFET Switch Module, Relay Replacement (D4184 / LR7843)₹39- 1N4007 diode: flyback protection across the coil or motorFind this part
SMPS power supply in metal enclosure (5/12/24 V): a 12 V supplySMPS Power Supply, Metal Enclosure (5V / 12V / 24V)₹298Closest match, check the specs
Alternatives and when to choose them
Common mistakes to avoid
- Switching it with no flyback diode.
- Holding it at full power until it overheats.
- Designing for a long stroke and expecting high force.
- Driving it from a GPIO pin.
Frequently asked questions
Does a push-pull solenoid push or pull?
Both. The plunger is pulled in when powered; the far end of the plunger pushes out at the same time.
Can I keep a solenoid on continuously?
Only at reduced PWM or if it is rated for continuous duty; otherwise the coil overheats.
Can an Arduino pin drive a solenoid?
No. It draws 0.5 to 1 A. Use a logic-level MOSFET with a flyback diode.
How much force does it give?
Force depends on stroke: it is strongest when the plunger is nearly in. Check the force curve for your model.
How can I make it quieter?
Add a rubber or felt stop where the plunger lands, and reduce holding power with PWM.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


