A low-voltage electronic circuit that senses upper and lower water levels is often used for alarms and sump-pump activation. Since an electronic sensor has no moving mechanical parts, it eliminates problems with corrosion and wear and tear. The sensor must have distinct cut-on and cutoff trigger levels. If it controls a sump pump, the difference between trigger levels prevents the pump from being short-cycled and possibly damaged.
Figure 1 shows the sensor setup. Two pairs of wires are mounted on a PVC pipe corresponding to water levels A and C. (These wires should be mounted with noncorrosive metal screws and ring connectors.) The pump switches on only after water rises past levels A, B, and C. As the water recedes past levels C and B, the pump will remain on. It will switch off only after the water drops below level A. Figure 2 illustrates the complete circuit.
Using a rail-to-rail op amp for U2 allows for the application of a single 5-V power supply. Op amps U2A and U2B function as comparators to control the 7474 D-type flip-flop (U1). A reference voltage of about 4 V is produced at the inverting input of the U2C and U2D op amps. When the water is below level A, the sensors are both open circuits and the outputs of the comparators are high. When water contacts both terminals of either the upper or lower sensor, a finite resistance is placed between the reference voltage and the feedback loop of either U2D or U2C, respectively. This resistance causes the output voltage of the op amps to go below the reference voltage. It also forces the comparator outputs to switch low.
By means of the 7474 flip-flop, the inputs of the two sensors receive the necessary hysteresis. As the top sensor goes low (water above level C), the CLR signal is activated and the output of the flipflop is low. This allows Q1 to turn on and activate a triac or relay for the pump.
The output of the flip-flop remains low until the bottom sensor returns high (i.e., the water level falls below level A), providing an edge trigger. Then the output of the top sensor is acquired. Since the water is below level A, this output must be high. Finally, the output of the flip-flop returns high and Q1 turns off.
Capacitor C1 is required to set the initial state of the flip-flop. Once the circuit is on, C1’s charge time lets any transients settle before activating the CLK signal and obtaining the output of the top sensor. If the circuit is being used to switch a sump pump, the triac must have a power rating that’s adequate for the pump motor.