Arduino Uno Multi-Electrode Water Level Controller
Professional 5-electrode stainless steel water level sensor deploys conductive sensing between common ground probe and 4 level electrodes (EMPTY/LOW/MEDIUM/HIGH/OVERFLOW) measuring >1MΩ dry → <10kΩ wet resistance threshold. Multi-point detection enables precise tank state classification with 2cm resolution.
Digital pins 2-6 monitor individual levels with 50kΩ pull-up resistors providing stable HIGH=DRY / LOW=WET logic levels. Hysteresis via software debounce prevents relay chatter at boundaries. 5V operation, IP68 probes survive indefinite submersion.
Production Fluid Level Components
- Arduino UNO R3 digital GPIO (pins 2-6)
- 5-Electrode Water Level Sensor (316L SS)
- 50kΩ pull-up resistors x5 (1/4W)
- Male-to-male jumper wires (12 pieces)
- 12V submersible pump + relay module
- IP68 junction box + cable glands
Multi-Point Resistive Level Interface
COMMON (GND): Arduino GND
EMPTY: Digital Pin 2 (tank bottom)
LOW: Digital Pin 3 (25% level)
MED: Digital Pin 4 (50% level)
HIGH: Digital Pin 5 (75% level)
OVERFLOW: Digital Pin 6 (alarm level)
// Arduino Uno 5-Electrode Water Level - Industrial Tank Management
// Pins 2-6: EMPTY/LOW/MED/HIGH/OVERFLOW | Hysteresis control
const int levelPins[] = {2,3,4,5,6};
const int pumpRelay = 7;
const int overflowAlarm = 8;
const int levels[] = {0,25,50,75,100}; // % levels
String levelStatus[] = {"EMPTY", "LOW", "MEDIUM", "HIGH", "OVERFLOW"};
void setup() {
Serial.begin(9600);
for(int i=0; i<5; i++) {
pinMode(levelPins[i], INPUT_PULLUP); // 50kΩ internal
}
pinMode(pumpRelay, OUTPUT);
pinMode(overflowAlarm, OUTPUT);
digitalWrite(pumpRelay, HIGH); // Pump OFF
Serial.println("=== 5-Electrode Water Level Controller Active ===");
Serial.println("Level | Status | Pump | Alarm");
Serial.println("---------------------------------------");
}
void loop() {
int highestLevel = 0;
for(int i=0; i<5; i++) {
if(digitalRead(levelPins[i]) == LOW) { // Wet = LOW
highestLevel = i;
}
}
float percentage = levels[highestLevel];
Serial.printf("Level: %3d%% | %s | ", (int)percentage, levelStatus[highestLevel]);
// Automatic pump control with hysteresis
if(highestLevel <= 1) { // <25% → PUMP ON
digitalWrite(pumpRelay, LOW);
Serial.print("PUMP:ON ");
} else if(highestLevel >= 3) { // >50% → PUMP OFF
digitalWrite(pumpRelay, HIGH);
Serial.print("pump:off ");
} else {
Serial.print("pump:hold ");
}
// Overflow protection
if(highestLevel == 4) {
digitalWrite(overflowAlarm, HIGH);
tone(9, 1500, 500);
Serial.println("*** OVERFLOW ALARM! ***");
} else {
digitalWrite(overflowAlarm, LOW);
Serial.println("OK");
}
delay(1000);
}
Multi-Level Production Deployment
Upload automatic tank controller. Submerge probes verifying EMPTY→OVERFLOW progression. 25%/50% pump hysteresis.
Serial + alarm relay provide complete level management.
Advanced Continuous Level & Pump Cycling
// Analog capacitive strip (A0: 0-1023 = 0-100%)
int rawLevel = analogRead(A0);
float percentage = map(rawLevel, 100, 900, 0, 100);
percentage = constrain(percentage, 0, 100);
Serial.printf("Continuous: %.1f%% | Pump: %s\n",
percentage,
(percentage < 20) ? "ON" : (percentage > 70) ? "OFF" : "HOLD");
if(percentage < 20) digitalWrite(7, LOW);
else if(percentage > 70) digitalWrite(7, HIGH);
5-Electrode Sensor Specifications
316L stainless probes; >1MΩ dry / <10kΩ wet; 2cm resolution; IP68 submersion; 5V logic; unlimited probes.
Industrial Fluid Management Applications
Rainwater cistern auto-refill
Sump pump overflow protection
Boiler feedwater control
// Pump run hours + level trending
static unsigned long pumpStart = 0;
static float pumpHours = 0;
void loop() {
if(digitalRead(pumpRelay) == LOW && pumpStart == 0) {
pumpStart = millis();
} else if(digitalRead(pumpRelay) == HIGH && pumpStart > 0) {
pumpHours += (millis() - pumpStart) / 3600000.0;
pumpStart = 0;
Serial.printf("Pump runtime: %.1fhours\n", pumpHours);
}
}
Production Level Specifications
- 25%/50%/75% discrete levels
- 2cm electrode spacing
- 50kΩ pull-up hysteresis
- 316L stainless corrosion proof
- IP68 full submersion
- Unlimited parallel channels
Advanced Float Switch & Ultrasonic Hybrid
// Cross-check discrete + continuous
int discreteLevel = getDiscreteLevel();
float ultrasonicLevel = getUltrasonicDistance();
float discretePercent = levels[discreteLevel];
float diff = abs(discretePercent - ultrasonicLevel);
if(diff > 10) {
Serial.println("*** LEVEL DISCREPANCY DETECTED ***");
digitalWrite(9, HIGH); // Fault relay
} else {
Serial.printf("Validated: %.0f%%\n", (discretePercent + ultrasonicLevel)/2);
}
Installation & Maintenance Protocol
Vertical probes (max tilt 5°). 10cm above pump intake (LOW level). Weekly debris cleaning. Distilled water testing. Stainless 316L prevents corrosion. IP68 junction box mandatory.
Conductivity Considerations
- >10μS/cm tap water: Excellent
- 1-10μS/cm distilled: Poor
- Brackish/seawater: Very good
- Oils/glycols: Non-conductive