An electro-pneumatic reciprocating system combines electrical control with compressed air to make a pneumatic cylinder automatically move back and forth.
A typical system uses a double-acting pneumatic cylinder, a 5/2 directional control valve, two end-of-stroke sensors or limit switches, and an electrical control circuit. When the cylinder reaches one end of its stroke, the control circuit changes the state of the solenoid valve, causing the cylinder to travel in the opposite direction.
This creates a repeating sequence:
Extend – detect end of stroke – retract – detect end of stroke – extend again
Unlike a manually operated pneumatic circuit, an electro-pneumatic system can repeat this cycle automatically using relay logic or a PLC.
These circuits are particularly useful for learning how pneumatics, electrical control, limit switches, actuators, and industrial automation work together.
Watch the Step-by-Step Guide
What You Will Learn
By the end of this guide, you will understand:
- How a 5/2 solenoid valve controls a double-acting cylinder
- The difference between single-solenoid and double-solenoid valves
- How to build the pneumatic circuit
- How limit switches control reciprocating motion
- How relay logic can automate the cycle
- How the same system can be controlled using a PLC
- How to troubleshoot common reciprocating-cylinder problems
- Where this type of circuit is used in industrial automation
How Does a 5/2 Solenoid Valve Work?
A 5/2 valve is a directional control valve with:
- 5 ports
- 2 switching positions

It is commonly used to control double-acting pneumatic cylinders because it can direct compressed air to either side of the cylinder while providing separate exhaust paths.
Typical 5/2 Valve Ports
| Port | Common Label | Function |
|---|---|---|
| 1 | P | Compressed-air supply |
| 2 | A | Cylinder working port |
| 3 | R / EA | Exhaust |
| 4 | B | Cylinder working port |
| 5 | S / EB | Exhaust |
The exact port markings can vary by manufacturer, so always confirm them using the valve manufacturer’s symbol or datasheet.
How the Valve Produces Reciprocating Motion
The solenoid coil produces an electromagnetic force that shifts the valve spool. This changes the internal air passages.
In one valve position, compressed air may flow to port A while port B exhausts.
In the opposite position, compressed air is routed to port B while port A exhausts.
The result is that the cylinder can move in either direction.
For a reciprocating system, the electrical control circuit repeatedly changes the valve state whenever the cylinder reaches the end of its travel.
Single-Solenoid vs. Double-Solenoid 5/2 Valves
One of the most important decisions when designing an electro-pneumatic circuit is choosing between a single-solenoid and double-solenoid 5/2 valve.
Single-Solenoid 5/2 Valve
A single-solenoid valve normally has:
- One electrical coil
- A spring return
- One energized state
- One spring-return state
The exact cylinder response depends on the valve’s normal position.
In a common arrangement, energizing the coil moves the cylinder in one direction and removing power allows the spring to return the valve to its normal position.
This makes the single-solenoid configuration relatively simple for beginner projects.
Double-Solenoid 5/2 Valve
A double-solenoid valve has:
- Two coils
- Two electrically controlled positions
- No spring return in the basic bistable arrangement
A pulse to one coil moves the valve into one position. A pulse to the other coil changes it to the opposite position.
Because the valve can remain in its last commanded position without continuously powering a coil, the control strategy is different from a spring-return valve.
Comparison
| Feature | Single Solenoid | Double Solenoid |
|---|---|---|
| Number of coils | 1 | 2 |
| Return mechanism | Spring | Electrical switching |
| Control complexity | Lower | Higher |
| Typical control method | On/off signal | Set/reset or pulse control |
| Beginner-friendly | Yes | Requires more control logic |
| PLC applications | Simple systems | More advanced sequencing |
For a first electro-pneumatic project, a single-solenoid 5/2 valve can be easier to understand. A double-solenoid valve is useful when you need independent control of both valve states.
Components Required for an Electro-Pneumatic Reciprocating System
Before building the circuit, gather the required pneumatic and electrical components.
| Component | Purpose |
|---|---|
| Air compressor | Supplies compressed air |
| FRL unit | Filters, regulates, and optionally lubricates compressed air |
| 5/2 solenoid valve | Controls cylinder direction |
| Double-acting cylinder | Produces reciprocating movement |
| Flow control valves | Adjust cylinder speed |
| Limit switches or proximity sensors | Detect cylinder end positions |
| Relay or PLC | Provides electrical control logic |
| 24 V DC power supply | Powers control components when applicable |
| Start/Stop push buttons | Provides operator control |
| Tubing and fittings | Connects pneumatic components |
| Exhaust silencers | Reduce exhaust noise |
| Multimeter | Helps diagnose electrical faults |
| Mounting frame | Secures the components |
The actual supply pressure, coil voltage, cylinder dimensions, and component ratings must always be selected according to the manufacturer’s specifications.
Pneumatic Circuit for a Reciprocating Cylinder
The basic pneumatic circuit follows this arrangement:
Compressor – FRL – 5/2 Solenoid Valve – Double-Acting Cylinder
The two working ports of the 5/2 valve connect to the two sides of the cylinder.
Step 1: Connect the Air Supply
Connect the compressor outlet to the FRL unit.

