top of page

Meet pHil

(Scroll for instructions)

Parts needed 

We have built pHil with the citizen in mind. Every part is as cheap and convenient as possible in order for anyone to recreate pHil and contribute to citizen science. Here is a list of all the parts needed:

​

Sensor electronics: 

​

  • A usb to micro-usb cable (or usb to usb c if you use a raspberry pi 4), we recommend at least 0.5 m 

  • Jumper wires, both male to male and male to female 

  • I2C analog to digital converter, like this one 

  • An analog pH sensor, like this one 

  • A voltage converter 

​

Water Proof Casing: 

​

  • A plastic pipe, for instance made of PWC, either with a diameter of 80 or 110 millimeters. One end of the pipe should be wider and compatible with a cleanout.

  • The lid of the instrument will be a cleanout, make sure it has an O-ring on the inside so that it is waterproof.

  • The other side of the pipe will have a pipe plug, and here it is also important to make sure it has an O-ring on it. Would recommend to use some grease when fitting it to the pipe.

  • A cable entry for the pH-sensor to make it waterproof around it. 

  • A plank made of wood or other material to fit the electronics in the casing.  

  • A couple of different sized screws (small 2mm wide screws and larger 4mm screws). 

  • Materials for attaching some of the electronics such as strong sewing thread, glue, cable ties, rubber bands etc. 

  • Materials to create a space between the electronics and the plate it’s attached to such as furniture pads, bits of rubber etc.

​

Making the electronics

Start by soldering the pins to the I2C analog to digital converter. Stick the converter to the breadboard like this:

​

​

​

​

​

​

​

​

​

The converter contains 10 ports, but we are only interested in in VDD (voltage), GND (ground), A0, SCL, and SDA.  

The signal from the sensor comes in three cables, each in different colors. To know where the cables needs to go, we will use this schematic of the pins of the raspberry pi:

​

 

​

​

​

​

​

​

​

​

Start by connecting the voltage by connecting the 5V-power pin (2) in the raspberry pi, the VDD port of the converter, and the signal (red) cable from the sensor. 

​

Then, to the same thing with the ground (4), gnd and ground (black) cables of all the three components (only the ground cables are shown for visibility).

​

​

​

​

​

​

​

​

​

​

​

​

As for the signal cables, the yellow cable from the sensor should be connected to A0 port of the converter. From the converter, one cable will go from the SCL port to the SCL pin on the raspberry pi (5). Another cable goes from the SDA port of the converter to the SDA port of the raspberry pi (3). The signal cables should look something like this:

​

​

​

​

​

​

If you have connected all the cables in the right way, the final (messy) result should be something like this:

​

​

​

​

​

Power supply, you need to connect the cables from the battery holder to the input of the voltage regulator. Then, in order to connect the voltage regulator to the power supply, the voltage cables inside the micro usb cable needs to be attained by cutting the cable open and extracting the wires. The red wire is + and the black is -. It should look something like this: 

​

​

​

​

 

​

​

​

​

​

Make sure that the voltage regulator is calibrated correctly, the raspberry requires 5V, and it breaks if you use higher voltage. 

Now that the physical setup is done, it is time for the software!

GIPO.png
Image (3).jpeg
Image (4).jpeg
Image (8).jpeg
Image (1).jpeg
Image (2).jpeg
Image (5).jpeg
Image (7).jpeg

Software

First, install the operating system for the raspberry pi, raspberrian. There are many tutorials online, this one for example. Then, we need to make it so that the raspberry properly can extract SCL and SDA data. Start by entering this command prompt in the terminal: 

sudo raspi-config 

 

select option 5 – Interfacing Options 

select option P5 – I2C 

select “Yes” for all the questions and reboot the Pi 

sudo reboot 

 

We have prepared a github with all the software needed to collect and send data from the raspberry pi. In order to access the software, you need to install git on the raspberry pi. Do this by entering these commands in the terminal: 
 
sudo apt-get update 

sudo apt-get install git 

Download the software by entering this command: 

git clone https://github.com/karlhal/pHil_the_gap 

navigate to the newly created directory pHil_the_gap_ 

