Categories
TUTORIALS

Now let’s check your drinking water: is the pH safe?

This tutorial will teach us how to use a pH sensor and LCD display with Arduino UNO to measure the pH of a liquid solution, and also make the value shows on the screen.

The pH scale is used to measure the acidity and basicity of a liquid. It can have readings ranging from 1-to 14 where 1 shows the most acidic liquid and 14 shows the most basic liquid. 7 pH is for neutral substances that are neither acidic nor basic. For drinking water, the U.S. Environmental Protection Agency recommends that municipal drinking water suppliers keep their water supply at a pH of 6.5 to 8.5.

Is the water coming from your tap really healthy to drink? After this tutorial, you can know the pH value of whatever you are drinking, and whether your tap water is safe!

Required components

How does it work?

  • Teyleten Robot pH sensor

This analog pH sensor is designed to measure the pH value of a solution and show the acidity or alkalinity of the substance. It is commonly used in various applications such as agriculture, wastewater treatment, industries, environmental monitoring, etc. The module has an on-board voltage regulator chip that supports the wide voltage supply of 3.3-5.5V DC, which is compatible with 5V and 3.3V of any control board like Arduino. The output signal is being filtered by hardware low jitter.

The sensor consists of two parts: Signal Conversion Module and pH electrode (as shown below).

pH Signal Conversion Board
pH Electrode

The pH Electrode looks like a rod usually made of a glass material having a tip called “Glass membrane”. This membrane is filled with a buffer solution of known pH (typically pH = 7). This electrode design ensures an environment with the constant binding of H+ ions on the inside of the glass membrane. When the probe is dipped into the solution to be tested, hydrogen ions in the test solution start exchanging with other positively charged ions on the glass membrane, which creates an electrochemical potential across the membrane which is fed to the Signal Conversion Module. The signal conversion module read the voltage, and then in the code, it will be converted to pH value.

  • LCD display

We connect the LCD display with the pH sensor using a breadboard, we connect a potentiometer to pin VO to adjust the contrast of the LCD screen.

Circuit/wiring

Here, we recommend you connect your LCD display and potentiometer to Arduino UNO first then connect the Signal Conversion Module, after calibration (which will be covered in the following content) you could connect the pH Electrode.

Circuit diagram drawn in Fritzing

Code

It is really crucial to calibrate the sensor before we actually use it to measure the test solution. First you should make sure the pH value is in the correct range, for this step, you will need a wire to short the external part and the center of the probe connector on the Signal Conversion Module. This causes a 2.5 volts tension on the Po analog output pin. Because a pH of 7 means 2.5 Volts, so if the output value in this step is not 2.50, then you can set it to 2.50 using the trimmer.

short the external part and the center of the probe connector
  • pH Sensor Calibration Arduino Code:

The pH Sensor is almost calibrated! Next, you should run the code below to test the solution in the small container of the pH Electrode, since that solution is the distilled water, you should have the output pH value around 7.0, so if you feel the value is still not accurate enough, you could adjust it in the calibration_value. Now the the pH Sensor is calibrated perfectly under your standard!

  • The complete code to measure and display the pH value:
Example picture

You now can measure the pH of any solution of your interest!

References:

https://circuitdigest.com/microcontroller-projects/arduino-ph-meter

https://www.electroniclinic.com/ph-meter-arduino-ph-meter-calibration-diymore-ph-sensor-arduino-code/#pH_Meter_Arduino_Description

https://circuitdigest.com/microcontroller-projects/arduino-ph-meter

Leave a Reply

Your email address will not be published. Required fields are marked *