Learn PLCs free
Technical Guides14 min read4 973 words

How a Solenoid Valve Works: Types, Port Configs, and PLC Control

A solenoid valve explained — how the coil and plunger work, direct-acting vs pilot-operated, NO/NC, 2/3/4-way ports, and how a PLC drives the coil.

IAE
Senior PLC Programmer
15+ years hands-on experience • 50+ automation projects completed
PLC
Programming Excellence

A solenoid valve is an electromechanically operated valve that uses a magnetic coil (the solenoid) to move a metal plunger, which in turn opens or closes a fluid or gas passage. Apply voltage to the coil and the valve shifts; remove voltage and a return spring puts it back. That single, repeatable action is why solenoid valves are the dominant switching device in pneumatic, hydraulic, water, and process systems worldwide.

In PLC-controlled machines, the solenoid valve is the last link in the control chain: the controller decides, the discrete output energizes the coil, and the valve does the physical work. Understanding how the valve works internally — and how to wire and program it correctly — is a core skill for any automation engineer.

What Is a Solenoid Valve?

A solenoid valve combines two subsystems in one body:

  • The solenoid (electrical section): A wound coil of insulated wire around a ferromagnetic core. When energized, the coil becomes an electromagnet.
  • The valve body (fluid section): Machined passages, seats, seals, and a movable element (plunger, spool, or diaphragm) that routes fluid from one port to another.

The coil and valve body are mechanically coupled through the plunger. Energizing the coil moves the plunger; the plunger shifts the valve element; the valve routes flow. De-energizing the coil lets a return spring restore the valve to its rest position.

Solenoid valves are used with compressed air, nitrogen, water, steam, hydraulic oil, fuel, and many process fluids. The design of the seals, seat material, and body material varies by media and pressure, but the electromagnetic operating principle is the same across all types.


How a Solenoid Valve Works: Coil, Magnetic Field, and Plunger

The operating sequence is straightforward once you trace each energy conversion step.

Figure 1 — Coil energization and plunger movement (direct-acting)

Solenoid valve coil energization and plunger operation Cutaway diagram showing left panel (de-energized, valve closed) and right panel (energized, valve open) with coil, plunger, spring, inlet port, and outlet port labelled. DE-ENERGIZED (Closed) ENERGIZED (Open) COIL (no current) PLUNGER SEAT (SEALED) IN OUT COIL (energized) PLUNGER SEAT (OPEN) IN OUT
Figure 1 — Left: de-energized coil, spring holds plunger down, seat sealed (NO = closed). Right: energized coil, magnetic force pulls plunger up, seat opens, flow passes through.

Step-by-step operating sequence

  1. Electrical input. AC or DC voltage is applied to the coil terminals.
  2. Magnetic field. Current through the coil wire creates a magnetic flux through the ferromagnetic core and surrounding iron frame.
  3. Plunger attraction. The iron plunger (or armature) is drawn toward the core by the magnetic force, compressing the return spring.
  4. Valve element movement. The plunger is mechanically linked to the sealing element — in a direct-acting design this is the plunger itself; in a pilot-operated design the plunger opens a small pilot orifice that uses process pressure to shift a larger diaphragm or spool.
  5. Flow path opens (or closes). Fluid passes through the valve body from inlet to outlet, or is blocked, depending on the valve design.
  6. De-energization. Voltage removed; the magnetic force collapses; the spring returns the plunger and reseals the valve.

The response time from energization to full open is typically 10–100 ms for direct-acting pneumatic valves and somewhat longer for pilot-operated designs at low inlet pressures.


Direct-Acting vs Pilot-Operated Solenoid Valves

The single biggest design split in solenoid valves is how the plunger force is used. See also pneumatics basics for the wider system context.

Figure 2 — Direct-acting vs pilot-operated comparison

