1-Wire Water Level Measurement Sensor

Measuring Water Depth Inexpensively
Copyright 2004, Chris Nafis

Water Level Sensor Water Level Sensor

Overview

There are situations in home automation applications where you would like to measure the level of some body of water (e.g. pool, pond). The 1-Wire network makes it easy to interface sensors to a PC or simple controller. Some experimenters use a string of capacitors and a timer to measure water depth. I decided to use a simple optical approach. The idea is very simple. A pin-pong ball floats on top of the water in the pipe. An infrared triangulation sensor outputs a non-linear voltage corresponding to the distance to the ping-pong ball. The prototype system can measure level changes of up to 24cm with a resolution of around 1cm. This range / resolution can be changed by using different infrared sensors.

Water Level Sensor Water Level Sensor

Sensor Calibration

Water Level Sensor Water Level Sensor Water Level Sensor Water Level Sensor

The sensor is calibrated by taking voltage measurements at number of different water levels. A polynomial is then calculated to fit the data.

Data Fit Graph

A lookup table created from the polynomial can be stored in the DS2438 40 Byte nonvolatile memory. This makes the water level sensors easily replaceable. Storing the voltage multipled by 100 as a single byte allows a 40cm range to be stored. For the prototype the values are:

 
d2 c4 b8 ad a4 9c 94 8d 87 80 7a 74 6e 67 61 5b 54 4e 48 43 3e 3a 37 35 34 00

Sensor Hardware

Water Level Sensor Schematic

Software

The Link 1-wire RS-232 adapter is used to communicate with the sensor. TCL routines are used to process the data. TCL for Windows is available from ActiveState. RRDtool is used to generate graphs.

Disclaimer

This project is for experimental use only. The user assumes all responsibilities for assembly, installation, and use. This circuit is provided without warranty and the author makes no claim that this device will work in any particular application. Do not use in applications where failure or incorrect operation could jeopardize someone's safety. This schematic is provided for noncommercial use only.