Source: https://mokxi.com/teachers/plans/water-level-and-flow
Updated: 2026-11-19

Lesson plan

# Water: level, flow, leaks and pumps lesson plan

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

4 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Float switches and an ultrasonic gauge, and what each can tell you.
- Count the flow, and find the water that got away.
- Switch a 12 V pump safely, and stop it running dry.
- A sump controller that knows when to stop.

### Materials for the whole unit

- Arduino Uno R3
- Buzzer
- DC jack and adapter
- Float switch, ZP4510 x 2
- Mini water pump
- Relay module
- Ultrasonic ranger
- Water flow sensor, YF-S201
- Water level sensor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 50 min

## How much water

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

Lesson | Time | What students do

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

- An empty tank
- The water reaches the low float
- Full
- Closed reads LOW
- A state that cannot happen
- Signal only, low voltage
- Turn the high float over

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. | 55 min

- A sensor in the lid
- Distance from time
- Nearly empty
- Too close to see
- A hot day
- Tell it the temperature
- Real tanks

### Materials

- Arduino Uno R3
- Float switch, ZP4510 x 2
- Ultrasonic ranger

### Check for understanding

Each student finishes "Ultrasonic tank level" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Real tanks".

Chapter 2. About 1 h 30 min

## Water on the move

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

Lesson | Time | What students do

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. | 45 min

- No flow, no pulses
- Open the tap
- Pulses on pin 2
- Liters, and a late valve
- How good is it?
- A smaller batch

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

- A dry floor
- Powered only to read
- Water on the floor
- Sound it
- Where it goes
- Remember the leak

### Materials

- Arduino Uno R3
- Buzzer
- Water flow sensor, YF-S201
- Water level sensor

### Check for understanding

Each student finishes "Leak probes" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Remember the leak".

Chapter 3. About 1 h 50 min

## Pumps

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

Lesson | Time | What students do

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. | 55 min

- The pump circuit
- Run it
- The relay pulls in
- Water moves
- Stop it
- Low voltage, and why
- Let it rest

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. | 55 min

- Start and expect water
- No water
- With water
- The tank runs dry
- Try again
- Other guards
- A slow priming pump

### Materials

- Arduino Uno R3
- DC jack and adapter
- Mini water pump
- Relay module
- Water flow sensor, YF-S201

### Check for understanding

Each student finishes "Dry-run protection" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A slow priming pump".

Chapter 4. About 1 h

## Boss

A sump controller that knows when to stop.

Lesson | Time | What students do

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. | 60 min

- The sump
- The water rises
- The relay pulls in
- Pumped down
- The intake is blocked
- The pump cannot keep up
- A maximum run time
- What it is, and what it is not

### Materials

- Arduino Uno R3
- Buzzer
- DC jack and adapter
- Float switch, ZP4510 x 2
- Mini water pump
- Relay module
- Water flow sensor, YF-S201

### Check for understanding

Each student finishes "Boss: a sump controller" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What it is, and what it is not".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