Direct-acting vs pilot-operated solenoid valve comparison Side-by-side comparison table diagram showing key attributes of direct-acting and pilot-operated solenoid valve types including flow path, pressure requirement, coil size, and typical use. DIRECT-ACTING PILOT-OPERATED

How it opens Min. inlet pressure Orifice / flow Coil power Typical use

Plunger directly lifts seal 0 bar (works at zero ΔP) Small (≤ DN 25 typical) Higher (must overcome seat force) Low-flow, zero-pressure starts

Pilot orifice → diaphragm/spool Typically 0.5–1.0 bar min. Large (DN 25–100+) Lower (coil just moves pilot) High-flow process lines

Figure 2 — Key differences between direct-acting and pilot-operated solenoid valves.

Direct-acting solenoid valves

In a direct-acting valve the plunger is the sealing element. The full magnetic force of the coil must overcome the seat sealing force, the spring force, and any fluid pressure acting on the closure element. This makes the coil bulkier and consumes more power, but the valve operates at zero differential pressure — even with no flow and no inlet pressure.

Use direct-acting valves when:

  • The system may start at zero pressure (tank draining, vacuum systems)
  • Flow rates are modest (small orifice diameters)
  • A fail-safe de-energized-open design is needed on a vacuum line

Pilot-operated (servo-assisted) solenoid valves

A pilot-operated valve uses the plunger to open a tiny pilot orifice. Inlet pressure then acts on a diaphragm or piston and does the heavy work of opening the main seat. The coil only needs to move the small pilot element, so it is compact and low-power even on large-bore valves.

The trade-off: the valve requires a minimum differential pressure (typically 0.5–1.0 bar) across the inlet and outlet to generate enough pilot force. At zero or balanced pressure, a pilot-operated valve will not open.

A semi-direct-acting (or assisted-lift) design bridges the gap — the plunger is physically connected to the main diaphragm and provides enough lift at zero pressure while fluid pressure assists on the power stroke. This is common in washing machine water valves and low-pressure irrigation systems.


Normally Open vs Normally Closed

Every solenoid valve has a rest state — the position it holds when the coil is de-energized. This is defined by which direction the return spring pushes the valve element. Read the normally open vs normally closed article for the full treatment; here is the summary for solenoid valves specifically.

State De-energized position Energized position Typical use
NC (Normally Closed) Passage blocked Passage open Safety shutoff, flow on demand
NO (Normally Open) Passage open Passage blocked Fail-safe open, coolant always flowing

Selection rule: Choose the valve rest state that is safe on power loss. If losing power should stop flow (fire suppression, chemical dosing, actuator lock), choose NC. If losing power should allow flow (cooling water, lubricant, emergency air exhaust), choose NO.

In PLC programs, NC and NO coil selection determines whether your ladder logic output energizes to move or de-energizes to move. A mismatch between the physical valve rest state and the programmed logic is a common commissioning fault that causes machines to behave in the opposite direction to expectation.


Port Configurations: 2-Way, 3-Way, and 4-Way (5-Way)

The number of external ports and internal flow paths defines how a solenoid valve can be plumbed. This is distinct from the direct/pilot or NO/NC question — it determines the valve's function in the circuit. This maps directly to the directional control valves described in pneumatics basics.

Figure 3 — Port configuration schematics (2/2, 3/2, 5/2)

Solenoid valve port configurations 2-way 3-way 5-way Three ISO valve symbol boxes side by side showing 2/2 normally closed, 3/2 normally closed, and 5/2 double-solenoid configurations with port labels P, A, B, R, S.

2/2 NC 2 ports, 2 positions

BLOCKED OPEN SOL P (in) A (out)

3/2 NC 3 ports, 2 positions

A→R (exhaust) P→A (pressure) SOL P A R

5/2 Double SOL 5 ports, 2 positions

P→A B→S P→B A→R SOL A SOL B P A B R S (memory / bistable)
Figure 3 — Simplified ISO valve symbols for 2/2 NC, 3/2 NC, and 5/2 double-solenoid valve configurations. P = pressure supply, A/B = actuator ports, R/S = exhaust.

