"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 it 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 types 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 developement
- 5 Building the probe
- 6 Problem faced during the project
- 7 The project
- 8 References and links
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 is potentially interresting, like extending the work and change it 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 professional probe like the ones 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 probes and check them in some rivers if the water is polluted and/or dirty.
This project is the frame of something that could become really improved if people contribute to it. This project is also 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 this kind of measurements in a more advanced version of such a probe.
Developpement from scratch
This project starts from scratch, meaning that at first it 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 developed as well as the recording of the data, it would be interesting to automate some parts of it.
So the idea of having some kind of probe on the field that would do the measurements and sending data through internet came up, 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 craft 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 can be scraped, the better. And if there is a 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 some works out there that were made to make certain of these components work, but not for 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 was any, then based on that, hook up the component to the raspberry, trying to find a python library 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 coming 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 challenge, 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 and fastened it. And for the big box, cutting a plexiglas plate with the adequate size too seems to do the trick (of course the components need 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
Of course in project like this not everything goes as planned and indeed there were a few difficulties.
Notably with the turbidity sensor, such sensor can be found in any standard dishwasher but other than that and tutorials on how to replace the turbidity sensor in a dishwasher there is not much documentation on the internet, so logically as a turbidity sensor give an analog output there is a need for an analog-digital converter, that with a 10k resistor between the analog output of the sensor and the ground showed some acceptable results. And as the ouput result is just a value between 0 and 1024 (10 bits ADC) it needs to be calibrated, the choice was made such that the raw value will be sent to the server leaving the interpretation to the front-end. Although for calibratique physically the sensors some tests were made with water and milk to get actual value that made sense.
The there is the GSM module, it is not a module made for a Raspberry Pi (gsm click) so the figuring out how it worked wasn't as easy as for the other components (such as the temperature sensor). It had the TX and RX pins, typical pins used for serial communication, so using a usb to serial module to connect it to a computer is really interesting. GSM module usually communicate with AT commands and indeed it is the case for this one, then it is required to enter the correct sequence of AT commands in order to connect to the network and sends some informations through internet. Things worked with usb module but when hooked via the GPIO pins of the Raspberry Pi the output wnet randomly garbage, sometime it worked, sometimes not.
"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 be 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 a project is firstly its low power consumption (roughly 2 to 3 W ). 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 provides a direct interface to access the raspberry pi, update the code, etc...
Currently used in the project
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)
May be useful for further research/developpement
Flood monitor in the Flood Network.