Water level controller schematic

How to Build a Safe, Automated Water Level Controller for Well Pumps (DIY Project)

Have you ever dealt with an overflowing water tank or a dry-running well pump? Automating your water storage tank doesn’t require expensive, proprietary systems. With a few common transistors, resistors, and an old-school trick to prevent probe corrosion, you can build a highly reliable, automated water pump controller.

In this article, we’ll walk through a clever, DIY electronic water level controller circuit that automatically turns on your pump when the water drops below the low threshold and shuts it off when the tank is full. Best of all, this design solves the number one issue with DIY water sensors: probe electrolysis.

I developed this device when I was still in high school to automate my well pump. I still use it now 50 years later ;-). Surely, it broke down several time but very easy and inexpensive to repair.

The Hidden Problem with DIY Water Sensors: Electrolysis

Most simple DIY water level circuits use Direct Current (DC) to sense the water level. Running DC through metal rods submerged in water causes rapid electrolysis. Within weeks, your probes will corrode, build up a layer of non-conductive rust, and fail.

This circuit solves that problem by using low-voltage Alternating Current (AC) to sample the water level. Because AC constantly flips its electrical polarity, galvanic corrosion is completely neutralized. Your iron or stainless steel sensing bars will last for years.

The Circuit Architecture

Here is the complete, finalized circuit schematic designed in EasyEDA:

  • TR1: 220V to 12V 300mA Step-Down Isolation Transformer (Ensures total safety by isolating the water tank from mains voltage).
  • Q1: BC557 (PNP Transistor acting as the high-side relay driver).
  • Q2: BC547 (NPN Transistor acting as the main logic switch).
  • R1: 680 kΩ Pull-Up Resistor (Optimized perfectly for 20 kΩ – 30 kΩ well water resistance).
  • RL1: 12V DC Relay with changeover contacts (Pins 3, 5, and 7 handle the routing of the LOW sensor).

The circuit splits into a dual AC/DC configuration. Diode U1 and capacitor C1 (470 µF) form a half-wave rectifier to create a smooth DC rail to power our logic transistors and the relay coil. Meanwhile, raw AC voltage passes through R1 (680 kΩ) straight to the sensing lines.

Step-by-Step Circuit Operation

To truly understand how this hardware state machine creates its memory effect (hysteresis), let’s walk through a complete water cycle divided into four phases, focusing on how the relay physically steers the sensors.

Phase A: Tank is Empty (Pump Turns ON)

When the water level drops completely below the LOW probe, both the HIGH (J1) and LOW (J2) terminal blocks act as open circuits completely isolated from system ground (GND).

  1. Sensing Signal Paths: The 12V AC voltage passes through the 680 kΩ resistor (R1). Because no water is there to bleed this signal away, the full AC signal sits at the junction right before the decoupling capacitor C2.
  2. Rectification: The AC signal passes through C2 (0.1 µF) into a steering diode network (U2, U3, U4). Negative cycles are clamped to ground by U3, while positive cycles pass through U2 to charge filtering capacitor C3. This builds a steady DC voltage at the base of NPN transistor Q2.
  3. The Switching Cascade: Because Q2 receives a positive bias, it turns fully ON (saturation) and pulls its collector node hard to ground. This drop in voltage pulls the base of the PNP transistor Q1 down, turning Q1 fully ON.
  4. Relay Activation: Current floods through Q1 to energize the coil of the 12V DC Relay (RL1). This turns your water pump ON.
  5. The Mechanical Disconnect: The moment the relay coil activates, the internal switch flips. It breaks the connection between pin 3 and pin 5. This completely cuts off the LOW probe (J2) from the circuit. The circuit is now blind to the LOW probe while the tank fills.

Phase B: Water Rises Past “LOW”

As the well pump runs, water fills the tank and eventually submerges the LOW probe (J2).

  • What happens: Absolutely nothing. The pump continues to run smoothly.
  • Why it works: Because the relay is energized, the LOW probe is physically disconnected from the circuit at relay pin 5. It doesn’t matter if water touches it, splashes against it, or causes electrical noise—the circuit cannot see it, preventing the pump from stuttering.

Phase C: Water Reaches “HIGH” (Pump Turns OFF)

The tank continues to fill until the water level finally touches the HIGH probe (J1).

  1. Short to Ground: The water creates a physical, conductive bridge from the HIGH probe terminal directly to the GND probe.
  2. Voltage Divider Crash: This creates a voltage divider between your 680 kΩ pull-up resistor (R1) and the 20 kΩ – 30 kΩ resistance of your well water. Because the water’s resistance is so much smaller, it easily overpowers R1 and crashes the AC voltage at that node down close to zero.
  3. The Shutdown Cascade: With the AC signal choked out, the diode charge pump empties. Q2 (NPN) loses its base voltage and turns OFF.
  4. Pump Shuts Down: Consequently, the base voltage of Q1 (PNP) rises back to VCC, turning Q1 OFF.
  5. The Re-connect: The relay coil loses power, the contacts spring open, and the water pump turns OFF. Crucially, the relay switch drops back down, re-connecting pin 3 to pin 5. The LOW probe is now actively wired back into the circuit.

Phase D: Water Drops Below “HIGH” But Above “LOW”

As water is consumed in your household, the water level drops back down below the HIGH probe, leaving it exposed to the air.

  • What happens: The HIGH probe is no longer grounded, but the pump does not turn back on. It stays safely asleep.
  • Why it works: Even though the HIGH probe is open, the LOW probe is now re-connected via the de-energized relay contacts. Since the water level is still above the LOW probe, the submerged LOW probe shorts any incoming AC sensing current straight to ground. This starves the transistors and ensures the pump stays off.

The system remains perfectly idle until the water drains all the way past the LOW probe, breaking its connection to ground, and resetting the loop back to Phase A.

DIY Build Notes & Tips

If you are planning to replicate this project on a breadboard or custom PCB, keep these pro-tips in mind:

💡 Probe Material: While the AC current prevents chemical electrolysis, iron bars will still naturally oxidize over time in fresh water. For a truly maintenance-free build, replace standard iron bars with 316 Stainless Steel rods or carbon/graphite rods.

🛠️ Water Conductivity: This circuit layout is specifically tuned with a 680 kΩ resistor (R1), making it perfect for typical well water tables (20 kΩ – 30 kΩ). If you are using incredibly pure rainwater (which has much higher resistance), you can swap R1 for a 100 kΩ fixed resistor in series with a 500 kΩ potentiometer to manually calibrate your tank’s sensitivity.


Have questions about the transistor layout or setting this up for your own water tank? Leave a comment below!