MyTongue Feels So Dry

MyTongue Feels So Dry © GPL3+

An introduction to moisture measurement.

  • 940 views
  • 0 comments
  • 6 respects

Components and supplies

a Tongue
or alternative a glass of water
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1
soil measurement sensor
×1

Apps and online services

About this project

Using Humidity Sensors

With the help of a humidity sensor more than just the moisture in the ground can be measured! It is also possible, for example, to determine the time for the next beer, namely when the tongue has a moisture content of less than 50%. For which applications is a humidity sensor used in your projects? Write to me!

About the Code

The code contains 2 examples, which differ only by 2 points:

  • The Wiring
  • A program line within the loop, whether the analog value is to be read continuously or the humidity is determined by a function with time delay. It is documented in the program code. Simply remove the characters // and comment out the other program line accordingly.

The biggest problem of a moisture sensor is oxidation. Corrosion is counteracted by electrolysis using a function. This function activates our Soil Moisture Sensor for 500ms, reads the current value, rotates the polarity, and deactivates the sensor.

The output of the values ​​is output in the serial monitor within the Arduino Web IDE.

Note that valid readings are obtained when both jags are wet with a liquid. What impact will the fertilizers, sugar, alternative sweeteners and especially alcohol have on the measurements? Volunteer!

Ready for next level: we control a water pump via a relay.

Code

soil measurementC/C++
    // read the value from a soil moisture sensor
    
    // PIN in Option "easy"
    // GND to GND 
    // VCC to 5 Volt
    
    // PIN in Option "anti_oxidation"
    int soilMoisturePin1 = 4;    // VCC not to 5 Volts - in this Option to Digital Output 4
    int soilMoisturePin2 = 3;    // GNG not to GND - in this Option to Digital Output 3
    int soilMoisturePin3 = A0;   // SIGNAL an einen Analog Pin vom Arduino Board
    int baudrate = 9600;
    
    // 1023 = 100% RAW-Wert is between 0 wet and 1023 dry on 5 Volt
    //  901 = 100% RAW-Wert is between 0 wet and  903 dry on VIN Volt
    //  672 = 100% RAW-Wert is between 0 wet and  672 dry on 3,3 Volt
    // The sensor returned 18% with RAW 188 when fully sunk into the water and light wave movements.
    const int dry = 1023;
    
    void setup() 
    {
      Serial.begin( baudrate );
      while(!Serial); //Waiting for Serial connection
      pinMode(soilMoisturePin1, OUTPUT);
      pinMode(soilMoisturePin2, OUTPUT);
    }
    
    int readSoilMoisture()
    // Das größte Problem eines Feuchtigkeitssensors ist Oxidation. Der Korrosion wird durch Elektrolyse entgegengewirkt mit dieser Funktion.
    // Diese Funktion aktiviert unseren Soil Moisture Sensor für 500ms, liest den aktuellen Wert aus, dreht die Polarität um und deaktiviert den Sensor wieder.
    // The biggest problem of a moisture sensor is oxidation. Corrosion is counteracted by electrolysis with this function.
    // This function activates our Soil Moisture Sensor for 500ms, reads the current value, rotates the polarity, and deactivates the sensor.
    
    
    {
    int value; 
    digitalWrite(soilMoisturePin1, HIGH);
    digitalWrite(soilMoisturePin2, LOW);
    delay(500); // es wird jede 0,5 sec gemessen - dies könnte auch deutlich seltener eingestellt werden
    value = analogRead(soilMoisturePin3);
    digitalWrite(soilMoisturePin1, LOW);
    digitalWrite(soilMoisturePin2, HIGH);
    delay(500);
    digitalWrite(soilMoisturePin2, LOW);
    return value;
    }

    void loop() 
    {
      // Option "easy": int value_water = analogRead(soilMoisturePin3); 
      int value_water = readSoilMoisture(); 
      String water = String((int)((((double)value_water/dry)*100.0)));//Convert Raw value to percentage. This is a generic calculation, depending on raw values from 0 to 1023. 
      Serial.print("Soil moisture: ");
      Serial.print(water);
      Serial.print("% Raw value: ");
      Serial.println( value_water );
      delay(3000);
    }

Comments

Similar projects you might like

I Keep my Cucumber Growing Conditions Moist

Project showcase by Ingo Lohs

  • 3,179 views
  • 0 comments
  • 22 respects

Get the Arduino Dice

by Ingo Lohs

  • 1,061 views
  • 0 comments
  • 4 respects

Master Slave I2C Connection

by PIYUSH_K_SINGH

  • 3,737 views
  • 0 comments
  • 8 respects

PIR-Sensor Activated RGB Strip Controlled by Uno R3

Project showcase by Ingo Lohs

  • 1,392 views
  • 0 comments
  • 5 respects
Add projectSign up / Login