Water Salinity Tester

Water Salinity Tester

Category: Water
Communication: None
Components: Internal
Created By: Sairam Problem Solver
Difficulty Level: Beginner
Microcontroller: Arduino UNO
Output Device: https://www.notion.so/Buzzer-b6ba1f7e0632499fbaf9c779ee09ee3d
Status: Complete

The water salinity tester is a tech-solution to test salt content in water by measuring its conductivity.

It can help identify which water sample is relatively purer.

Discover

Refer to the first booklet Discover in the Solve Ninja Techno Kit for information on the components available with the Solve Ninja Techno Kit.

Things you need


Investigate

Questions you need to ask

Get data. Examples:

  • What does Water consist of?
  • How does salinity affects our people - children/adults health?
  • How can salinity be measured?
  • What are the acceptable ranges/values of salinity in drinking water?

What are the things you need to learn about the user? Examples:

  • Who is the user?
  • How old is the user?

What are the things you need to think about to implement the solution and solve the problem? Examples:

  • Why is it a problem?
  • Is the objective of the solution to only test salinity level of use water, or is it to get the user to take active measures to stay hydrated?

This will help the Solve Ninja decide what output device to use, for example-

  • buzzer with a loud beeeep or a gentle music (like a water filter) if the user has to be alerted when hydration level is low.
  • multicolor LED that blinks red when water is saline and vice versa.
  • LCD screen that displays some encouraging message, or hydration level of the user.
  • RFID or equivalent ID system to track and store user’s hydration levels over a period of time.

Refer to the second booklet Investigate in the Solve Ninja Techno Kit for information on which Input sensors and Output devices to use.


Solve

Refer to the third booklet Solve in the Solve Ninja Techno Kit for information on making connections and Arduino IDE.

Steps to follow

  1. Take the Solution Box from the Solve Ninja Techno Kit.
  2. Connect the 4 pin wire connector to the PCB in the port named “Moisture Sensor”.
  3. Connect the moisture sensor (comparator) to the 4 pin wire connector.
  4. Connect the moisture sensor (comparator) to the electrodes using 2 pin wire connector.
  5. Connect one end of the USB cable to Arduino and other to Computer/laptop.
  6. Plug in one end of the power adapter to the DC jack, and the other end to a power socket.

You will need 9V-1A power supply for using this kit. It will not work with the USB cable alone.

  1. Switch on the Solution Box.

  2. Open Arduino IDE on computer/laptop.

  3. Download, Copy, Paste code from here to the Arduino IDE.

  • Click here for the code.

    
    /* Prototype Name : Water Salinity Tester
       Input Sensor   : Moisture Sensor
       Output Device  : LCD, Multicolor LED
       Libraries Used : LiquidCrystalPCF584 ,FastLED
    */
    #include <LiquidCrystal_PCF8574.h>
    LiquidCrystal_PCF8574 lcd(0x27); //Change according to address on LCD 
    #include <FastLED.h>
    #define DATA_PIN 9// Digital pin number for LED (NeoPixel)
    #define NUM_LEDS 3
    CRGB leds[NUM_LEDS];
    int sensor_pin = 0;
    int output;
    void setup()
    {
      Serial.begin(9600);
      delay(2000);
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
      leds[0] = CRGB::Black;
      FastLED.show();
      lcd.begin(16, 2);
      lcd.setBacklight(255);
      lcd.home(); lcd.clear();
      lcd.print("Water Test");
      delay(1000);
    
    }
    
    void loop()
    {
      output = analogRead(sensor_pin);
      delay(500);
      lcd.setCursor(0, 0);
      lcd.print("Val:    ");
      lcd.print(output);
      salt_test();
    
    }
    
    void salt_test() {
      if (output > 0 && output <= 300) // High salt, hence, high conductivity.
      {
    
        leds[0] = CRGB::Red;
        FastLED.show();
    
        lcd.setCursor(0, 1);
        lcd.print("Not pure water");
      }
      else if (output > 300 && output < 600) // Low salt, hence, low conductivity.
      {
        leds[0] = CRGB::Green;
        FastLED.show();
        lcd.setCursor(0, 1);
        lcd.print("Pure water    ");
    
      }
      else
      {
        leds[0] = CRGB::Blue; // Sensor value does not fall within given range, so sensor is not in contact with water.
        FastLED.show();
    
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Water Game:");
        lcd.setCursor(0, 1);
        lcd.print("Dip sensor    ");
      }
    }
    
  1. Then Check for Tools→ Board→ Port in the IDE.

  2. Compile and Upload the code.

  3. Disconnect USB cable.

  4. Switch off the Solution Box.

  5. Switch on the Solution Box.

  6. Test by dipping the moisture sensor (electrode) in a sample of saline water and you will observe the buzzer beeps. This is because of the conducting nature of salts. Then, dip the moisture sensor electrode in the sample of drinking water. Here you will not hear the buzzer sound. This helps to distinguish between drinking (potable) and non-potable water.

Share

Refer to the fourth booklet Share inside the Solve Ninja Techno Kit to know how you can share your solution.

  • Locally: Once you install the solution in a toilet, observe how the user interacts with the hydration meter. Talk to them about the solution and learn what they think of it.
    • Do they keep track of their lake water pH levels through the solution?
  • Globally: Share your solution on the Solve Ninja App, and inspire 5 of your friends to take similar action. Continue collecting data; real victory is when your users realise the importance of staying hydrated and take action!