PWM fan controller for the ATtiny85 written in Rust. This fan controller just sets the fan speed to 40% speed to reduce noise from the Noctua NF-P12 redux-1700 PWM Fan.
All the hardware components in my particular build are enumerated here.
-
12V DC 1000mA (1A) regulated switching power adapter - UL listed
-
5V USB-C power supply for the microcontroller
The compact protoboard omits the AVR breadboard adapter, incorporates a socket to ensconce the ATtiny85, and adds a DC/DC converter along with an electrolytic capacitor to convert 12V power down to 5V for the ATtiny85.
Unfortunately, the small protoboard doesn’t make it possible to program the ATtiny85 directly, unlike the breadboard circuit. So, you’ll still need to put together something for that. That can be pretty easily accomplished by using the breadboard layout with only the necessary components to program the ATtiny85. These components are enumerated separately below.
-
5V USB-C power supply for the microcontroller
Programming will also require a USB-C cable and a computer, of course. If you don’t already have one, you’ll probably want a fan, too. This circuit is meant for a 12V fan. I use this controller for the Noctua NF-P12 redux-1700 PWM Fan.
This is a dead-simple PWM fan controller that simply lowers the speed of the Noctua NF-P12 redux-1700 PWM Fan to a quiescent 40% speed. The microcontroller simply sets the fan speed and then does nothing. Since the ATtiny85 is a 5V microcontroller and the Noctua fan uses 5V logic, no logic-level shifting is necessary. The ATtiny85 draws 1.61 mA of current in this particular configuration. The fan setup might evolve in the future to take into account temperature sensing and dynamic speed adjustment.
-
Gently place the ATtiny85 in the breadboard.
-
Connect pin #4 to ground.
-
Attach pin #8 to 5V.
-
Wire pin #5 on the ATtiny85 to the 4th pin on the Noctua fan header. This should be the pin opposite the one attached to ground on the fan header.
-
Connect the following pins on the ATtiny85 to the associated pins on the 6-pin ISP breakout.
ATtiny85 Pin ISP Breakout Pin 1
RST
4
GND
5
MOSI
6
MISO
7
SCK
8
VCC
-
Set the USB µISP’s slider to 5V to power the ATtiny85 microcontroller for testing.
-
Attach the USB µISP programmer to the 6-pin ISP breakout board.
-
Connect the 12V power supply to the 2nd pin in the fan header, the one immediately next to ground.
-
Create a udev rule to allow access to the USB µISP programmer without requiring root access.
/etc/udev/rules.d/60-USBmicroISP.rulesSUBSYSTEM=="usb", ATTR{product}=="USBmicroISP", ATTR{idProduct}=="0c9f", ATTRS{idVendor}=="1781", TAG+="uaccess"
-
Unplug the probe, and plug it back in for the new udev rule to take effect.
-
Change to the board’s directory.
cd pwm-fan-controller/boards/attiny85
-
Connect the USB µISP to your computer.
-
Build and flash the executable.
nix run ../..#attiny85.flash.avrdude
-
Add a wiring diagram.
-
Describe using the USB-C breakout.
-
Measure power consumption.
-
Investigate lowering power consumption.
Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.
This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.
Refer to the project’s Code of Conduct for details.
Licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
© 2022-2024 Jordan Williams