2-way solenoid valve (2/2)

Two ports (in and out) and two positions (open or closed). This is the simplest type — purely an on/off shutoff valve. Common in water solenoids, gas shutoffs, and steam injection systems.

Notation: 2/2 — first digit is port count, second is position count.

3-way solenoid valve (3/2)

Three ports and two positions. In the rest state one port connects to another; energizing switches which port is connected. Typical port labeling is P (pressure supply), A (actuator port), and R or E (exhaust/vent).

A 3/2 NC valve routes P→A when energized (actuator extends) and A→R when de-energized (actuator vents to exhaust). This is the standard valve for a single-acting pneumatic cylinder or a spring-return actuator.

4-way and 5-way solenoid valves (4/2, 5/2, 5/3)

Four-way and five-way valves are directional control valves used with double-acting actuators (cylinders with two active pressure sides). In one position, P connects to A while B vents to exhaust; in the other, P connects to B while A vents. This drives the cylinder in both directions.

The difference between 4-port and 5-port variants is that the 5/2 has separate exhaust ports for each side (R and S), allowing individual exhaust flow restrictors for independent speed control on extend and retract.

5/3 valves add a third center position. Common center configurations:

  • All ports blocked — cylinder locks in place (pressure and exhaust all sealed)
  • All ports open — cylinder floats freely (all ports exhaust)
  • Pressure centered — both cylinder ports pressurized (equal force, holds position under load)

Single-solenoid vs double-solenoid

A single-solenoid valve uses one coil plus a return spring. It snaps to one end when energized and springs back when de-energized — it has a defined fail-safe state.

A double-solenoid (bistable) valve has a coil at each end. Energize SOL A and it shifts to position A and stays there — even if power is removed — until SOL B is pulsed. Double-solenoid valves hold their last state through power loss, which is useful for cylinders that must stay extended during a controlled shutdown. They require interlock logic to prevent both solenoids being energized simultaneously.


Key Specifications to Evaluate

When selecting a solenoid valve, these are the engineering parameters that matter:

Specification What it means Typical values
Cv (flow coefficient) Volume of water (GPM) that produces 1 psi ΔP 0.01 – 50+ depending on bore
Kv (metric equivalent) m³/h of water at 1 bar ΔP Cv × 0.857
Operating pressure range Min and max inlet pressure 0–10 bar typical pneumatic
Orifice diameter Internal seat bore, governs max flow 1.5 mm – 50 mm+
Response time Open/close time after coil energization 10–100 ms
Coil voltage AC or DC; rated voltage ±10% tolerance 24 VDC, 120 VAC, 230 VAC
Coil power Holding wattage (DC continuous duty) 5–20 W typical
Duty cycle % on-time the coil can sustain without overheating 100% (continuous) or ED%
IP rating Ingress protection (dust/water) IP65, IP67, IP69K
Body material Compatibility with process media Brass, stainless 316, PA nylon
Seal material Chemical and temperature compatibility NBR, EPDM, PTFE, FKM

AC vs DC coils: AC coils (50/60 Hz) have an inrush current 6–10× higher than holding current and can burn out if the plunger jams and fails to seat (AC hum/buzz is a symptom). DC coils draw constant current; they run cooler in normal operation but require proper flyback protection (see the PLC wiring section below).


Controlling a Solenoid Valve with a PLC

This is where the electrical and control disciplines meet, and it is where most commissioning problems originate. For the general sourcing/sinking output concepts, see sinking vs sourcing NPN/PNP.

Figure 4 — PLC discrete output wiring to a solenoid coil with flyback diode

