Check out my first novel, midnight's simulacra!

InaMORAta: Difference between revisions

From dankwiki
No edit summary
Line 37: Line 37:


==Temps==
==Temps==
We want the water temperature, and ideally also our own temperature on the microcontroller.
We want the water temperature, and ideally also our own temperature on the microcontroller. The Uno's ATmega328P processor has an onboard temperature sensor:
 
===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 β of 3435K and a nominal temperature of 25℃. To effect a better read, we'll use the 3.3V as our reference. This requires hooking 3.3V up to AREF and calling <tt>analogReference(EXTERNAL);</tt>.
 
===Microcontroller===
The Uno's ATmega328P processor has an onboard temperature sensor:
<pre>
<pre>
int readTemp(void){
int readTemp(void){
Line 53: Line 47:
}
}
</pre>
</pre>
Unlike the Uno, it appears that the MEGA has no way to get its own temperature, lame.
===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 β of 3435K and a nominal temperature of 25℃. To effect a better read, we'll use the 3.3V as our reference. This requires hooking 3.3V up to AREF and calling <tt>analogReference(EXTERNAL);</tt>. We pair it with a reference 10KΩ resistor, and hook it up to 3.3V, ground, and analog input pin A0.


==Wiring==
==Wiring==