InaMORAta: Difference between revisions

Line 38: Line 38:


==Temps==
==Temps==
We want the water temperature, and ideally also our own temperature on the microcontroller.
===External (thermistor)===
===External (thermistor)===
We're using an [https://www.alphacool.com/shop/monitoring-controlling/temperature-sensor/21456/alphacool-eiszapfen-temperature-sensor-plug-g1/4-chrome Alphacool Eiszapfen 17365] plug sensor. Its datasheet can be found [https://www.alphacool.com/download/kOhm_Sensor_Table_Alphacool.pdf here]. This is a 10kΩ thermistor (resistance varies with temperature) with a B of 3435K.
===Microcontroller===
===Microcontroller===
The Uno's ATmega328P processor has an onboard temperature sensor:
<pre>
int readTemp(void){
  ADCSRA |= _BV(ADSC);
  while(bit_is_set(ADCSRA, ADSC)){
    ;
  }
  return (ADCL | (ADCH << 8)) - 342;
}
</pre>


==Wiring==
==Wiring==