PLC discrete output wiring to solenoid coil with flyback diode Wiring diagram showing 24 VDC power supply, PLC output module with sourcing transistor output, field wiring to solenoid coil, flyback diode across coil terminals, and 0V common return. 24 VDC PSU +24V 0 V PLC OUTPUT MODULE DO Ch. 0 COM (0V) +24V SOLENOID COIL + field wire 0V return Flyback diode (1N4007) SOLENOID VALVE
Figure 4 — Sourcing (PNP) 24 VDC discrete output wiring to a solenoid coil. The flyback diode (cathode toward +24V) is fitted across the coil terminals to suppress the inductive voltage spike on de-energization.

Output type and coil voltage matching

Most industrial solenoid valves in PLC-controlled systems use 24 VDC coils. Match the coil rated voltage to the PLC output supply voltage. Common configurations:

PLC output type Coil supply How it works
Sourcing (PNP) transistor 24 VDC Output switches +24V to coil; coil return to 0V common
Sinking (NPN) transistor 24 VDC Output switches 0V to coil; coil supply from +24V
Relay output AC or DC Relay contact in series with coil; use any voltage within contact rating

For AC coils (120 VAC or 230 VAC), a PLC relay output or an interposing relay driven by a 24 VDC transistor output is required. Never connect an AC coil directly to a DC transistor output.

Flyback (freewheeling) diode for DC coils

A solenoid coil is an inductor. When the PLC output switches off, the magnetic field collapses and generates a large reverse voltage spike — often hundreds of volts — across the output transistor. Without protection this destroys the output card.

Always fit a flyback diode across a DC solenoid coil. Wire the diode with:

  • Cathode (+) toward the positive supply (+24V side of the coil)
  • Anode (−) toward the negative/common (0V side of the coil)

A 1N4007 rectifier diode is adequate for most 24 VDC/1 A solenoid coils. Faster Schottky diodes (1N5819) reduce collapse time and allow faster valve cycling.

Some solenoid valve coil assemblies include an integrated suppression diode in the connector. Check the valve datasheet before adding an external diode, or you risk forward-biasing the internal device in the wrong polarity.

Snubber RC circuits are used instead for AC coils. A typical snubber is 100 Ω in series with 0.1 µF connected across the coil.

Interposing relay for high-current or high-voltage coils

If the solenoid coil draws more current than the PLC output card can source (typically >0.5–2 A depending on card type), or if the coil is an AC type and the PLC has only transistor outputs, wire an interposing relay between the PLC and the solenoid. The PLC output energizes the relay coil (low-current, 24 VDC); the relay contact switches the solenoid coil circuit at its rated current and voltage. Apply flyback protection to the relay coil, not to the solenoid coil — the relay contact itself provides isolation.

NO/NC selection in ladder logic

In ladder logic, the physical valve rest state directly influences the output logic:

  • NC solenoid valve, energize to open: Use a normally-open (XIC) contact on the output coil. The output coil is OFF at rest → valve closed → safe. The output coil ON → valve open → flow.
  • NO solenoid valve, energize to close: Use an XIC contact as well, but understand that de-energizing the output opens the valve. Document this clearly.

The goal: de-energized output = safe machine state. This minimizes unintended motion during power-up, E-stop, or communication loss.

Fault detection

Basic solenoid valve fault detection in a PLC program relies on cross-checking a feedback sensor (actuator position switch or flow sensor) against the commanded coil state:

  1. Command coil ON — start a timer (typical travel time + margin, e.g., 500 ms)
  2. If the position sensor does not confirm movement within the timer window — raise a fault alarm
  3. Latching faults require an operator reset, not automatic retry, to prevent repeated actuation against a jam

For valves without position feedback (common in pure pneumatic on/off applications), monitor coil current. An open-circuit coil reads zero current; a short or stuck-armature AC coil draws higher-than-normal current. Smart valve island fieldbus systems (IO-Link, PROFIBUS, EtherNet/IP) report coil diagnostics natively. Compare to control valve applications where valve position feedback is standard.

For hydraulic solenoid valve applications with higher pressures and flow rates, the electrical principles are the same but coil power is typically higher (20–60 W); see hydraulics explained for the full hydraulic circuit context.


