Capacitance level measurement