Device for capacitive foam detection in liquid containers , in particular containers for reagents or sample tubes, comprising: - a sensor having a measurement electrode ; - a conductive bottom plate suitable for arranging at least one liquid container or a carrier unit having at least one receptacle for receiving a liquid container , in particular a sample tube; - a sensor electronic unit which is connected to the measurement electrode and the bottom plate and is adapted to determine an impedance, in particular a capacitance, between the measurement electrode and the bottom plate ; and - an evaluation unit (A), wherein - the measurement electrode is arranged substantially perpendicularly to the bottom plate , in particular is arranged vertically to the horizontally arranged bottom plate ; - the sensor electronic unit comprises a signal generator with which a first signal for exciting the measurement electrode at a first frequency and a second signal for exciting the measurement electrode at a second frequency can be generated; and - the evaluation unit (A) is adapted to detect, based on the impedance, in particular the capacitance, a presence of foam (S) in the liquid container if a difference between a first measurement signal in the case of exciting the measurement electrode with the first signal and a second measurement signal in the case of exciting the measurement electrode with the second signal or a ratio of the first and second measurement signals exceeds a predetermined threshold value, characterized in that the measurement electrode comprises a plurality of sub-electrodes which are arranged one above the other in vertical direction and of which in each case simultaneously a plurality can be selectively connected to the sensor electronic unit , in particular the signal generator. - a sensor having a measurement electrode ; - a conductive bottom plate suitable for arranging at least one liquid container or a carrier unit having at least one receptacle for receiving a liquid container , in particular a sample tube; - a sensor electronic unit which is connected to the measurement electrode and the bottom plate and is adapted to determine an impedance, in particular a capacitance, between the measurement electrode and the bottom plate ; and - an evaluation unit (A), - the measurement electrode is arranged substantially perpendicularly to the bottom plate , in particular is arranged vertically to the horizontally arranged bottom plate ; - the sensor electronic unit comprises a signal generator with which a first signal for exciting the measurement electrode at a first frequency and a second signal for exciting the measurement electrode at a second frequency can be generated; and - the evaluation unit (A) is adapted to detect, based on the impedance, in particular the capacitance, a presence of foam (S) in the liquid container if a difference between a first measurement signal in the case of exciting the measurement electrode with the first signal and a second measurement signal in the case of exciting the measurement electrode with the second signal or a ratio of the first and second measurement signals exceeds a predetermined threshold value, <EOS>