help needed! proof of concept: drink heater/ cooler

bar_buff:
To officialxian: That's just awesome. It really helps, thank you. Can I also hook up the temperature readings to a LCD screen?

I don't see why not. Same basic principle as if you wanted to write the temperature to the serial monitor. I don't know what you'd use for an LCD screen, but here's some code for writing the temperature to the Serial monitor every 10 seconds...

void updateTemp(){
  Serial.print("Current Temperature: ");
  Serial.println(temperatureC);  // prints the temperature
  delay(10000);  // wait 10 seconds
}

// just call updateTemp() inside of loop.

The only problem with this is that it would cause the checking of the temperature to only happen once every 10 seconds as well. This is because "delay(xx)" halts all activity by the board for xx milliseconds. Another possibility is to check the temperature once every x runs of loop. Here would be an example of that.

// Place this before anything else

int runs = 0

// Place this inside loop

if (runs == 100){  // if loop has been run 100 times...
  updateTemp();  // call void updateTemp()
}

void updateTemp(){
  Serial.print("Current Temperature: ");
  Serial.println(temperatureC);  // prints the temperature
  runs = 0;  // resets the run counter
}

Glad to be of help! :slight_smile: BTW, if you're going to be designing your own products, I'd look into learning more about Arduino. It can be useful is almost endless ways. :slight_smile: