Salinity Sensor for Water Quality

Introduction

This experiment demonstrates how to measure the salinity of water using a salinity sensor connected to an Arduino.

Salinity Sensor

Components Needed

Circuit Setup

  1. Connect the salinity sensor's VCC and GND pins to the 5V and GND pins on the Arduino.
  2. Connect the sensor's output pin to an analog input pin (e.g., A0) on the Arduino.

The salinity sensor detects the conductivity of the water, which is related to its salinity.

Salinity Sensor Circuit Setup

Code for Salinity Measurement

Upload the following code to your Arduino to measure salinity:


const int salinityPin = A0;

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

void loop() {
  int salinityValue = analogRead(salinityPin);
  Serial.print("Salinity: ");
  Serial.println(salinityValue);
  delay(1000);
}
            

Explanation

The sensor measures the conductivity of water, which changes with its salinity level. The Arduino reads this value and outputs the salinity level.

Troubleshooting