A solenoid is an electromechanical device which allows for an electrical device to control the flow of a gas or liquid. The electrical device causes a current to flow through a coil located on the solenoid valve. This current flow in turn results in a magnetic field which causes the displacement of a metal actuator.
The actuator is mechanically linked to a mechanical valve inside the solenoid valve. The valve then changes state, either opening or closing to allow a liquid or gas to either flow through or be blocked by valve. A spring is used to return the actuator and valve back to their resting state when the current flow is removed.
These devices come in various configurations and sizes. Solenoid valves can be normally open, normally closed, or a two way valve. A normally open one allows a liquid or gas to flow through unless a current is applied. A normally closed valve works in the opposite manner. A two way version has three ports; one port is common, one is normally open and the third is normally closed.
Factory automation makes frequent use of solenoid valves. A computer device running a factory automation program to fill a container with some liquid can send a signal to the solenoid valve to open, allowing the container to fill, and then remove the signal to close valve and stop the flow of liquid until the next container is in place. A gripper for grasping items on a robot is frequently an air controlled device. A solenoid valve can be used to allow air pressure to close the gripper, and a second valve can be used to open the gripper. If a two way valve is used, two separate valves are not needed in this application.