# reef-pi Guide 6: pH Monitoring

## Overview 

Welcome to the sixth guide in [reef-pi aquarium monitoring project series](https://learn.adafruit.com/search?q=reef-pi). In this part, we'll learn how to use reef-pi to monitor aquarium pH. Corals are sensitive to pH, and most tropical corals thrive in pH range of 7.6 to 8.4. Due to the high CO<sub>2</sub> in the indoor air and various other biological factors in the aquariums, maintaining stable pH is one of the main concerns in reef keeping. Stony corals require calcium and alkalinity additives for their skeletal growth. But it is relatively hard to increase alkalinity without decreasing pH. Hence pH is monitored closely and use as an indicator to decide how much calcium and alkalinity supplement is safe.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/062/601/medium800/sensors_acropora_vermiculata_2.jpg?1538030644)

For example, Acropora (a type of stony coral ) is one of the most popular coral in the reef keeping community. They are relatively harder to keep due to their strict requirements (precise water chemistry, strong flow, strong light), but once provided with the appropriate&nbsp;environment can grow rapidly and shows a myriad of color morphs. pH monitoring and automated dosing (covered in next guide) are two useful equipment in the husbandry of hard to keep corals such as Acropora.

We are building a simple standalone&nbsp;pH monitor, with only pi zero and pH probe circuit from atlas scientific is used. A small clear case housing is used to mount all the electronics. This build will monitor a reef aquarium water pH continuously. This will allow us to visualize the daily pH cycle and alert when it&nbsp;goes out of range.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/697/medium800/sensors_2794B31C-5B12-4558-A997-243B6DA8F9FE.jpeg?1538264532)

# reef-pi Guide 6: pH Monitoring

## Parts

