Skip to content

Latest commit

 

History

History
199 lines (154 loc) · 6.8 KB

File metadata and controls

199 lines (154 loc) · 6.8 KB

QT Py CH32V203 PWM Fan Controller

PWM fan controller for the Adafruit QT Py CH32V203 RISC-V board 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.

QT Py CH32V203 PWM Fan Controller Breadboard Top View 1

QT Py CH32V203 PWM Fan Controller Breadboard Side View 1

QT Py CH32V203 PWM Fan Controller Breadboard Side View 2

QT Py CH32V203 PWM Fan Controller Breadboard Side View 3

Hardware

The Adafruit QT Py CH32V203 uses the CH32V203G8 RISC-V microcontroller. All the hardware components in my particular build are enumerated here.

Programming will require a USB-C cable and a computer. 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.

How it Works

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. The fan setup might evolve in the future to take into account temperature sensing and dynamic speed adjustment.

The 3.3V QT Py CH32V203 requires a logic level shifter to boost the PWM signal up to 5V for the fan. I use the 74AHCT125 to perform the logic level conversion, using pin #40, VBUS, to provide the 5V reference voltage.

The QT Py CH32V203 draws only 1.11 mA of current in this particular configuration.

Wiring

The 74AHCT125 is wired as shown in the [74AHCT125 Wiring] table. All pins omitted from the table are connected to ground.

Table 1. 74AHCT125 Wiring

74AHCT125 Pin

Signal

Connection

2

3.3V logic level input

QT Py CH32V203 pin #5 (SDA)

3

5V logic level output

1N4001 to fan header pin #4 (Control)

8

5V

QT Py CH32V203 pin #14 (5V)

The output signal from the logic level shifter is sent through the 1N4001 power blocking diode to the fan header. The pins on the 4-pin fan header are classified in the [4-pin Fan Header Pinout] table. The pins are numbered one through four from left to right with the pins reaching upwards and the overhang positioned between the viewer and the pins.

Table 2. 4-pin Fan Header Pinout

Fan Header Pin

Signal

1

GND

2

+12VDC

3

Sense

4

Control

Getting Started

  1. Change to the board’s directory.

    cd pwm-fan-controller/boards/qt-py-ch32v203
  2. Add a udev rule to be able to access the QT Py CH32V203 as a non-root user.

    /etc/udev/rules.d/60-qt-py-ch32v203.rules
    SUBSYSTEM=="usb", ATTRS{idVendor}=="4348", ATTRS{idProduct}=="55e0", TAG+="uaccess"
  3. While holding the BOOT button, attach the QT Py CH32V203 to your computer via the USB-C port.

  4. Flash the board using the nix run command with the qt-py-ch32v203.flash.wchisp target.

    nix run ../..#qt-py-ch32v203.flash.wchisp

Contributing

Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.

Open Source Software

This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.

Code of Conduct

Refer to the project’s Code of Conduct for details.

License

Licensed under either of

at your option.

© 2024 Jordan Williams

Authors