The FRL prepares the compressed air before it reaches the directional valve.
Step 2: Connect the FRL to the 5/2 Valve
Connect the regulated air supply to port 1 (P) of the 5/2 valve.
Step 3: Connect the Cylinder
Connect:
- Valve port A to one side of the cylinder
- Valve port B to the other side of the cylinder

The exact cylinder-side connection determines which valve state corresponds to extension or retraction.
Step 4: Install Flow Controls
Install flow-control valves near the cylinder ports to control the speed of extension and retraction.
A meter-out arrangement is commonly used in pneumatic applications because it provides better control of actuator movement in many situations.
Step 5: Install Exhaust Silencers
Use suitable silencers on the exhaust ports to reduce pneumatic noise.
Step-by-Step: How to Build the Electro-Pneumatic Reciprocating System
Step 1: Mount the Components
Secure the compressor connection, FRL unit, 5/2 valve, cylinder, sensors, and electrical components on a stable frame or training panel.
A well-organized layout makes the circuit easier to inspect and troubleshoot.
Step 2: Assemble the Pneumatic Circuit
With the air supply isolated, connect:
- Compressor to FRL
- FRL to valve port 1
- Valve port A to one cylinder port
- Valve port B to the other cylinder port
- Flow controls to the cylinder ports
- Silencers to the exhaust ports
Check every fitting before applying pressure.
Step 3: Test the Valve Manually
Many pneumatic directional valves include a manual override.
Use this feature, where provided, to verify that the valve switches correctly and that the cylinder moves in both directions.
Testing the pneumatic circuit independently from the electrical control circuit makes troubleshooting much easier.
Step 4: Install the End-of-Stroke Limit Switches
Install one switch at the extended position and another at the retracted position.
These switch provide feedback to the control system.
For example:
Cylinder fully extended → Limit 1 activated → command retract
Then:
Cylinder fully retracted → Limit 2 activated → command extend
Mechanical roller limit switches can be used, while magnetic cylinder sensors or proximity sensors can provide non-contact position detection.
Step 5: Build the Electrical Control Circuit
The electrical circuit connects:

- Connect power through the first limit switch to the relay A1
Depending on the application, the control logic can be implemented using:
- Relays
- Contactors
- A PLC
Step 6: Test at Low Pressure
Start with a controlled pressure and observe one complete cycle.
Check:
- Cylinder extension
- Sensor operation
- Valve switching
- Cylinder retraction
- Sensor operation at the opposite end
Do not increase speed or pressure until the sequence works reliably.
Step 7: Adjust the Cylinder Speed
Adjust the flow-control valves until the cylinder moves smoothly.
If the cylinder is too fast, it can cause excessive mechanical shock and unreliable sensor operation.
If it is too slow, the machine may operate inefficiently.
How to Wire a 5/2 Solenoid Valve for Reciprocating Motion
The electrical control method depends on the type of 5/2 valve.
Option 1: Relay Control With a Single-Solenoid Valve
A simple relay-based system can use a seal-in or latching circuit to maintain the operating state after the Start button is released.
A typical sequence is:
- Press Start.
- Control relay energizes.
- Relay contact maintains the circuit.
- Solenoid coil energizes.
- Cylinder moves toward one end.
- End-of-stroke sensor changes the control state.
- Valve returns or changes state.
- Cylinder moves in the opposite direction.
- The second sensor repeats the sequence.
The exact relay arrangement depends on the valve configuration and whether the control circuit must continuously energize the coil.
Option 2: Double-Solenoid Valve With Interlocking Logic
A double-solenoid valve requires careful control because both coils must not be energized simultaneously.
A common strategy is:
Extend command → energize extend coil
Retract command → energize retract coil
Electrical interlocking can be added so that the control circuit prevents both outputs from being energized at the same time.