I am listing all the electronics component required for the build, excluding pH probe and calibration solutions. pH probes can be found either in [Atlas Scientific website](https://www.atlas-scientific.com/ph.html) or any of the popular marine aquarium vendor website such as [Bulk Reef Supply&nbsp;](https://www.bulkreefsupply.com/)or [Marine Depot&nbsp;](https://www.marinedepot.com)most pH probes are interchangeable (as long as they use BNC connector), just make sure to get a saltwater friendly probe.

### Part: Raspberry Pi
quantity: 1
Raspberry Pi zero
[Raspberry Pi](https://www.adafruit.com/product/3400)

### Part: Perma Proto board
quantity: 1
Mint tin size perma proto board
[Perma Proto board](https://www.adafruit.com/product/723)

### Part: Male header pins
quantity: 1
Male header pin
[Male header pins](https://www.adafruit.com/product/3002)

### Part: Female headers
quantity: 1
Female headers
[Female headers](https://www.adafruit.com/product/598)

### Part: EZO pH circuit
quantity: 1
Atlas Scientific EZO pH circuit
[EZO pH circuit](https://www.amazon.com/dp/B00641R1PQ/)

### Part: BNC Connector and carrier board
quantity: 1
BNC connector and carrier board
[BNC Connector and carrier board](https://www.atlas-scientific.com/product_pages/components/single_carrier_iso.html)

### Part: 5V power adapter
quantity: 1
Power adapter
[5V power adapter](https://www.adafruit.com/product/276)

### Part: Barrel jack
quantity: 1
Panel mount barrel jack
[Barrel jack](https://www.adafruit.com/product/610)

### Part: Enclosure
quantity: 1
Plastic enclosure for the build
[Enclosure](https://www.amazon.com/dp/B0725ZQGVP)

### Part: Female-Female jumper wire
quantity: 1
Female female jumper wire
[Female-Female jumper wire](https://www.adafruit.com/product/794)

### Part: Nylon standoffs
quantity: 1
Nylon standoffs
[Nylon standoffs](https://www.adafruit.com/product/3658)

![](https://cdn-learn.adafruit.com/assets/assets/000/062/706/medium800/sensors_F46BE4ED-01CC-4B5D-9D2B-A119A0B14E2E.jpeg?1538264949 AtlasScientific EZO board for pH sensors)

# reef-pi Guide 6: pH Monitoring

## Circuit Construction

A pH monitoring circuit is one of the simplest circuits to construct in reef-pi. Here is a general overview of the connections: Raspberry Pi's I2C pins (SDA and SCL) is connected to the EZO circuit, along with power (5V) and GND connection. You can find more details in official Atlas Scientific [wiring guide](https://www.atlas-scientific.com/files/ezo-ph-wiringdiagram.pdf)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/232/medium800/sensors_Screen_Shot_2018-11-05_at_8.38.26_AM.png?1541435950)

It is recommended to use two 4.7K pull up resistor for SDA and SCL connections. We'll use a Mint tin&nbsp;size Perma Proto board to create 5V and GND rails and to mount male/female headers where Pi, EZO and input power will be connected. Here is a Fritzing breadboard view of the entire setup

![](https://cdn-learn.adafruit.com/assets/assets/000/065/327/medium800/sensors_Screen_Shot_2018-11-08_at_6.29.12_AM.png?1541638795)

I am using yellow solid core wire to denote SDA pin and green solid core wire to denote SCL pin. Female header pins are soldered to mount the EZO board and BNC connector.

Ignore the red solid core wire at the bottom, it was soldered by mistake. Also, there are four female headers at the bottom to connect BNC connector, but only the three rightmost ones are used.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/227/medium800/sensors_07B76424-367D-433B-BE82-2E5AAB5FBC75.jpeg?1541404548)

EZO board attached to the female headers

![](https://cdn-learn.adafruit.com/assets/assets/000/065/228/medium800/sensors_AE5B1823-C9F5-455B-AFDF-479008F8E6E6.jpeg?1541404573)

And the entire circuit, including BNC connector. Note: I am using just BNC connector here, but I recommend using the ones with carrier board for voltage isolation (linked in the parts list)

![](https://cdn-learn.adafruit.com/assets/assets/000/062/699/medium800/sensors_B9DE5B48-DC0F-447D-BC67-D79E0765EF00.jpeg?1538264617)

That's&nbsp;it, next we'll move on to fabricating the enclosure

# reef-pi Guide 6: pH Monitoring

## Building the Housing

We are using a small clear top plastic enclosure to house the entire circuit including the Raspberry Pi. Start with drilling holes for mounting the BNC connector and barrel jack (for input power supply) on the bottom side of the enclosure

![](https://cdn-learn.adafruit.com/assets/assets/000/062/700/medium800/sensors_A7B5A4DF-1533-4F4E-8386-B7013BDB2C4E.jpeg?1538264668)

Mark and drill holes to mount the Perma Proto board and Raspberry Pi Zero. The Raspberry Pi Zero will be mounted on the top panel, while the Perma Proto board will be mounted in the center. Use nylon standoffs to mount the Raspberry Pi and the Perma Proto boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/701/medium800/sensors_A3000391-C169-4619-A929-6BA979A6D9BF.jpeg?1538264716)

Raspberry Pi mounted

![](https://cdn-learn.adafruit.com/assets/assets/000/062/702/medium800/sensors_119CCCA5-8BCA-4857-8A5F-56ACC8C392EE.jpeg?1538264746)

Next mount the Perma Proto board and BNC connector.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/704/medium800/sensors_28DA1B18-EEDD-499A-9D60-36F4FA937A6E.jpeg?1538264812)

Next mount the barrel jack (make sure to tin it and solder female jumper wires).&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/065/229/medium800/sensors_1F8761DD-5AF5-492D-B1DC-3E79101D01C3.jpeg?1541404620)

After that,&nbsp;connect all the components with female-female jumper wire. There will be four wires for the Pi Zero, 5V, GND, SDA and SCL.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/705/medium800/sensors_DE4CB68A-6807-49AF-AFBC-6236002C19B4.jpeg?1538264841)

The build is complete at this point, screw on the top panel and proceed to configuration and testing.

# reef-pi Guide 6: pH Monitoring

## Configuration and Calibration

Once the housing and circuit is completed, plug in the pH probe in BNC connector and power up reef-pi and head over to the UI. If you are not familiar with reef-pi installation and UI, refer to the [first guide in this series](https://learn.adafruit.com/reef-pi-installation-and-configuration) for details.

Navigate to the pH tab, and create a new probe by clicking the "+" sign. By default EZO circuit has I2C address of 0x99, unless you are changing it, keep it as it is. Add the probe in disable state.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/242/medium800/sensors_Screen_Shot_2018-11-05_at_9.44.33_AM.png?1541439894)

Before using pH probe, we have to calibrate it. Depending upon what calibration solutions you are using choose the appropriate value and hit "Run". reef-pi allows one, two or three point calibration. Calibration is not an absolute requirement, but a highly recommended step before usage.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/243/medium800/sensors_Screen_Shot_2018-11-05_at_9.45.40_AM.png?1541439987)

Once calibrated, enable the probe and reef-pi will start monitoring your tank pH. The readings can be viewed in the reef-pi dashboard directly. If you have enabled [adafruit.io](https://io.adafruit.com), reef-pi will send the same data there as well and you can create dashboard there. Here is an example of my reef aquariums pH cycle.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/241/medium800/sensors_Screen_Shot_2018-11-05_at_9.43.20_AM.png?1541439830)

Now our reef-pi pH monitor is calibrated and operational. In next guide, we'll build a dosing system, and use the pH monitor as our guiding force to deduce the appropriate dosing amount of different chemical additives. Thank you and see you in the next part in this series


## Featured Products

### Raspberry Pi Zero WH (Zero W with Headers)

[Raspberry Pi Zero WH (Zero W with Headers)](https://www.adafruit.com/product/3708)
If you didn't think that the Raspberry Pi Zero W could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero WH&nbsp;** offers all the benefits of the Pi Zero W, but with one big difference – a **pre-soldered GPIO...**

In Stock
[Buy Now](https://www.adafruit.com/product/3708)
[Related Guides to the Product](https://learn.adafruit.com/products/3708/guides)
### Adafruit Perma-Proto Mint Tin Size Breadboard PCB

[Adafruit Perma-Proto Mint Tin Size Breadboard PCB](https://www.adafruit.com/product/723)
Making a project that will fit into an "Altoids" Mint Tin? Put down that PCB shear and pick up a Perma-Proto in the new exciting minty shape!  
  
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: its always crummy quality, with...

In Stock
[Buy Now](https://www.adafruit.com/product/723)
[Related Guides to the Product](https://learn.adafruit.com/products/723/guides)
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)
### Panel Mount 2.1mm DC barrel jack

[Panel Mount 2.1mm DC barrel jack](https://www.adafruit.com/product/610)
This power jack is designed to easily attach to a panel up to 8mm thick (0.315" or 5/16") and fit 2.1mm power plugs snugly and securely. Perfect for adding a power connector to your project enclosure. We like this jack in particular for its long body (so you can use it on thicker...

In Stock
[Buy Now](https://www.adafruit.com/product/610)
[Related Guides to the Product](https://learn.adafruit.com/products/610/guides)
### Premium Female/Female Jumper Wires - 40 x 3" (75mm)

[Premium Female/Female Jumper Wires - 40 x 3" (75mm)](https://www.adafruit.com/product/794)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 3" (75mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" female header contacts on either end and fit cleanly next to each...

In Stock
[Buy Now](https://www.adafruit.com/product/794)
[Related Guides to the Product](https://learn.adafruit.com/products/794/guides)
### White Nylon Machine Screw and Stand-off Set – M2.5 Thread

[White Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3658)
Totaling 420 pieces, this **White Nylon&nbsp;M2.5 Screw Set** &nbsp;is a must-have smörgåsbord for your workstation.&nbsp;You'll have more than enough screws, nuts, and hex standoffs to construct&nbsp;your maker projects&nbsp;for days on end! M2.5 screws fit nearly...

In Stock
[Buy Now](https://www.adafruit.com/product/3658)
[Related Guides to the Product](https://learn.adafruit.com/products/3658/guides)
### Short Feather Male Headers - 12-pin and 16-pin Male Header Set

[Short Feather Male Headers - 12-pin and 16-pin Male Header Set](https://www.adafruit.com/product/3002)
These two&nbsp; **Short** &nbsp; **Male&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

<p...></p...>In Stock
[Buy Now](https://www.adafruit.com/product/3002)
[Related Guides to the Product](https://learn.adafruit.com/products/3002/guides)
### 36-pin 0.1" Female header - pack of 5!

[36-pin 0.1" Female header - pack of 5!](https://www.adafruit.com/product/598)
Female header is like the duct tape of electronics. Its great for connecting things together, soldering to perf-boards, sockets for wires or break-away header, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of five!  
<br...></br...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/598)
[Related Guides to the Product](https://learn.adafruit.com/products/598/guides)

## Related Guides

- [Breadboards for Beginners](https://learn.adafruit.com/breadboards-for-beginners.md)
- [Meowsic Cat Piano Line Out](https://learn.adafruit.com/meowsic-line-out.md)
- [The MonkMakes Plant Monitor and CircuitPython](https://learn.adafruit.com/monkmakes-plant-monitor-and-circuitpython.md)
- [TVA Pruning Baton from Loki](https://learn.adafruit.com/tva-pruning-baton-from-loki.md)
- [Adafruit LPS28 Pressure Sensor](https://learn.adafruit.com/adafruit-lps28-pressure-sensor.md)
- [reef-pi Guide 4: Water Level Controller](https://learn.adafruit.com/reef-pi-water-level-controller.md)
- [Face Mask Efficacy Testing with SCIENCE!](https://learn.adafruit.com/raspberry-pi-camera-vision-face-mask-efficacy-testing.md)
- [Adafruit SEN54 or SEN55 Adapter Breakout](https://learn.adafruit.com/adafruit-sen54-or-sen55-adapter-breakout.md)
- [Feather TFT STEMMA Case](https://learn.adafruit.com/feather-tft-stemma-case.md)
- [Digital Egg Drop Experiment with CLUE](https://learn.adafruit.com/egg-drop-clue.md)
- [Sensors in MakeCode](https://learn.adafruit.com/sensors-in-makecode.md)
- [reef-pi Guide 3: Temperature Controller](https://learn.adafruit.com/reef-pi-guide-3-temperature-controller.md)
- [Adafruit USB Power Gauge Mini-Kit](https://learn.adafruit.com/adafruit-usb-power-gauge-mini-kit.md)
- [Adafruit Triple Axis Gyro Breakout](https://learn.adafruit.com/adafruit-triple-axis-gyro-breakout.md)
- [Adafruit Swirly Aluminum Mounting Grid for 0.1" Spaced PCBs](https://learn.adafruit.com/swirly-grid.md)
