Electrical control of the switch is the preferred method. This can be
accomplished using a solenoid air valve. These are rather common electrical
parts composed of a solenoid (an electromagnetic switch) connected to a
valve. The Fischertechnik cie produces such a part (part no ??), roughly
compatible with Lego parts.
This part is not a three way like the Lego switch. It works the following
where the "vent in" occurs if the valve is not under current
(not connected). If the valve receive 9v electrical input, it exits the
pressure through the exit connection.
Because they are not three-way, at least 2 such valves must be used to
control a piston in or out, as in the following diagram:
The following table shows what happen when A or B or both are turned ON:
free to move
If the last condition is never used, one easy way to turn A or B on is to
use an electronic
parallel demultiplexor. Thus, only one output of the RCX can fully
control a pneumatic. In addition, no need for a sensor is required. It is
therefore the most economical solution.