Jump to content
  • entries
  • comments
  • views

New PC - upgrade, part 5



The Corsair XD5 reservoir + pump includes a temperature sensor which screws into one of the inlet ports.  As my motherboard doesn't have a header I could plug it into and I wasn't interested in spending ~$100 on a Corsair Commander. So I just left it (along with the RGB connector) disconnected.


However, there are advantages to measuring the temperature of the water rather than components.  One of the benefits of water cooling is the water has a very high thermal mass.  This means the water takes a long while to heat up and will tend to even out any temperature spikes.  So while the CPU & GPU temperature sensors can be used to control the fans, it would be preferable to use the water temperature.  (So the fans only spin faster when the water gets hot.)


Plus the software I'm using for controlling the fans (Rem0o's Fan Control) can be extended via plug-ins to work with sensors etc it doesn't support natively.  So to use the temperature sensor I just need to come up with a way to read it and feed that info into Fan Control via a plug-in.


The first step was to find out what this temperature sensor is.  Turns out it's a common NTC thermistor - which is an electrical component which decreases in resistance as it gets hotter.  (NTC is short for "negative temperature coefficient")  So to read it I need to measure it's resistance and then run that number through a formula to get the temperature.  Sounds like a job for a Raspberry Pi Pico!  (Side note: I find the RPi Pico & Zero to be amazingly amazing (in the words of Zaphod Beeblebrox) in comparison to what was available before the turn of the century.)


As this entry is already reaching TLDR levels, let me summarize the story in point form:

  • My original plan included a temperature display using 7 segment LEDs, but I didn't do this because I didn't buy enough resistors (d'oh!).  In addition, the LEDs were common anode (common Vcc) rather than common cathode (common ground) - which would have made them easier to connect directly to the Pico.
  • I also was going to make a micro-USB to header connector but I found the pads on the micro-USB to be too small to solder to.  I ended up using a normal USB cable and ordering USB ports to headers from Ali Express.
  • There are multiple sources showing using the ADC on a Pico to measure resistance (via a simple voltage divider).  However, when I tested (using known resistances) the values provided by the ADC didn't match the expected values.  I suspect this is because the ADC input resistance isn't significantly higher than the 10k nominal resistance of the thermistor.  In any case, I ended up using a best-fit curve to obtain a "close enough" resistance from the ADC value.  (I was already using an "average" value for the main parameter in the resistance to temperature formula as well, so what was one more approximation?) **
  • The MicroPython code on the Pico prints the water temperature (and the "air" temperature, measured via the Pico's onboard temperature sensor) to USB serial.  The idea was this would make my Fan Control plug-in more generic if someone wanted to use it with a different microcontroller.
  • Creating the plug-in wasn't difficult, although I had to learn enough C# to handle the serial and thread libraries.  The biggest difficulty was getting the serial interface working.  It turned out the USB Serial interface on the Pico needed DTE to be asserted in order to send data to the PC - something which wasn't included in any of the sample code (but was done by the MicroPython IDE and PuTTY automatically - so they worked but my coded failed).  I finally figured it out using some "serial sniffer" software.
  • Once I had the code working, I cleaned it up, added the BSD license & in-line docs and posted it to /r/watercooling and the LTT forum (where Rem0o hangs out) and got very little feedback.  GRUMP!!!


** When I drain the system to replace the coolant I plan on finding the ADC values at various temperatures then using that information to obtain a best-fit curve to obtain a much more accurate temperature reading from the ADC values.  Maybe I'll add the LED display at the same time...

Edited by EricBall

  • Like 1


Recommended Comments

There are no comments to display.

Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...