Testing FC-28 Hygrometer with Arduino

A simple sketch to check what the values are that are recorded on the analog pins of one or more FC-28 Hygrometer(s), it might work with any other sensor that delivers analog output as well. In respect to the Hygrometer you might record the values it gives when dry and when soaked/wet. Then you can use those to calculate the trigger values for your own sketch. These units tend to corrode which does affect the values produced so this sketch can be used to recalculate them.

fc28fc28sketch

//Sketch to test for analog hygrometer values with FC28 Hygrometer
//for one or more FC28 units. Output is visible through serial monitor.

//This code is free to use.
//Author : Eugene Dullaard
//https://eugene.dullaard.nl/?p=690

//Setting variables
int analogStartPin = 0;  //Analog Start Pin, usually 0 for A0.
int units = 3;           //Amount of FC28 units to test,
                         //these units need to be connected on
                         //the analog ports following StartPin.
//temp variables
int x;
int y;

void setup (){
  Serial.begin(9600);
  Serial.println("Soil moisture sensor input");
}

void loop ()
{
  Serial.println();

  for (x = analogStartPin; x < analogStartPin + units; x++) {
    y=analogRead(x);
    Serial.print("Analog "); Serial.print(x); Serial.print(":");
    Serial.println(y);
  }

  delay (1000);
}

Leave a Reply

Your email address will not be published. Required fields are marked *