Source: https://mokxi.com/parts/waterlevel
Updated: 2026-11-10

Part

# Water level sensor

Bare traces and a transistor: S jumps the moment the tip gets wet and creeps up after.

See every part

- 3 pins
- 1 setting
- In 2 projects
- In 2 lessons

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Water level sensor in brief

What it is, and every setting the properties panel gives it.

The red water level sensor from starter kits is a long board with ten bare traces and three pins marked S, plus and minus. Half the traces sit on the supply and the rest feed the base of an NPN transistor whose emitter is S, so water bridging them turns the transistor on as an emitter follower. There is no comparator: wire plus to 5 or 3.3 volts, minus to ground and S to an analog input, then read it with analogRead(). Mokxi models the shape a real one shows, a sharp jump the moment the tip gets wet and a slow creep after it, passing half its top reading by 5 millimeters and reaching the full value at 40. The full property sets that top as a fraction of the supply, 0.66 by default, about 670 on a 5 volt Uno. The usual mistake is treating the number as millimeters; calibrate it in your own water. A real one left powered in water corrodes, so power it from a pin only to read it. Corrosion, water conductivity and the wet film left after lifting it out are not modeled.

Family

Sensors

Pins

3

full

0.66

A circuit built around it, running and explained: the Water level sensor simulator.

Pins

## 3 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

Role

What it does

S

Output

The reading: 0 dry, rising with the depth of water.

VCC

Input or output

Supply, 3 V to 5 V. Printed +.

GND

Input or output

Ground. Printed -.

How to use it

## How to use a water level sensor with an Arduino

In the plant monitor example the sensor hangs below the breadboard with S on A2, VCC on the 5 volt rail and GND on ground, beside a soil sensor and a rain plate. analogRead(A2) gives 0 dry and rises with depth, so unlike the other two it reads higher when wetter, and most of its change happens in the first few millimeters.

To slow corrosion on a real board, feed VCC from a digital pin, write it HIGH, wait a few milliseconds, read S, and write the pin LOW again. An unpowered sensor drives nothing here either, so the same sketch works on the canvas. Then map the reading to marks you made in your own water rather than trusting a scale.

Part pin

Board pin

S

A2

VCC

5 V

GND

GND

Powered from 3.3 volts the sensor tops out at 0.66 of that, about 2.2 volts, which any 3.3 volt board’s analog pin can read.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

How it is modeled

## What is true about the Water level sensor, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The shape of the reading. A real one jumps the moment the tip touches the water and
then creeps up slowly, because the first millimeter of wet trace turns the transistor
on and every millimeter after it only adds a little more base current. The model is
that curve: a third of the way up at 3 mm, half at 5 mm, and the top at 40 mm.

### Not modeled

The top reading and the curve are typical, not a measurement. A real one moves a lot
with how conductive the water is, which is why this is a level indicator and not a
gauge. Corrosion is not modeled: like the rain plate, a board powered all the time in
water plates itself away, and the advice is to power it from a pin only to take a
reading. Nor is the film of water left on the traces after it is lifted out, which
keeps a real one reading for a while. S comes out through 100 ohms.

From Water level sensor, in full.

Projects

## See the Water level sensor in a project

2 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

2 lessons place it in their own circuits.

### Learn articles

2 lessons

- Arduino Soil Moisture Sensor: Code and Wiring
- Arduino Water Level Sensor: Wiring and Code

Boards

## The boards it is shown on

This board has a built-in project with the Water level sensor in it.

- Arduino Uno R3

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Water level sensor

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
