Fluid level meter


This circuit is based around the PIC 16F873 microcontroller. This chip is actually a small computer contained in a single chip, including RAM memory, EEPROM, I/O ports, CPU and so on. When you buy this chip, it comes empty with no program on it. You have to compile the source code and download the resulting machine code into it, using a PC and a small programmer attached to the parallel port of the PC and the chip. To get yourself familiar with this stuff, I suggest you first read this link: Getting started with microcontrollers.
The circuit represents a measuring device to measure fluid levels. I use this to measure the amount of water remaining in the watertank of my RV. A sensor must be build, but this is fairly simple: the sensor consists of a nine-wire flat cable. The first wire is the 'common' and goes down all the way to the bottom of the watertank. The second wire represents 'level one' and goes down to 1/8 of the watertank. This goes on for a total of eight levels. All wires must be stripped a little bit at the end. The fluid level is measured using one of the AD ports of the processor. To protect the sensor from electrolytic effects, the sensor is fed with alternating current. This is all done in software.
The measured level is shown on the LCD display in a bar graph, representing 1/8 through 8/8 of the tank volume. A second view can be activated to see the amount in liters. The number of liters for one level can be set, and is stored in EEPROM. For other features, see the readme file on this page.

Remarks about this project:
The input labelled 'to waterpump' can be used to automatically switch on the device, for instance when a pump starts running. The input can be connected parallel to the pump. If not used, ground this input to avoid problems.

Source code for this project


List of components

Some pictures

The box, opened.

The device built into a K10 plastic box.

The level is expressed as a bar graph.

Bar graph display.

Vertical display.

Vertical display with backlight.

  Home         Back to Electronic Projects