A thermal expansion valve or thermostatic expansion valve (often abbreviated as TEV, TXV, or TX valve) is a component in refrigeration and air conditioning systems that controls the amount of refrigerant released into the evaporator thereby keeping superheat, that is, the difference between the current refrigerant temperature at the evaporator outlet and its saturation temperature at the current pressure, at a stable value, ensuring that the only phase in which the refrigerant leaves the evaporator is vapor, and, at the same time, supplying the evaporator's coils with the optimal amount of liquid refrigerant to achieve the optimal heat exchange rate allowed by that evaporator. In addition, some thermal expansion valves are also specifically designed to ensure that a certain minimum flow of refrigerant can always flow through the system. Thermal expansion valves are often referred to generically as "metering devices" although this may also refer to any other device that releases liquid refrigerant into the low-pressure section but does not react to temperature such as a capillary tube or a pressure-controlled valve.
Flow control, or metering, of the refrigerant is accomplished by use of a temperature sensing bulb, filled with a gas or liquid charge similar to the one inside the system, that causes the orifice in the valve to open against the spring pressure in the valve body as the temperature on the bulb increases. As the suction line temperature decreases, so does the pressure in the bulb and therefore on the spring, causing the valve to close. An air conditioning system with a TX valve is often more efficient than other designs that do not use one. Also, TX valve air conditioning systems don't require an accumulator (a refrigerant tank placed downstream of the evaporator's outlet), since the valves reduce the liquid refrigerant flow when the evaporator's thermal load decreases, so that all the refrigerant completely evaporates inside the evaporator (in normal operating conditions such as a proper evaporator temperature and airflow). However, a liquid refrigerant receiver tank needs to be placed in the liquid line before the TX valve so that, in low evaporator thermal load conditions, any excess liquid refrigerant can be stored inside it, preventing any liquid from backflowing inside the condenser coil from the liquid line. At heat loads which are very low compared to the valve's ton of refrigeration rating, the orifice can become oversized for the heat load, and the valve can begin to repeatedly open and close, in an attempt to control the superheat to the set value, making the superheat oscillate. Cross charges, that is, sensing bulb charges composed of a mixture of different refrigerants or also non-refrigerant gases such as nitrogen (as opposed to a charge composed exclusively of the same refrigerant inside the system, known as a parallel charge), set so that the vapour pressure vs temperature curve of the bulb charge "crosses" the vapour pressure vs temperature curve of the system's refrigerant at a certain temperature value (that is, a bulb charge set so that, below a certain refrigerant temperature, the vapour pressure of the bulb charge suddenly becomes higher than that of the system's refrigerant, forcing the metering pin to stay into an open position), or even different kinds of bleed passages that generate a minimum refrigerant flow at all times, help to reduce the superheat hunt phenomenon by preventing the valve orifice from completely closing, at the cost, however, of determining a certain flow of refrigerant that won't reach the suction line in a fully evaporated state while the heat load is particularly low, and that the compressor must be designed to handle.
A thermal expansion valve is a key element to a heat pump; this is the cycle that makes air conditioning, or air cooling, possible. A basic refrigeration cycle consists of four major elements: a compressor, a condenser, a metering device and an evaporator. As a refrigerant passes through a circuit containing these four elements, air conditioning occurs. The cycle starts when refrigerant enters the compressor in a low-pressure, moderate-temperature, gaseous form. The refrigerant is compressed by the compressor to a high-pressure and high-temperature gaseous state. The high-pressure and high-temperature gas then enters the condenser. The condenser cools the high-pressure and high-temperature gas to a high-pressure liquid by transferring heat to a lower temperature medium, usually ambient air.
In order for the higher pressure liquid to cool down, the pressure of refrigerant entering the evaporator is reduced via the expansion valve, by restricting flow, allowing isenthalpic expansion back into the vapor phase to take place at a lower temperature. A TXV type expansion device has a sensing bulb that is connected to the suction line of the refrigerant piping so that the temperature of the refrigerant that leaves the evaporator can be sensed. The gas pressure in the sensing bulb provides the force to open the TXV, therefore dynamically adjusting the flow of refrigerant inside the evaporator and, as a result, the superheat acquired by the refrigerant that exits the evaporator. 
A low refrigerant charge condition is often accompanied, when the compressor is operational, by a loud whooshing sound heard from the thermal expansion valve and the evaporator, which is caused by the lack of a liquid head right before the valve's moving orifice, resulting in the orifice trying to meter a vapor instead of a liquid.
There are two main types of thermal expansion valves: internally or externally equalized. The difference between externally and internally equalized valves is how the evaporator pressure affects the position of the needle. In internally equalized valves, the evaporator pressure against the diaphragm is the pressure at the inlet of the evaporator, whereas in externally equalized valves, the evaporator pressure against the diaphragm is the pressure at the outlet of the evaporator. Externally equalized thermostatic expansion valves compensate for any pressure drop through the evaporator.
Internally equalized valves can be used on single circuit evaporator coils having low-pressure drop. Externally equalized valves must be used on multi-circuited evaporators with refrigerant distributors. Externally equalized TXVs can be used on all applications; however, an externally equalized TXV cannot be replaced with an internally equalized TXV. A type of externally equalized thermal expansion valve, known as the block type valve, which features an internal sensing bulb (often the valve's metal body, particularly when a stable and hunting-free refrigerant flow control is required), located inside the suction line connection and in constant contact with the refrigerant that flows out of the evaporator's outlet, is nowadays often used on automotive evaporators.
Although the bulb/diaphragm type is used in most systems that control the refrigerant superheat, electronic expansion valves are becoming more common in larger systems or systems with multiple evaporators to allow them to be adjusted independently. Although electronic valves can provide greater control range and flexibility that bulb/diaphragm types cannot provide, they add complexity and points of failure to a system as they require additional temperature & pressure sensors and an electronic control circuit. Most electronic valves use a stepper motor hermetically sealed inside the valve to actuate a needle valve with a screw mechanism, on some units only the stepper rotor is within the hermetic body and is driven through the valve body by stator coils on the outside of the device.