Hydration Meter

Hydration Meter

Category: Water
Communication: None, WiFi
Components: Internal
Created By: Gouri Lekshminarayanan
Difficulty Level: Beginner, Expert
Input Sensor: https://www.notion.so/Moisture-sensor-792662b0800f4daf9516b4e6e3c251ae
Microcontroller: Arduino UNO
Output Device: https://www.notion.so/LCD-screen-a1d6725d214448e08e68217ba38d3236
Status: Complete

The hydration meter is a tech-based solution that checks if you are dehydrated or hydrated well by testing urine.

It nudges users to drink adequate water by helping them monitor their hydration levels.


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


Questions you need to ask

Get data. Examples:

  • What does urine consist of?
  • How does hydration or dehydration affect people - children/adults?
  • How can hydration be measured?
  • What are the acceptable ranges/values of hydration?

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

  • Who is the user?
  • How old is the user?
  • Can the user read and/or understand the implication of the hydration level displayed?
  • How far is the toilet from the user?
  • How many times a day would they normally use the toilet?
  • Does the user recognise dehydration as a problem?
  • What is stopping the user from recognising the problem and taking action?

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 hydration level of user, or is it to get the user to take active measures to stay hydrated?
  • Does the user have access to adequate potable water to increase their hydration level?
  • How can it be ensured that the user has access to enough water?
  • Where should the hydration meter be placed in order to measure hydration level of children/adults/men/women?

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.
  • multicolour LED that blinks red when hydration is low, or green when user is adequately hydrated.
  • 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.


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 : Hydration Meter
       Input Sensor   : Moisture Sensor
       Output Device  : Multicolor LED, LCD screen
       Libraries Used : LiquidCrystalPCF584 ,FastLED
    #include <LiquidCrystal_PCF8574.h>
    LiquidCrystal_PCF8574 lcd(0x3F); //Change accordingly
    #include <FastLED.h>
    #define DATA_PIN 9// Digital pin number for LED (NeoPixel)
    #define NUM_LEDS 3
    CRGB leds[NUM_LEDS];
    int sensor_pin = A0;
    void setup()
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
      leds[0] = CRGB::Black;
      lcd.begin(16, 2);
      lcd.home(); lcd.clear();
      lcd.print("Hydration Meter");
    void loop()
      int output = analogRead(sensor_pin);
      lcd.setCursor(0, 0);
      lcd.setCursor(9, 0);
      if (output > 0 && output <= 400) // Moisture is Wet
        leds[0] = CRGB::Red;
        lcd.setCursor(0, 1);
        lcd.print("U're hydrated :-)");
        leds[0] = CRGB::Red;
        lcd.setCursor(0, 1);
        lcd.print("Drink Water");
  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 dehydrated urine (it should be yellow in colour). If the LCD screen output is “Drink Water”, the prototype is working. Also, take a hydrated urine sample (it should be almost clear, taken from a person who does not have beverages like coffee, tea or electrolytes like coconut water or glucose). If the LCD screen output is “U’re Hydrated”, the prototype is working.

  7. Hang the Solution Box on the wall at a suitable distance from the toilet bowl. To check if the distance is suitable,

  • Make sure that the moisture sensor comes into contact with only urine sample, and the toilet bowl is not leaking flush water on the sensor.
  • Make sure that the wires and the SNT kit do not get wet.
  • the wires/power adapter wire should not be too taut.


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 hydration level through the solution?
    • Is there any way to collect data to prove that their hydration patterns have changed because of 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!