 #include <Time.h>
 
-const int relaisPin =  11;
+const int relayPin =  11;
 const int sensorPin = A0;    // select the input pin for the potentiometer
 const int MINHUMIDITY = 0;
 const int MAXHUMIDITY = 1023;
 const int milliseconds_sleep = 5000;
 const int avg_decay = 0.00001;
 const int deviation_decay = 0.01;
-int sensorValue = 0;  // variable to store the value coming from the sensor
 int thresholdLow = 0;
 int thresholdHigh = 0;
 int avg = 0;

int startup_seconds = 900; // sensor needs to settle for 15 minutes

int get_humidity() {
  sensorValue = analogRead(sensorPin);
  
  // sensor value is high when humidity is low, this is
  // counterintuitive (it's a dryness sensor!), so we

void setup() {
  // initialize the 11 pin as an output:
  Serial.begin(9600);
  pinMode(relayPin, OUTPUT);
  pinMode(sensorPin, INPUT);
  digitalWrite(relayPin, HIGH);
  avg = get_humidity();
}

