DIY fan controller for ThinkPads (should be adaptable to other laptops/desktops).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
3.3 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. DIY fan controller for ThinkPads (should be adaptable to other laptops/desktops).
  2. Introduction/Rationale:
  3. Newer ThinkPads are dumb, their fan controllers use an obscure method of communication with the kernel. Direct access to PWM frequency is not possible, the fan(s) is(are) either off, or on in one of 2 or 3 levels making for very jarring speed transitions that are clearly audible.
  4. This project aims to replace the built-in PWM controller with an attiny or other arduino compatible board containing a custom fan curve. The controller reads a temperature value from a thermocouple and sets the fan accordingly, proportionally to the given temperature.
  5. WARNING: the PWM wire must be cut/desoldered from the fan so that we can inject our signal and drive the fan; it is also useful to crimp/solder 5V and GND for the microcontroller from the fan's connector directly, so that our chip/board will turn on/off with the laptop.
  6. Required parts:
  7. - Attiny45 or similar (I suggest using an arduino nano or esp32/esp8266 if you want to easily add serial/wireless functionality)
  8. - 3x 1k resistors if using a 5V microcontroller (build a voltage divider on the PWM output, as the fan operates at 3.3V); esp boards do not need this, but an output resistor at 1~3k in series with the output is recommended to protect the microcontroller and fan.
  9. - 10~100k resistor (or potentiometer if you want to perform manual calibration of the thermocouple)
  10. - some perfboard
  11. - NTC/PTC thermistor/thermocouple (suggested 10 or 100k, as they are widely available, place on top of heatsink near the CPU, affix with thermal glue and calibrate accordingly)
  12. Useful resources when using thermistors/thermocouples:
  13. - https://www.circuitbasics.com/arduino-thermistor-temperature-sensor-tutorial/
  14. - https://www.arduino.cc/reference/en/libraries/ntc_thermistor/
  15. - https://learn.adafruit.com/thermistor/using-a-thermistor
  16. - some wires (AWG24 or thereabout)
  17. - bulk capacitor (a few 10s of uF, value is non critical, if in doubt, use electrolytic 10V 100uF)
  18. - a 6 or 10 pin ICSP connector to make programming and updating easier (necessary when using an attiny or other standalone chip without USB). Use USBasp or similar programmer to flash bios and upload code.
  19. Quirks:
  20. - arduino and other 8-bit AVRs usually generate 1KHz PWM, but computer fans accept 25KHz (will likely spin with anything from 20 to 30KHz; different ones may have tighter tolerances). Access to the individual AVR hardware timers is needed to circumvent this problem and the "analogWrite" command cannot be used.
  21. Read more here: https://docs.arduino.cc/tutorials/generic/secrets-of-arduino-pwm
  22. - desired PWM value is calculated in real time and is then averaged over the last 10 values to dampen "noise" (spikes and dips in temperature would otherwise result in abrupt changes in speed).
  23. - some fans operate on a reversed PWM logic, with speed following an inverse relation to duty cycle.
  24. - Currently no os/kernel control is present and the controller operates as stand-alone. The OS has no way to spin up the fan should the temperature sensor fall off/break, or other issues arise.
  25. Future goals:
  26. - add serial/usb communication (some ThinkPads have dedicated USB connections for fingerprint/card readers that can be repurposed for this)
  27. - add buttons/switch to choose between fan curves
  28. - add software control mode (with fallback to default built-in curve when serial is down)