In order to measure the level of a liquid using a pressure sensor, you must be able to subtract the pressure of the gas at the top of the tank. This is straightforward if the head of the tank is vented since the pressure will be the same as the atmospheric pressure and the pressure sensor can use a pressure reference which is vented to the atmosphere. However, the storage tank may be isolated or restricted in some way from venting to atmosphere, perhaps to prevent hazardous liquid vapor escaping. In these cases, the pressure in the top of the tank may be higher or lower than the outside air pressure and therefore the pressure sensor will need to be compensated for the gas pressure in the head of the tank.
To do this with one sensor only, the reference side of the pressure sensor should be run up the inside or the outside of the tank and terminated in the void at the top of the tank so that it is exposed to the gas. If a submersible pressure sensor is being used to measure the liquid height the cable will include a vented tube for providing an atmospheric reference. If the sensor cable is terminated in a position which will always be exposed to the gas pressure, the pressure sensor will be referenced correctly. However, it is not usual practice to terminate the electrical signal cable inside the tank even if it is clear of the liquid inside. If there is moisture present this could cause reliability problems and if the liquid contents are potentially flammable the termination would need to be made externally for safety reasons.
If a gauge pressure sensor has to be used for measuring the liquid level and it is not possible to terminate it inside the head of the tank then use a second pressure sensor for measuring the pressure in the top of the tank. Both pressure sensors have a gauge reference which is vented to the outside atmospheric pressure. If the pressure in the tank is always a positive pressure compared to atmospheric, then a standard gauge range pressure sensor can be used for measuring the gas pressure at the top of the storage tank e.g. 50 mbar gauge max. If the pressure is always below outside ambient air pressure then a suction pressure sensor will be required e.g. 0 to -50 mbar gauge. If the pressure fluctuates above and below the outside atmospheric pressure a compound range pressure sensor should be used e.g. -50 to +50 mbar gauge.
Alternatively, a differential pressure sensor can be used on the outside of the tank with the positive side of the DP sensor connected to the bottom of the tank and the negative side connected to the top of the tank. The DP sensor should be located at the lowest measurement point and a pipe run to the top connection. In order to prevent condensation running down the negative side pipe, a moisture trap or filter should be fitted so that no liquid head can build up on the negative side of the DP sensor causing a calibration offset.
It might be more practical to use two absolute pressure sensors instead of two gauge reference pressure sensors. The first higher range absolute pressure sensor would measure the total pressure at the bottom of the tank and the other lower range absolute pressure sensor would measure the total pressure in the head of the tank. Then by subtracting the two pressure readings the liquid level can be determined. The main advantage of this method is that it is not necessary to provide vented references which in some applications lead to moisture ingress damage.