pH Level Measurement with pH Sensor

Introduction

This experiment demonstrates how to use a pH sensor to measure the acidity or alkalinity of a solution.

pH Sensor

Components Needed

Circuit Setup

  1. Connect the pH sensor’s VCC to 5V on the Arduino.
  2. Connect the output pin of the sensor to an analog input pin (e.g., A0).

The sensor will output an analog signal corresponding to the pH level.

pH Sensor Circuit Setup

Code for pH Level Measurement

Upload the following code to your Arduino to read pH levels:


const int phPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int phValue = analogRead(phPin);
  Serial.print("pH Level: ");
  Serial.println(phValue);
  delay(1000);
}
            

Explanation

The pH sensor provides an analog voltage proportional to the pH level of the solution being tested.

Troubleshooting