Component guide · Beginner · 4 min read
Mini Solenoid Valves 12V and 24V

2-Way and 3-Way for Air, Water and Gas
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A mini solenoid valve uses an electromagnet to open or close a small air, water or gas line. A 2-way valve has an inlet and an outlet; a 3-way valve adds an exhaust, so it can fill and then vent a small cylinder or bladder. Direct-acting types open with no line pressure. Drive the coil from a MOSFET with a flyback diode.
Key specs at a glance
- Voltage
- 12 V DC or 24 V DC, as marked
- Type
- 2-way normally closed, or 3-way 2-position
- Operation
- Direct-acting: opens with no line pressure
- Port size
- 1/8 inch or 1/4 inch
- Media
- Air, water or gas as stated on the listing
- Control
- MOSFET module with a flyback diode
- Mounting
- Port threads; check the thread type of the fittings
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.
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1DC 12V 1/4'' 3-Way 2-Position Pneumatic Solenoid Valve for Compressed Air₹1,338
Option 2DC 12V Solenoid Valve 1/4'' 2-Way Normally Closed Direct-Acting for Water, Air, Gas₹689
Option 3DC 12V Solenoid Valve 1/8'' 2-Way Normally Closed Direct-Acting for Water, Air, Gas₹748
Option 4DC 24V Mini Solenoid Valve for Water, Air and Gas, Normally Closed₹406
Option 5FA0520E 12V DC 2-Position 3-Way Mini Solenoid Valve for Air and Gas₹274
What the Mini solenoid valve is
A solenoid valve is a coil around a plunger. When the coil is powered the plunger lifts and the valve opens (normally closed type) or closes (normally open type); a spring returns it when power is removed. Direct-acting valves move the seal themselves, so they work from zero up to a stated maximum pressure.
A 2-way valve just opens or shuts a line. A 3-way, 2-position valve has three ports: inlet, outlet and exhaust. In one position the inlet feeds the outlet; in the other the outlet is vented through the exhaust. That is how you inflate and then release a small pneumatic cylinder, a bladder or a gripper.
The valves here are the small 1/8 inch and 1/4 inch types: direct-acting 12 V valves for water, air and gas, a 24 V mini valve, a 12 V 1/4 inch 3-way pneumatic valve for compressed air, and the FA0520E 12 V 3-way mini valve for air and gas. Check the listing for the media and the maximum pressure of the exact valve.
Safety with gas: only use a valve with the gas stated on its listing, and never use these for fuel gas appliances unless the valve is certified for that use.
Mini solenoid valve pinout
The pins on the Mini solenoid valve and what each one does.
| Pin | Function |
|---|---|
| Coil lead 1 | +12 V or +24 V, as marked |
| Coil lead 2 | Switched to ground by the MOSFET |
| Inlet port (P) | Pressure or water in |
| Outlet port (A) | To the load |
| Exhaust port (R) | 3-way only: vents the outlet |
- Coil lead 1
- +12 V or +24 V, as marked
- Coil lead 2
- Switched to ground by the MOSFET
- Inlet port (P)
- Pressure or water in
- Outlet port (A)
- To the load
- Exhaust port (R)
- 3-way only: vents the outlet
Wiring the Mini solenoid valve
Connect the Mini solenoid valve like this.
| Mini solenoid valve pin | Arduino Uno | ESP32 |
|---|---|---|
| Coil + | Supply + (12 V or 24 V) | Supply + |
| Coil - | MOSFET module OUT- | MOSFET module OUT- |
| Diode | Across the coil, stripe to + | Across the coil, stripe to + |
| MOSFET signal | D7 | GPIO 26 |
| GND | GND shared with the supply - | GND shared with the supply - |
- Coil +
- Arduino Uno:
- Supply + (12 V or 24 V)
- ESP32:
- Supply +
- Coil -
- Arduino Uno:
- MOSFET module OUT-
- ESP32:
- MOSFET module OUT-
- Diode
- Arduino Uno:
- Across the coil, stripe to +
- ESP32:
- Across the coil, stripe to +
- MOSFET signal
- Arduino Uno:
- D7
- ESP32:
- GPIO 26
- GND
- Arduino Uno:
- GND shared with the supply -
- ESP32:
- GND shared with the supply -
Example code
The MOSFET switches the coil. A 3-way valve works the same way: HIGH connects the inlet to the outlet, LOW vents the outlet (normally closed type).
const int VALVE = 7; // use 26 on an ESP32
void setup() {
pinMode(VALVE, OUTPUT);
digitalWrite(VALVE, LOW);
}
void loop() {
digitalWrite(VALVE, HIGH); // coil on: valve opens
delay(3000);
digitalWrite(VALVE, LOW); // coil off: spring closes it
delay(10000);
}Setup and tuning
solenoid coils get warm when held on. Pulse them, or check the duty rating.
always fit one across the coil.
match the port thread of your fittings, and use thread tape on tapered threads.
dirt can hold the seat open. A small inline filter helps.
What you need
Shop this list8 of 10 found in our store · ₹4,272
DC 12V 1/4'' 3-Way 2-Position Pneumatic Solenoid Valve for Compressed Air: the part this guide coversDC 12V 1/4'' 3-Way 2-Position Pneumatic Solenoid Valve for Compressed Air₹1,338
12 V 1/4 inch direct-acting valve, normally closed: water, air or gas lineDC 12V Solenoid Valve 1/4'' 2-Way Normally Closed Direct-Acting for Water, Air, Gas₹689
12 V 1/8 inch direct-acting valve, normally closed: smaller portDC 12V Solenoid Valve 1/8'' 2-Way Normally Closed Direct-Acting for Water, Air, Gas₹748Closest match, check the specs
DC 24V Mini Solenoid Valve for Water, Air and Gas, Normally Closed: another version this guide coversDC 24V Mini Solenoid Valve for Water, Air and Gas, Normally Closed₹406
FA0520E 12 V 3-way mini valve: to fill and vent a small cylinderFA0520E 12V DC 2-Position 3-Way Mini Solenoid Valve for Air and Gas₹274Closest match, check the specs
MOSFET switch module (D4184 / LR7843): to switch the valve coil from a GPIOMOSFET Switch Module, Relay Replacement (D4184 / LR7843)₹39- 1N4007 diode: flyback protection across the coilFind this part
SMPS power supply in metal enclosure (5/12/24 V): a 12 V or 24 V supplySMPS Power Supply, Metal Enclosure (5V / 12V / 24V)₹298Closest match, check the specs- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: controller for the valveESP32-WROOM-32 38-Pin Development Board₹480
Alternatives and when to choose them
- For larger water valves, see 12V solenoid water valve.
- For pumps instead of valves, see mini submersible water pump.
- For a build, see the gravity-fed drip irrigation valve project.
Common mistakes to avoid
- No flyback diode across the coil.
- Using a pilot-type valve with no line pressure.
- Using a valve with a gas it is not rated for.
- Holding the coil on and overheating it.
- Mixing up the inlet and exhaust ports on a 3-way valve.
Frequently asked questions
Does a direct-acting valve need pressure?
No. It opens at zero pressure up to its stated maximum, so a raised tank works.
What is a 3-way valve for?
It switches an outlet between pressure and exhaust, so you can fill and then release a small cylinder or bladder.
Can I drive it straight from an Arduino pin?
No. A coil needs more current than a pin can give. Use a MOSFET module and a flyback diode.
What is normally closed?
The valve is shut with no power and opens when the coil is powered.
12 V or 24 V?
Use the supply you already have. 24 V draws less current for the same power.
Parts for this guide
Keep learning on Electrolark
- MOSFET Switch Module, Relay Replacement (D4184 / LR7843)How this part works, with a simulator
- 1N4007 Rectifier Diode (Pack of 10)How this part works, with a simulator
- SMPS Power Supply, Metal Enclosure (5V / 12V / 24V)How this part works, with a simulator
- Learn the topicFree lessons with simulators and quizzes
- Browse these partsPinouts, specs and what each part does
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
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
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


