Renewable Energy Innovation

  • Increase font size
  • Default font size
  • Decrease font size
  • Error loading component: com_contact, 1
Email Print

No image

The Latrine Logger was developed for Water For People.

Water For People is an international non-profit working across 9 countries to bring safe water and sanitation to 4 million people.

Water for People want to see communities break free from the cycle of poverty and spend time growing, learning, and thriving, instead of walking for water and fighting off illness.

Following on from testing a prototype unit, we have done many improvements and have supplied the Latrine Logger - a data logging unit for monitoring pit latrines.


1.8 billion people around the world don't have access to safe water and 2.4 billion lack access to adequate sanitation. Women and children spend more than 4 hours walking for water each day, and more than 840,000 people die each year from water-related diseases. (from Water for People website)

Water For People is an international non-profit working across 9 countries to bring safe water and sanitation to 4 million people.

Water for People want to see communities break free from the cycle of poverty and spend time growing, learning, and thriving, instead of walking for water and fighting off illness.

Water for People have been installing pit latrines in various different areas in Uganda. These are filling up at very different rates, but the reason for this is unknown. They need to record the usage of the latrines with a simple, low-cost, robust and non-intrusive system.

The problem is described here in a presentation by Nicola Greene.


The Latrine Logger uses a capacitative sensor to measure liquid flow down non-conductive pipes, such as the PVC pipes generally used for pit latrines. This sensor is wrapped around the PVC pipe and the capacitance forms part of the RC circuit in a 555 timer oscillator. This gives an output frequency of around 60kHz which will drop when any liquid is sent down the pipe. This drop is monitored and, along with filtering and averaging algorithms, triggers the unit to record a 'flush event'.

The unit records each flush event with a time and date stamp into a .csv file onto an on-board SD card. This data is human readable and can be opened in any spreadsheet program.

The unit is battery powered by 3 x 'D' size cells, which should last for between 1-2 months.

There is an on-board real time clock used for the timestamp.

We are using an ATMEGA328 microprocessor with the Arduino bootloader and code has been written for upload via the Arduino IDE.

The prototype was developed along with Nicola Greene (in conjunction with Water for People) and James Fowkes (a fellow Nottingham Hackspace member) to look at the issue of data monitoring for pit latrines. The prototype units were used in Uganda and feedback from their operation was fed back to improving the unit.

This project was featured on Hackaday while in the early stages.

No image


Flush Sensor

No image

We needed an easy to install sensor to fit over the PVC flush pipe. We came up with a simple wrap-around sensor comprised of two pieces self-adhesive aluminium tape. These are stuck to a plastic backing with one wire from each of the two pieces of tape. These each wrap half way around the PVC pipe and form a very small value capacitor. This capacitance varies when water passes through the PVC pipe.

No image

To measure the capacitance we use the capacitor to form an astable oscillator using a standard 555 timer circuit. This produces a frequency which is proportional to the capacitance. Even small amounts of water change the capacitance to trigger the logger.

The schematic of the flush sensor is here:

Data Logging Unit

The data-logging unit was based upon work James and I had done with the DataDuino, an Arduino based data-logging unit.

No image

Enclosure design

Feedback from the prototype unit included:

  • Requiring easy access to the SD card without fully opening the enclosure
  • An obvious 'sensor working' indicator
  • Attachments for hanging the monitoring unit above the pit
  • Easy access to the batteries
  • Cover for the PCB to make the unit more 'user friendly', as the complex looking electronics meant some people were not wanting to adjust/use the units.


No image

3 x 'D' cell batteries power the unit.

No image

On/Off switch with Data and Power LEDs.

Note: Laser cutter used to engrave the text, but with settings slightly wrong so the words are slightly melted.

No image

The Data light is lit when the unit detects a flush. The Power light flashes every 10 seconds to show the unit is on and the battery is good.

No image

The SD card can be accessed via a waterproof access point. This is closed with some wing-nuts.

No image

No image


The schematic of the data-logger electronic design is here:


Some installation, use and algorithm overview instructions have been written:

Data analysis

The flush sense algorithm monitors the average frequency from the 555 timer circuit. A flush start is detected when the frequency drops by a certain amount and brings the frequency below the average value by a certain amount (in this case its around a 1000Hz drop). The flush end is detected when the frequency has risen above the low value by another amount (in this case around 500Hz). This is best shown by the digrams here:

No image

This graph shows the drop in frequency when water is flushed down the pipe. There is a sharp drop then a slow rise as the water trickles down.

No image

The frequency must drop below the average frequency minus a threshold value before the unit registers the start of a flush event.

No image

The frequency must rise above the end threshold (the average minus a different threshold value) to register the end of a flush event.

The files are stored onto an SD card (size from 1Gb to 8Gb). The data is written into a .csv file withthe ID of the unit, the timestamp and the event. This also measures the battery voltage and when the battery voltage is low then 'BATT LOW' is written to the card. Any data after this point is not reliable and the unit will stop recording data.
No image

Design files

This project is open-source and all the design files are available here. This includes the embedded software code, the schematic and the PCB design files.

The files are all available within this GITHUB repository:


If you are interested in low-cost monitoring of flushes then please This email address is being protected from spambots. You need JavaScript enabled to view it. .

Add comment