A sensor for measuring a thickness of a layer of a grain/residue mixture as the layer is transported through a cleaning arrangement of a combine harvester. The sensor is mounted on a support surface of a grain pan or a sieve of the cleaning arrangement and comprises a tower-shaped support structure with sensor elements attached to the structure and forming a vertical stack of sensor elements, so that a number of sensor elements is submerged in the layer and a number of sensor elements extends above the layer. The sensor elements are configured to measure an electrical property that changes as a function of immediate surroundings of the sensor elements. The sensor elements are configured to be read out independently from each other.