Source: https://mokxi.com/learn/path/water-level-and-flow
Updated: 2026-11-20

All paths

# Water: level, flow, leaks and pumps

Floats, ultrasonic levels, flow sensors, leak probes and 12 V pumps on relays, with dry-run guards and a sump controller to finish.

Arduino Uno R3 Free 7 lessons 6 h 4 chapters 2,428 XP Embedded engineering · Intermediate +150 XP

0 of 7 done

Start the course free Float switches Lesson plan for teachers

What you will build

## 3 projects, built step by step

7 lessons in 4 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### Ultrasonic tank level

An HC-SR04 in the lid times an echo off the water, and the sketch turns it into millimeters and liters, with the air temperature in the sum.
Open it in the simulator

Chapter 2 project

### Leak probes

Bare traces on the floor find water. Power them only to read, so they do not plate themselves away.
Open it in the simulator

Chapter 3 project

### Dry-run protection

A pump that runs with no water wrecks its seals in minutes. Watch the flow, and stop it when there is none.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## How much water

Float switches and an ultrasonic gauge, and what each can tell you.

Open 249 XP

### Float switches

Two floats give the simplest honest tank level: empty, part, full, and one state that means something is broken.

0 of 7 steps

Start What is in it

Project Locked 498 XP

### Ultrasonic tank level

An HC-SR04 in the lid times an echo off the water, and the sketch turns it into millimeters and liters, with the air temperature in the sum.

0 of 7 steps

5 questions, graded as you go.

Chapter 2

## Water on the move

Count the flow, and find the water that got away.

Locked 218 XP

### YF-S201 flow

A turbine and a hall sensor give 7.5 pulses a second per liter a minute, 450 a liter. Count them with an interrupt.

0 of 6 steps

Project Locked 436 XP

### Leak probes

Bare traces on the floor find water. Power them only to read, so they do not plate themselves away.

0 of 6 steps

5 questions, graded as you go.

Chapter 3

## Pumps

Switch a 12 V pump safely, and stop it running dry.

Locked 249 XP

### Pumps on relays

A pin cannot run a pump. A relay module switches a 12 V DC pump on its own supply, and the sketch protects it from rapid cycling.

0 of 7 steps

Project Locked 498 XP

### Dry-run protection

A pump that runs with no water wrecks its seals in minutes. Watch the flow, and stop it when there is none.

0 of 7 steps

5 questions, graded as you go.

Chapter 4

## Boss

A sump controller that knows when to stop.

Locked 280 XP

### Boss: a sump controller

Two floats, a pump on a relay, a flow check, a maximum run time and a high-water alarm: a sump controller on 12 V, built the way a good one thinks.

0 of 8 steps

4 questions, graded as you go.

Syllabus

## Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### How much water

- Float switches Two floats give the simplest honest tank level: empty, part, full, and one state that means something is broken.
- Ultrasonic tank level An HC-SR04 in the lid times an echo off the water, and the sketch turns it into millimeters and liters, with the air temperature in the sum.

Chapter 2

### Water on the move

- YF-S201 flow A turbine and a hall sensor give 7.5 pulses a second per liter a minute, 450 a liter. Count them with an interrupt.
- Leak probes Bare traces on the floor find water. Power them only to read, so they do not plate themselves away.

Chapter 3

### Pumps

- Pumps on relays A pin cannot run a pump. A relay module switches a 12 V DC pump on its own supply, and the sketch protects it from rapid cycling.
- Dry-run protection A pump that runs with no water wrecks its seals in minutes. Watch the flow, and stop it when there is none.

Chapter 4

### Boss

- Boss: a sump controller Two floats, a pump on a relay, a flow check, a maximum run time and a high-water alarm: a sump controller on 12 V, built the way a good one thinks.

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Water: level, flow, leaks and pumps

Is Water: level, flow, leaks and pumps free?

Yes. All 7 lessons of Water: level, flow, leaks and pumps are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Water: level, flow, leaks and pumps take?

About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Ultrasonic tank level, Leak probes and Dry-run protection.

Where do I start?

With "Float switches", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
