Water Level Controller: Float Switch or Ultrasonic Sensor?

Quick answer

A float switch is the most dependable for on and off. Choose ultrasonic when you want a number. Use a low-voltage pump: mains is for adults.

Side by side

One float switch

Who it's for
Beginners with an adult
Level
intermediate
Cost
Medium
Main parts
Uno, float switch, relay, AC pump, I2C LCD, 12 V adapter
Wiring
Medium
Code
About 34 lines
It can
Know low or not low, very reliably
It can't
Say how full it is; its pump is mains, so an adult must wire it

Three float switches

Who it's for
Kids' group project
Level
beginner
Cost
Medium
Main parts
Uno, 3 float switches, relays, pump, I2C LCD
Wiring
Hard
Code
About 48 lines
It can
Watch two tanks and a recharge pit
It can't
Measure centimetres

Ultrasonic, no display

Who it's for
Intermediate
Level
intermediate
Cost
Low
Main parts
Uno, HC-SR04, relay, pump (or heater)
Wiring
Easy
Code
About 29 to 31 lines
It can
Measure the distance to the water without touching it
It can't
Show it on a screen

Ultrasonic and LCD

Who it's for
Intermediate
Level
intermediate
Cost
Medium
Main parts
Uno, HC-SR04, relay, pump, I2C LCD
Wiring
Medium
Code
About 63 lines
It can
Show the level and use separate on and off points
It can't
Work well with splashes or foam close to the sensor

Written from the parts lists and code in these tutorials. Cost is a rough guide to the parts they list, compared with each other; line counts are of the main program.

More comparisons