A sensor is applied to the wall of a container or is integrated into the wall. An alternating voltage is applied to the sensor in order to measure the level of the contents of the container, the capacitance or the electrical field produced being a measure for the fill level.