Add A PH Sensor

Aquarium style BNC connector hobby PH probes.

Atlas Scientific (left) ($20.00 Ebay) and a typical Chinese manufactured underwater PH probe (right) ($7.00 Ebay). Both produce a slightly higher or lower output micro-voltage when submerged in various PH in a somewhat linear fashion. Usually PH higher than 7 produce a positive voltage, and below 7, a negative. A sensor board (see below) will offset the voltages to higher positive values. The Atlas, claimed to be commercial grade, has a slightly larger output range, so is probably the most accurate. Both last a long time even when permanently submerged.

Kits often come with PH buffer solution packets for calibrating; or buffer solutions or packets can be bought separately. The most typical values are: 9.18, 6.86 and 4.01.

The PH4205C, a typical affordable BNC probe analog output PH sensor board.

The board converts the microvolt signal produced by the BNC connector PH probe to an analog 0 to 5V output.

Board Connections:

PH Probe to the BNC connector.

V+ connect to +5v.

G and G, board and probe ground (connect to ground).

PO (probe output), connect to A0 or voltage divider network.

As the Node MCU ESP8266 only reads up to 3.6V, run the PO output through a voltage divider network. I cut the output in half as illustrated using two 470 Ohm resistors.

Calibrate your board

Connect a pin from the BNC center connector to the BNC shield, and turn the offset trimpot to produce an output of 2.5 volts as read by the NodeMCU.

You could use this code and monitor the voltage outputs in the serial monitor window:

Calculate the equation of a line from the two PH to Voltage readings. Here's a calculator to generate the equation. Hard to find online lately, so I wrote this one. Measure the voltage output of the PH sensor using two known PHs.

Replace the line in the above code with this slope and intercept calculated here. Or here's an Arduino code that will calculate the line for you, as well as monitor the probe when you are finished. Replace the PH1, V1, PH2, and V2 slots with your calibration readings.

Good Tutorial: https://scidle.com/how-to-use-a-ph-sensor-with-arduino/

Instructable for making a PH meter using the Arduino Analog Gravity PH sensor board: https://www.instructables.com/ARDUINO-PH-METER/ Board available at https://store.arduino.cc/usa/gravity-analog-ph-sensor