Latrine Logger Prototype
I have been working along with Nicola Greene (in conjunction with Water for People and Engineers Without Border UK) and James Fowkes (a fellow Nottingham Hackspace member) to look at the issue of data monitoring for pit latrines.
A group of us had a hackday at Nottingham Hackspace to discuss the problem, look at solutions and hack together prototypes.
The problem is described here in a presentation by Nicola. Basically 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 in a simple, low-cost, robust and non-intrusive.
As I had been using the DataDuino for wind speed data monitoring, I suggested it as a platform for recording the sensor data. I donated a couple of DataDuinos to the project and we have nearly completed the first prototype to be installed (within the UK to start with).
There is loads of information on this wiki post about the hackday and the prototype development. There is also an overview from Nicola here.
Actually recording the data was a relatively simple matter, using the Wind Logger Arduino code with a few adjustments. This worked quite well and is low-power so should last for 6-12 months of data recording without having to change the batteries.
Flush Sensor
The main problem was to get accurate recording of a flush. We only needed to record when a ‘flush’ (usually a cupful of water) occurred. This would have to be attached to the waste pipe, so in pretty horrible conditions. It should not affect the operation of the latrine at all.
We tried many sensors and almost settled upon using an IR beam break system. But this proved hard to implement and unreliable (it turns out that water absorbs IR, so it needed a high power IR beam to get a signal back.
James had a spark of inspiration and tested a capacitance based sensor. This straps around the tube and, along with a 555 timer, creates an output frequency dependant upon the capacitance. This can be monitored with a microcontroller. It worked very well for detecting water down the waste pipe and is robust, easy to fit and does not block the pipe at all. The only issue is that it cannot be used on metal pipes, which hopefully will not be an issue.
This project was featured on Hackaday while in the early stages.
All the hard design work has mainly been done by James, he has produced a code library which will be implemented on the DataDuino. This is being tested on a pit latrine in the UK, before Nicola takes some prototypes out to Uganda for a pilot project.
Prototype Photos
Here are some photos of the prototype:


- There is a 470k/100k potential divider from the input voltage to A0 (measures battery voltage).
- The output LED has been moved from pin D4 to D5.
- The 555 timer output feeds the Timer1 input on D5.
- A ‘Calibrate’ switch is used on pin D7.
- The Vref pin (pin 22 of the ATmega328) has been isolated, so that the internal reference can be used.











Code Information
I have put the actual logging sketch and James’s libraries into a GITHUB repository here:
https://github.com/re-innovation/LatrineLogger
This includes the instructions.
James has been working away at the new capacitance sensor and had created a github library with examples of the code he had created. They are available here: https://github.com/jamesfowkes/Code-Library/tree/master/Arduino/LatrineSensor.
Instructions
These have been written for the prototype and they are put here for reference.
Prototype Testing
Centre for Alternative Technology
The initial prototype has been taken to the Centre for Alternative Technology (CAT) in Wales to be fitted onto some pit latrines in use there.
There were some problems with the program for these tests and the results were not useful, but people did see a value in such a unit.
Malawi
There was an opportunity to test the unit in Malawi with a Water For People installation. The program was sorted out (a relatively easy to fix bug in the code). The unit has been taken to Malawi for testing.
Hopefully this time we will get more useful data.
How is the sensor made? Is it just a two sheet of plastic. With a wire connected to each one?
Hi,
The sensor was made from copper sticky backed tape stuck down to polypropylene (thin plastic) sheet. This was then covered with a layer of tape. There were two pieces of copper tape with a wire soldered to each side. This formed the capacitor.
The whole thing was then held in place with a velcro strap around the plastic pipe.
Hope that’s useful.