A sample box is a series of piping, valves and fittings located on a pressure vessel or tank that is used to manually determine the height of the liquid or where the interface between oil and water resides. It is common in the upstream oil and gas industry when water is removed from the process stream during the dehydration process.
The way it works is there are several ports installed on the vessel at known elevations. These are generally 3/4" to 1" couplings, depending on the designer's preference. These are couplings so that they can be easily removed and cleaned out in the event they get plugged. For sandy service or heavy oil service, a larger connection is usually preferrable.
During operation of the vessel, an operator may want to verify the location of the oil/ water interface or may want to check the height of an oil pad. By opening the valves at the set locations, the operator can determine the level.
It should be noted that these are generally used for low pressure tanks and vessels.
Additionally, if there are poisonous gasses, such as Hydrogen Sulfide, there should be provisions (such as a fan) to blow the gasses away from the operator. The sample box will need a receptacle to collect the production fluids.