This can be implemented using relay contacts or PLC logic.
PLC Control of an Electro-Pneumatic Reciprocating System
A PLC makes the circuit easier to expand and modify.
A typical PLC arrangement could include:
Inputs
- Start push button
- Stop push button
- Extend limit switch
- Retract limit switch
- Emergency-stop status
Outputs
- Solenoid output for extend
- Solenoid output for retract
- Status indicator
The logic can be programmed using ladder logic.
A simplified sequence is:
START
↓
Cylinder extends
↓
Extend sensor ON
↓
Cylinder retracts
↓
Retract sensor ON
↓
Cylinder extends
↓
Repeat
A PLC also allows you to add:
- Timers
- Counters
- Cycle limits
- HMI controls
- Fault alarms
- Automatic/manual modes
- Production counters
- Additional pneumatic stations
This is where the circuit becomes especially relevant to industrial automation and PLC programming.
Safety Considerations
Pneumatic systems can store significant amounts of energy. Do not treat a training circuit as harmless simply because the components are small.
Before operating the system:
- Check the rated pressure of the cylinder and valve.
- Never exceed component ratings.
- Depressurize the system before servicing pneumatic tubing.
- Isolate electrical power before working on wiring.
- Keep hands away from the cylinder’s moving path.
- Install an emergency-stop arrangement appropriate to the machine.
- Verify the solenoid coil voltage before applying power.
- Secure tubing and wiring so they cannot interfere with moving parts.
- Use suitable exhaust silencers where required.
- Test the system at a controlled pressure before normal operation.
For an industrial machine, the safety system should be designed according to the machine’s risk assessment and applicable safety requirements.
Common Problems and How to Troubleshoot Them
| Problem | Possible Cause | Recommended Check |
|---|---|---|
| Cylinder does not move | No air supply | Check compressor, regulator, and pressure |
| Valve does not switch | Incorrect coil voltage or wiring | Measure voltage at the solenoid |
| Cylinder moves only one direction | Incorrect valve connections or valve fault | Check port connections and manual override |
| Cylinder moves too quickly | Excessive airflow | Reduce flow-control setting |
| Cylinder moves too slowly | Restricted airflow or low pressure | Check pressure, tubing, and flow controls |
| Reciprocation does not repeat | Sensor not detecting end position | Check sensor position and wiring |
| Cylinder stops prematurely | Sensor positioned incorrectly | Reposition the limit switch or proximity sensor |
| Both coils activate | Missing electrical interlock | Check PLC or relay logic |
| Solenoid coil overheats | Incorrect voltage or duty condition | Check coil rating and control method |
| Pneumatic system is noisy | Excessive exhaust noise | Install suitable exhaust silencers |
| Cylinder movement is jerky | Poor flow control or unstable pressure | Adjust flow controls and verify air supply |
Why the Cylinder May Fail to Reciprocate
One of the most common beginner mistakes is assuming that a pneumatic cylinder will automatically reverse direction when it reaches the end of its stroke.
It will not.
The system needs feedback and control logic.
The limit switch or proximity sensor detects the cylinder position. The electrical control circuit then changes the state of the directional valve.
That creates the closed-loop sequence:
Cylinder movement → position detection → electrical decision → valve switching → cylinder movement
This simple concept is one of the foundations of industrial automation.
Applications of Electro-Pneumatic Reciprocating Systems
The same control concept appears in many industrial machines.
Examples include:
- Conveyor pushers
- Part sorting mechanisms
- Clamping systems
- Automatic stamping machines
- Pick-and-place equipment
- Packaging machines
- Diverting mechanisms
- Cutting equipment
- Assembly fixtures
- Material handling systems
In a real production machine, the basic two-sensor reciprocating circuit can be expanded with PLCs, HMIs, additional sensors, safety systems, counters, and multiple actuators.
Relay Control vs. PLC Control
| Feature | Relay Control | PLC Control |
|---|---|---|
| Initial complexity | Lower | Higher |
| Wiring | More extensive | More compact |
| Logic changes | Requires rewiring | Software change |
| Timers/counters | Additional hardware | Built-in functions |
| HMI integration | Limited | Excellent |
| Diagnostics | More difficult | Easier |
| Expansion | Limited | Highly scalable |
| Best application | Simple machines and training | Industrial automation |
For learning electro-pneumatics, relay logic is valuable because it shows how the underlying control sequence works.
For larger automation systems, PLC control provides much greater flexibility.
Watch a Beginer-Friendly Introduction to Pneumatics
Frequently Asked Questions
What does 5/2 mean on a solenoid valve?
A 5/2 valve has five ports and two switching positions. The five ports typically include one pressure supply port, two cylinder working ports, and two exhaust ports.
What type of cylinder is used with a 5/2 valve?
A 5/2 directional control valve is commonly used with a double-acting pneumatic cylinder, where compressed air is applied alternately to either side of the piston.
Can a 5/2 valve make a cylinder reciprocate automatically?
Yes, but the valve itself does not create the complete reciprocating sequence. The system needs an electrical control method, such as limit switches with relay logic or PLC logic, to detect the end of each stroke and command the next valve position.
Can I build the system without a PLC?
Yes. A basic electro-pneumatic reciprocating system can be built using relays, push buttons, limit switches, and a solenoid valve.
A PLC becomes more useful as the machine becomes more complex.
What sensors can detect the cylinder position?
Common choices include:
- Mechanical limit switches
- Magnetic reed sensors
- Magnetic solid-state cylinder sensors
- Proximity sensors
The best option depends on the cylinder, mounting arrangement, required reliability, and control system.
What voltage should I use for the solenoid valve?
Use the voltage specified on the valve’s coil nameplate or datasheet.
Never assume that every pneumatic solenoid uses 24 V DC.
Common coil configurations include 24 V DC and various AC voltages, depending on the valve.
Why is my cylinder moving in the wrong direction?
The cylinder direction depends on how the two cylinder ports are connected to the A and B ports of the directional valve.
Swap the working-port connections only after safely depressurizing the system and verifying the valve manufacturer’s recommended configuration.
What pressure should I use?
There is no universal operating pressure for every system.
Small demonstration systems may operate comfortably within a moderate pressure range, but the correct value depends on the cylinder, valve, regulator, tubing, fittings, and application.
Always follow the manufacturer’s ratings.
What is the difference between a 4/2 and 5/2 valve?
Both can control a double-acting cylinder.
A 5/2 valve has two exhaust ports, providing separate exhaust paths for the two cylinder directions. This configuration is widely used for pneumatic actuator control.
Why does my double-solenoid valve require interlocking?
A double-solenoid valve has separate coils for its two switching commands. The control system should prevent both coils from being energized simultaneously.
In a PLC system, this is normally handled through the logic. In a relay system, electrical interlocking can be used.
Building an Electro-Pneumatic Reciprocating System
Building an electro-pneumatic reciprocating system is one of the best practical ways to understand how pneumatic power and electrical control work together.
The core system is simple:
Compressor + FRL + 5/2 solenoid valve + double-acting cylinder + position sensors + control logic
Once the basic circuit is working, the same concept can be expanded into a PLC-controlled automation system with timers, counters, HMI control, alarms, and multiple pneumatic actuators.
For anyone learning mechatronics, pneumatics, PLC programming, or industrial automation, this project provides a practical example of how an electrical control signal can command a pneumatic actuator to perform a repeatable automated sequence.
Recommended Next Step
After building the basic reciprocating circuit, the next useful project is to replace the relay logic with a PLC ladder logic program and add Start, Stop, Emergency Stop, cycle counting, and automatic/manual operating modes.
That takes the project from a simple pneumatic demonstration to a realistic industrial automation training project.
