The invention relates to a device and method for controlling the flow of a fluid through a flow channel, and particularly an expiratory valve for a breathing machine. The valve includes a flexible conduit with flexible circular segments (10, 11) compressed along the length of the conduit, when the flexible conduit is compressed, the bases of the facing valve are mutually collided and are sealingly abutted against to close the channel of the airflow. The valve provided includes a field sterilization part or a one-time part which is capable of isolating from the breathing machine system, and the valve can prevent the control part of the breathing machine system from being exposed to be contacted with the polluted surface when the control part is transferred to be used by other patients.