The control of pneumatic cylinders is achieved through a solenoid valve. Pneumatic solenoid valves are electrically activated to stop and start the flow of air, similar to a faucet stopping and starting the flow of water. These valves can offer more features than just "on" or "off" but we'll get into that later.
The most basic electric solenoid valve uses electricity to move a plunger in or out of an opening to stop or start the flow of air. A valve can be normally open (NO) or normally closed (NC). When closed, no air flows. When current is supplied to the solenoid, the valve opens and remains open until the current stops, then the valve closes again.
As the air flows from the compressor (or a tank of compressed air) through the valve and into the pneumatic cylinder the rod is actuated (pushed or pulled) as a result of the pressurized air. When the valve closes, the flow of air to the cylinder stops. What happens next depends on the type of valve and on the type of cylinder.
2-Port 2-Way Valve
There are many valve configurations, but the most basic is a 2-port, 2-way valve. The valve has a port "IN" and a port "OUT". Pressurized air flows from the compressor through the valve to the device being controlled. When the valve opens, air flows. When the valve closes, the air flow stops. Now here is the problem with that, if the air flow stops and the valve is closed, where does the air in the cylinder go? The answer is nowhere, it is trapped in the cylinder and air supply tube. Unless it is vented somewhere, the cylinder will remain in its "actuated" position. That is why this type of valve is used for things like air cannons where the compressed air is vented to the atmosphere.
3-Port 3-Way Valve
In order for the rod to retract when the air flow stops, the air must be able to vent to somewhere. That is where a 3-port, 3-way valve comes in. The is an "IN" port, there is an "OUT" and there is an "EXHAUST" port. When the valve goes from open to closed, the "OUT" port is switched from connecting with the "IN" port to connecting with the "EXHAUST" port. So when the valve is closed, the air can escape to the atmosphere through the exhaust port. The shortcoming with this is that cylinders rely on gravity to return to the resting position (although many cylinders have a return spring, they don't have the strength to move the prop).
4-Port 4-Way Valve
So what if you are using a Double-Acting Cylinder that needs pressure to actuate and reverse pressure to retract? You need a valve that sends air pressure in one direction when the prop is in the resting state and to switch the flow of air to to actuate the cylinder. A 4-port, 4-way valve has an "IN" port, 2 "OUT" ports that switch depending on whether current is flowing or not and then an "EXHAUST" port for the two "OUT" ports to vent to.
5-Port 4-Way Valve
What why would I need another port? Air goes in or out and it all vents, what else is there? Well, let's say you have a double-acting cylinder, and let's say your prop is moving too fast when it pops up. So fast that the prop flies right off the end of the rod. You need to slow the flow of air to reduce the speed of the pop up. If you place an in-line valve to slow the rate of flow, that will slow the pop up, but it will also slow the exhaust and the return of the prop. In order to have the prop pop up at one speed and retract at a different speed, you must be able to control the air lines individually and thus they must exhaust separately and that calls for one extra port.
So in practice, if you want something to pop up and gravity will return it to its at resting position, then a 3-port, 3-way valve will do. If you want to make something jump back and forth, then a 4-port, 4-way valve will do the trick, and if you want to precisely control the rate of movement in both directions then a 5-port, 4-way valve is required. I buy only 5-port valves because they can do all the work and so they are the most versatile. They cost a little more, but from project to project I never know what I'll need, so having the most versatile in-stock is convenient.
If you use a 5-port valve for a strict on-off application, you will actually have to plug the first "OUT" port or air will blast while it is in the resting position.
These valves usually go for about $28-$35 (in 2009). You might be able to find them on EBay for less, but make sure you are getting exactly what you need.
Valves are available in AC line voltage or various DC voltages. Whatever is most convenient for you, whether connecting to a battery, a controller or to house current, select whatever is easiest for you to use.
To learn about how to trigger the solenoid valve and how to connect the whole prop control system together, read our "Set-Up" article in the pneumatics section.