dankamongmen / counterforce

leet monitoring tool for schwarzgerät, running on its 5.5" amoled frontpiece
GNU General Public License v3.0
3 stars 1 forks source link

read water temperature sensor from arduino MEGA #1

Closed dankamongmen closed 2 years ago

dankamongmen commented 2 years ago

we've got code in our MEGA fan4pwm for reading the thermal sensor, but we've not currently got anything hooked up. get the necessary resistor hooked up, and drive the thermal sensor. note that it can work off 3.3V rather than 5V and probably provides cleaner reads there, so put 3.3 into AREF and use that.

dankamongmen commented 2 years ago

ok, i've got it wired up (though not using AREF), and i think we're reading the correct temp (i'm seeing a steady 25.01; the nearby DiyHZ sensor displays 25.1 and 25.2). but...i think we were somehow reading a very similar temp before? like maybe this is the 0 reading or something, given beta of 3435 and nominal 25....oh also our code specifies 3.3V currently =\

dankamongmen commented 2 years ago

changing VREF from 3.3 to 5 still gives us 25.01...something is funny here

dankamongmen commented 2 years ago

we're reading a "raw voltage" of 503...what exactly does that mean? using INPUT_PULLUP chasnges the read from ~504 to ~574 and 25.01 to 24.96. i don't think either is right.

dankamongmen commented 2 years ago

we take that raw voltage and scale it by VREF/1023. 3.3V changes 2.46 to 1.63, and 25.01 to 25.00.

meanwhile, the DiyHZ has been reporting steadily warmer coolant, now at 25.6 (up from 25.1 at the beginning)

dankamongmen commented 2 years ago

i've hooked up 3.3V to AREF and moved there from 5V.

steady at 25.00.

dankamongmen commented 2 years ago

using stress-ng i've got coolant up above 26C...no 25.00 change, and raw has only increased to 510.

dankamongmen commented 2 years ago

i'm wondering if the sensor isn't actually immersed in the coolant. maybe we need to move it to the side from the top? the raw read simply isn't changing along with the other temperature changes we see. i think either the sensor is broken, or it's not immersed in the coolant, probably the latter.

dankamongmen commented 2 years ago

ok i think we're reading correctly, and just need move the sensor. code looks complete.