Frequently Asked Questions

How does a solenoid valve work?

A solenoid valve works by passing electrical current through a coil of wire wound around a ferromagnetic core. The resulting magnetic field attracts a spring-loaded metal plunger (armature) toward the core. The plunger is mechanically linked to the valve sealing element — lifting it off its seat opens the fluid passage. When power is removed, the return spring pushes the plunger back, resealing the valve. The entire sequence happens in 10–100 ms for a typical pneumatic valve.

What is the difference between direct-acting and pilot-operated solenoid valves?

A direct-acting valve uses the plunger's magnetic force to open the main seal directly. It works at zero differential pressure but requires a larger, more powerful coil for large orifices. A pilot-operated valve uses the plunger to open a small pilot orifice; process inlet pressure then acts on a diaphragm or piston to open the main seat. This allows a small coil to control large-bore valves, but requires a minimum inlet pressure (typically 0.5–1.0 bar) to function.

How do you wire a solenoid valve to a PLC?

For a 24 VDC solenoid coil wired to a sourcing (PNP) transistor output: connect the coil positive terminal to the PLC output terminal, and the coil negative terminal to the 0 V supply common. Always fit a 1N4007 flyback diode across the coil terminals (cathode to +24V). Verify the output card current rating exceeds the coil inrush current. For AC coils, use a relay output or an interposing relay driven by the DC transistor output. See the sinking vs sourcing guide for output polarity detail.

What is a 3-way solenoid valve?

A 3-way solenoid valve has three external ports — typically labeled P (pressure supply), A (actuator/working port), and R (exhaust/vent) — and two internal flow positions. In the rest (de-energized) state, port A is connected to exhaust R, venting the downstream circuit. When energized, the valve switches so that P connects to A, pressurizing the downstream device. This makes the 3/2 valve the standard choice for controlling single-acting pneumatic cylinders and spring-return actuators.

What does NO and NC mean on a solenoid valve?

NC (Normally Closed) means the valve blocks flow when the coil is de-energized and opens when energized. NO (Normally Open) means the valve allows flow when de-energized and blocks flow when energized. The "normal" state is the rest position with no power applied. Choose NC for applications where flow should stop on power loss (safety shutoffs, chemical dosing); choose NO where flow should continue on power loss (cooling water, emergency exhaust).

Can a solenoid valve be used for hydraulics?

Yes. Hydraulic solenoid valves use the same electromagnetic operating principle but are built for much higher pressures (up to 350 bar and above) and use steel bodies with high-pressure seals. The coil voltages (12 VDC, 24 VDC, 24 VAC, 120 VAC) and wiring practices are identical to pneumatic valves, but coil power ratings are higher (often 20–60 W) and proper flyback suppression is equally critical. See hydraulics explained for hydraulic system context.


Summary

A solenoid valve is an electromagnetically actuated switch for fluid circuits. The coil creates a magnetic field that moves the plunger; the plunger opens or closes the valve seat; voltage on or off determines whether flow passes. Direct-acting designs work at zero pressure but are limited to small orifices; pilot-operated designs handle large flows at low coil power but need a minimum inlet pressure. The NO/NC rest state determines fail-safe behavior on power loss and must be matched in the PLC ladder logic. Port configuration — 2-way, 3-way, or 5-way — determines which actuator type the valve can drive.

In a PLC system the solenoid coil is driven from a discrete output card. DC coils require a flyback diode; AC coils need an RC snubber or relay isolation. Matching output type, coil voltage, and current rating, and implementing timed position-feedback fault detection, separates a robust system from a fragile one.

For the wider context of how solenoid valves fit into a compressed-air circuit, start with pneumatics basics. For the control-valve perspective on modulating (not just on/off) flow, see control valve.

#solenoidvalve#directionalvalve#pneumatics#coil#NONC#discreteoutput
Share this article:

Related Articles