cd pHil_the_gap_ 

before starting the main program, you need to make it executable. 

Do this by typing the following command: 
 

chmod +x pHil.sh 

Now everything is done! All you need to do is start the program by typing  

./pHil.sh 

The program will guide you through how to send data, calibrate, and execute a measurement. For calibration, you will need the 4 pH and 7 pH buffer solutions. 

Making the hardware

The first step of building the casing will be to cut out two circle-shaped wooden plates with the size of the inside of the end plug. Cut out the wooden board which will be the length of the inside of the pipe from the plug to the lid, minus the sum of the height of the two circle-shaped plates. These plates must namely also fit inside of the pipe. The breadth of the board will be the same as the inner diameter of the pipe, but make sure the end of it fits inside the plug.  

​

​

​

​

​

​

​

​

​

 

Drill a hole in both the plates as well as in the plastic plug. The size the hole does not need to be that precise, as long as the pH-sensor can easily fit through it and that the cable entry can be put over it. Drill the hole in the halves and not in the center of the plates, otherwise the hole will be blocked by the wooden board. Use two of the larger screws to attach one of the plates on the smaller end of the board. You can attach the board a bit to the side of the plates to save some space for the electronics on one side of the board. Make sure though to not cover the hole in the plate.

​

​

​

​

​

​

​

​

 

 

Use the other plate on the inside of the plug to attach the bottom of the cable entry to the outside of the plug. The cable entry must be in line with the holes but not cover them.

 

​

​

​

​

​

​

​

​

 

It’s now time to attach all the electronics to the board which can be done in different ways as long as everything fits, however an example of how this can be done is shown below. The Raspberry Pi and the pH meter have holes in them and can therefore be screwed on to the board using the small 2mm screws. The rest of the electronics will have to be attached by using other methods and here you can do as you like, but in this example, a strong sewing thread is used to tie the parts onto the board. This will not harm the electronics but is strong enough to keep in it place. When doing this, it’s important to also drill some holes in the board for the thread to make sure the parts stay in place and does not slide up or down. Other methods like gluing them or using cable ties are also possible. Rubber bands are actually used for the battery holder in the example below, to make it easy to take out the battery. Since these electronics are quite small and sensitive, we do not want to damage them. Therefore, we recommend putting small bits of furniture pads or rubber on the board where parts will be so that they don’t lie directly on the board but rather have small space between them. 

​

​

​

​

​

​

​

 

 

 

 

Again, exactly where you put all the parts on board does not really matter as long as everything fits good in the pipe, but an example can be seen below. 

​

​

​

​

​

​

​

​

 

 

 

When pressing in the plug in the pipe, it will help using some grease to get it in place. Without using anything, the O-rings will make it tough pressing them together. When the grease has dried out, the O-rings will hold the plug in place and make it waterproof. Put the pH sensor through the cable entry and the plug and buckle it by pressing down the top of the cable entry using its screw function. This will tighten the sensor and hold it in place. Now everything is done, and the sensor is ready to use. Be careful when taking the board out so that nothing damages. The result from the outside will look like the picture below. 

​

​

​

​

​

​

​

​

​

​

​

IMG_2211.HEIC
IMG_2213.HEIC
IMG_2212.HEIC
IMG_2214.HEIC
IMG_2216.HEIC
IMG_2221.HEIC
IMG_2218.HEIC

Potential challenges and how to get around them: 

There are some potential challenges connected to the pHil data gathering process. Since the sensor isn't up for sale but meant to be built it requires some skills. The building can be challenging since it includes detailed precision work and the assembly of electronics. The instruments include a lot of electronics such as the raspberry pi and therefore one of the most important matters is to make the casing water resistant. For a person who has no coding experience another challenge would be the programming of the software. This has been managed by very detailed descriptions and guidelines as well as a ready to use GitHub site. 

 

The main solution to these building and coding challenges is however solved by our choice of focus. By focusing on the diving community and the clubs and associations rather than the individual diver the responsibility and difficulties for the individual reduces drastically. A diving club- or association has greater opportunity to build the sensor - both from an economic and a knowledge-wise point of view.

bottom of page