Skip to content
DersTeders Log inSign up My panel

Measuring Water Level with a Sensor

Read the analog output of a water level sensor and monitor the liquid level.

Circuit diagram

Measuring Water Level with a Sensor — diagram of the arduino circuit built on a breadboard
Measuring Water Level with a Sensor circuit breadboard layout and connections.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build

Open in simulator

You can open the same circuit in the browser-based circuit simulator without any installation and inspect the wires and components there.

Parts list

ComponentQtyDescription
Arduino Uno1Reads the sensor's output voltage through the analog input.
Water level sensor1A sensing surface whose conductivity changes as it is immersed in water.
5V supply connection1Supplies voltage to the sensor's power leg.
Ground connection1Common reference for the sensor and the board.

Breadboard layout

The Arduino is on the left, the sensor at the upper right, the 5V supply at the top and the common ground at the lower right. The sensor's signal leg goes to Arduino pin 1 and its ground leg to common ground.

Step-by-step build

  1. Place the Arduino Uno on the work area.
    Tip: The GND pin is index 0.
  2. Connect the sensor's power leg to 5V.
    Tip: On the sensor, pin 0 is power, pin 1 signal and pin 2 ground.
  3. Connect the signal leg to Arduino pin 1.
    Tip: The analog signal goes to a single pin.
  4. Connect the sensor ground and the Arduino GND to common ground.
    Tip: Without a common reference the reading drifts.
  5. Upload the code, immerse the sensor in water and watch the read value.
    Tip: Compare the dry and wet state values.

How it works

The parallel conductive traces on the sensor surface see their resistance drop when they come into contact with water. This change affects the voltage at the sensor's analog output. The Arduino converts this voltage into a number between 0 and 1023 with its analog-to-digital converter. As the water level rises, a larger part of the sensing surface becomes conductive, so the read value changes. By setting separate threshold values for the dry state and the immersed state, level ranges can be distinguished. Water conductivity and the cleanliness of the sensor affect the result during measurement.

What you will learn

  • Applies conductivity-based analog sensing.
  • Sets thresholds for dry and wet states.
  • Interprets the sensor output as a voltage.

Expected result: As the sensor is immersed in water, the analog value read on the serial port changes relative to the dry state.

Challenge

Level monitor: Monitor the water level from the analog input.

Goal: A value that changes with the level appears on the serial port.

Tips

  • Drying the sensor after measurement protects the traces.
  • Different water temperatures can slightly change the read value.

Frequently asked questions

What changes as the sensor is immersed in water?

The resistance between the parallel traces decreases; this change is reflected in the analog output voltage.

How is the threshold value determined?

The readings for the dry and immersed states are noted and a threshold is chosen between the two values.

Why is it dried after measurement?

Water left on the traces can cause corrosion; drying extends the sensor's life.

If you want to build this project in real life, you can get the parts from hobidevre.com. For more circuit ideas, visit the hobidevre.com blog.

Blog · Circuit simulator · KVKK Disclosure