Measuring the Water-Level of a Cistern

To measure the water level of our cistern, I started to build a little cistern monitor based on a hacked TP-Link MR3020 router running OpenWrt and a SRF05 ultra sonic range finder. The software project mainly consists of a kernel module and a web service to access the
data through a simple web-ui or by CSV download. The sources for both (and some build instructions) could be found on github.

CisternMongoose web-ui

CisternMongoose web-ui

Since the TP-Link has some unused GPIOs, the SRF05 could be connected directly to the TP-Link by using a single line for triggering/data acquisition. The values from the sensor are exported to sysfs by the kernel module. Then, the web-service reads out the data from there and provides them as JSON. Also the web service provides a simple static HTML page using microAjex to retrive and display the JSON. The web service is written in plain C and uses the excellent mongoose as a foundation. Thus, the whole thing is only about 110k small. To create a long-term statistic, the measured data is written to a CSV file every hour.

MR3020 with Kyle supervising  and SRF05 connected

MR3020 with Kyle supervising and SRF05 connected

MR3020 cracked open

MR3020 cracked open, wires for 3.3V, GND and data connected

(Unfinished) mounting of MR3020

(Unfinished) mounting of MR3020

Cistern cover, sensor (with enclosure) below

Cistern cover, sensor (with enclosure) below

Leave a Reply

You must be logged in to post a comment.