"Open design of a fixed probe for water quality monitoring in rivers and lakes" is the bachelor project of an EPFL student, Nils Bonfils, which is done within the Biodesign project and supervised by Robin Scheibler.
The aim of this project is to set up a prototype measurement station in the Sorge (a small river near the EPFL) to collect some data about the water and the environmental conditions. And also make the work reproducible so that someone, somewhere else could also build one to collect data about a specific river or lake. That's why there also is a GitHub for the project, where there are guidlines on how to build your own, these guidlines were made based on my own experience of building such a device.
The data collected is for my prototype restrained to the temperature of the water, the turbidity of the water, the ambient temperature, the barometric pressure and taking a photo of the water. One could easily imagine that can be extended to collect more data related to pollution of the water like the conductivity or pH. But it's for simplicity reasons that there are only 5 different type of data collected (which seems enough for a prototype) and also to get a functional prototype in a single semester while not working full time on it. And one must not forget that this project is started from scratch !
- 1 What is this project useful for ?
- 2 Developpement from scratch
- 3 Scraping/Buying the materials
- 4 Software developpement
- 5 Building the probe
- 6 Problem faced during the project
- 7 The project
- 8 Parameters Measured
- 9 Other parameters related to water
- 10 Turbidity sensor
- 11 Data Collecting
- 12 Data displaying
- 13 Battery and power management
- 14 Background
- 15 References
What is this project useful for ?
For now, basically nothing really interresting, but as mentioned in the intro, it's a prototype and the application of such a device are potentially interresting, like extending the work and change or add more sensors to collect data related to other parameters that are useful for you. Also this could be nice in some countries where governements aren't willing to spend money in water monitoring, and you don't need to spend 10'000$ to get a proffesional probe like the ones the used in the State of Geneva (Nils had the chance to meet Stephane Odriozola who works there, see his post on the Biodesign blog), maybe a scientific team could build few of those probe and check in some rivers if the water is polluted and/or dirty.
This project is the frame of something that could become really improved if peoples contribute to it, also this project is part of of the Biodesign project which for now the "main" project is to detect Arsenic in water with a bacteria, and the collecting system has to be manually done, it could be interesting to automate it by maybe integrating these kind of measurments in a more advanced version of such a probe.
Developpement from scratch
This project starts from scratch meaning that at first there was just an idea. The idea of this emerged between Sachiko, Robin and Nils, at first Robin and Sachiko presented the Biodesign project to Nils and they came to the idea that, as the collecting of sample for the bacteria measurements is not highly developped as well as the recording of the data, it would be interresting to automate some part of it.
So the came idea of having some kind of probe on the field that would do the measurements and sending data through internet, but as for the bacteria there are specific protocols and other things, it was more reasonable to start with measurements that are easier to make, like the temperature of the water (etc... ). So that's where the idea of such a probe came from.
Once the idea was correctly set up, materials to creft the probe were needed.
Scraping/Buying the materials
One of the project's side goal is to make the building of such a device accessible and affordable, so the more materials that can be scraped the better. And if there is need to buy something, the cheaper the better. So indeed for the prototype the finitions aren't quite "commercial", it is really DIY looking.
What could be scraped for example is the turbidity sensor, which is a basic turbidity sensor comming from a dishwasher (for the prototype it was bought for 2$ on the internet as we hadn't a dishwasher at our disposal). In fact almost everything could be scraped depending on how good you are at finding and making work stuff, and even if you can't every materials used for such a probe can be bought on the internet for very cheap.
Starting from scratch also means that there is no software for such a probe, of course there are already work to make certain components work but not all of them, and there was a need to figure out those things too. And at the end putting it all together and have a working server that runs on the device, collects the data and send them.
The choice was made to develop in python 3 as it is a very popular and user-friendly language, although powerful. Python is an interpreted language, that means that it can run on any machine, providing the python interpreter is installed on this machine. And as the Raspberry Pi features a linux system (Raspbian) it is very easy to install and use python on it.
A big part of this project was the testing of each components with Raspberry Pi and integrating the code to read the data for it in a server-script in python. The testing consisted in different steps, first finding a documentation on the component if there were any, then based on that hook up the component to the raspberry, trying to find a python librairy if there are any for this specific component and then try to get some data out of the component. Once the component worked, there was a need to integrate it in the server-script that will run inside the probe.
Building the probe
It is a chance that there exists Hackuarium near the EPFL, a place where different people comming from different formations can work and meet, there are also a lot of tools to work with. It is where the prototype was built.
But before building, as there was no plans to build such a probe, the creation of the prototype was made step by step, with lots of tests. A thing that couldn't be done without the apropriate tools were the holes in the mettalic box, those holes were made in order for the cable of the sensors to leave the box and go in the water, and tools were needed so the holes have the right size for the cable clamps. To use these tools following a security formation was needed first.
Fastening the electronics inside the boxes was another challange, for the small box as there only is a small sensor in it (temperature and barometric pressure), a very simple PCB with the adequat size to fit in fastened it. And for the big box, cutting a plexiglas plate with the adequat size too seems to do the trick (of course the coponents have to be fixed to the plate too).
The electronic components are soldered together with the help of wires and a breadborad-like PCB.
Problem faced during the project
"Open design of a fixed probe for water quality monitoring in rivers and lakes" is the bachelor project of an EPFL student Nils Bonfils which is done within the Biodesign project and supervised by Robin Scheibler. The goal is to set a fixed measurement station on Sorge river at EPFL. It will collect different water-related and environment-related data and then send them through the internet to a server to be stored there, and then maybe displayed with a web interface. The core of the station is a raspberry pi that will be used to interface with the different components like the temperature probe. The advantages of using raspberry pi in such project is firstly its low power consumption (roughly 2 to 3 W  ). The there are other advantages like easy backup storage and internet connexion through USB (like usb dongle for 3g/4g) and there also is an ease of use with the ssh connexion which provide a direct inteface to acces the raspberry pi, update the code, etc...
These are the parameters that will be mesured by the station. Rpi GPIO
- Turbidity of water -> adc hook up for reading from sensor - python code to read from adc - need to add a 10k resistor from data to gnd
- Photo of the water -> arduino camera
- Barometric pressure -> Used Sensor (BMP180) Datasheet of the sensor BMP180 circuit hook up BMP python lib
- Temperature of the air + water (available at hackuarium) -> waterproof sensor(DS18B20) - useful python library (needed to change /boot/config.txt though) - ada fruit DS18B circuit hook up (the resistor is 4.7 or 10k Ohms)
These are parameters related to the project that will not be measured for simplicity sake, but it could be interresting to have them on an upgrade of the project (bigger station, needs to measure other things).
Tutorial to connect ADC to raspberry pi 
- SD card shield
- GSM shield -> sparkfun - ebay - arduino official
- GSM click -> octanis wiki - useful command sequence - some doc on at commands - configure serial on RPi - Set CTS pin HIGH and RTS pin LOW to get proper communication
Battery and power management
- RPi shield that can schedule shutdown and wakeup Witty Pi
- Power management: LiPo Rider from SeeedStudio (at hackuarium) wiki page
- Laboratory of ecohydrology at EPFL has a project for herbicide monitoring in the Chamberonne catchment where meteorological and flow data are available.
- Flood monitor in the Flood Network.