A liquid level sensor comprising: a microprocessor for controlling a condensate pump, and a sensor module (100, 200, 300, 400, 500, 600, 700) having a first sensing element (210, 330, 410, 510, 630, 710) configured to generate a low liquid level detection signal in response to a liquid reaching the first sensing element, a second sensing element (230, 340, 430, 540, 640, 740) positioned above the first sensing element and configured to generate a top liquid level detection signal in response to a liquid reaching the second sensing element, and a level sensing element (220, 320, 420, 520, 620, 720) positioned between the first and second sensing elements and configured to generate a variable liquid level signal in response to the liquid level rising across the level sensing element; wherein the first sensing element, the second sensing element and the level sensing element are electrically connected to the microprocessor, wherein the microprocessor is configured to receive the low liquid level detection signal, the top liquid level detection signal and the variable liquid level signal, wherein the microprocessor is configured to store the received variable liquid level signal in a non-volatile memory as a low liquid level reference value upon receipt of the low liquid level detection signal, wherein the microprocessor is configured to calculate an error value based on the variable liquid level signal and the reference value, wherein the microprocessor is configured to determine the operating speed of the condensate pump speed based the calculated error value, and wherein the microprocessor is configured to generate a control signal to operate the condensate pump at the determined speed. a microprocessor for controlling a condensate pump, and a sensor module (100, 200, 300, 400, 500, 600, 700) having a first sensing element (210, 330, 410, 510, 630, 710) configured to generate a low liquid level detection signal in response to a liquid reaching the first sensing element, a second sensing element (230, 340, 430, 540, 640, 740) positioned above the first sensing element and configured to generate a top liquid level detection signal in response to a liquid reaching the second sensing element, and a level sensing element (220, 320, 420, 520, 620, 720) positioned between the first and second sensing elements and configured to generate a variable liquid level signal in response to the liquid level rising across the level sensing element; wherein the first sensing element, the second sensing element and the level sensing element are electrically connected to the microprocessor, wherein the microprocessor is configured to receive the low liquid level detection signal, the top liquid level detection signal and the variable liquid level signal, wherein the microprocessor is configured to store the received variable liquid level signal in a non-volatile memory as a low liquid level reference value upon receipt of the low liquid level detection signal, wherein the microprocessor is configured to calculate an error value based on the variable liquid level signal and the reference value, wherein the microprocessor is configured to determine the operating speed of the condensate pump speed based the calculated error value, and wherein the microprocessor is configured to generate a control signal to operate the condensate pump at the determined speed.