 
 #include <OneWire.h>
 #include <DallasTemperature.h>
+#include <Time.h>
 
 // Digital pin to use for the 1-wire sensor bus
 #define ONE_WIRE_BUS 3


float tank_max_temp = 140;      // Deg. F; above this, pump is off
float collector_min_temp = 40;  // Deg. F; below this, pump is off
float on_threshold = 10;        // Deg. F differential before pump turns on
float off_threshold = 10;       // Deg. F differential before pump turns off
int interval = 60000;           // Delay in ms between readings

/*


  // Assume that very negative readings are errors
  if (tank_temp < -50 || collector_temp < -50) {
    Serial.println("# Screwy reading, ignoring");
  }

  // If tank is hot enough, pump is off
  else if (tank_temp >= tank_max_temp) {
    Serial.println("# Tank is over max temp, pump off");
    no_pump();
  }

  // If collector is cold, pump is off
  else if (collector_temp <= collector_min_temp) {
    Serial.println("# Collector is under min temp, pump off");
    no_pump();
  }

  // If collector is significantly hotter thank tank, pump is on
  else if (collector_temp > tank_temp + on_threshold) {
    Serial.println("# Collector is hotter than tank, pump on");
    pump();
  }

  // If collector is significantly colder than tank, pump is off
  else if (tank_temp > collector_temp + off_threshold) {
    Serial.println("# Collector is colder than tank, pump off");
    no_pump();
  }

