Skip to content

A simple program to set the speed of a fan using the RP2040 QT Py and the EMC2101 fan controller

License

Notifications You must be signed in to change notification settings

jwillikers/fan-controller-circuitpython

Repository files navigation

Fan Controller

Hardware

All the hardware components in my particular build are enumerated here.

Programming will require a USB-C cable and a computer.

How it Works

This is a dead-simple fan controller that simply lowers the speed of the Noctua NF-P12 redux-1700 PWM Fan to a quiet 40% speed. The microcontroller simply sets the fan speed and then enters deep sleep indefinitely. Technically, it enters deep sleep for around nineteen years, but after it sets the initial fan speed on the EMC2101 there’s no compelling reason for it to wake up again. I could probably use PWM straight from the microcontroller just as easily, but the EMC2101 development board has an even easier to use CircuitPython library. The fan setup might evolve in the future to take into account temperature sensing dynamic speed adjustment.

Getting Started

The instructions here setup the software for the QT Py RP2040. It is assumed that you are on and familiar with Linux and using CircuitPython on microcontrollers.

💡

To access the serial connection to the QT Py RP2040 without requiring superuser privileges, add your user to the dialout group.

sudo usermod --append --groups dialout $USER

Now restart for the change to take effect.

  1. Wait for the file to finish copying, after which the Feather RP2040’s onboard storage should automatically be mounted.

  2. Clone this project’s repository.

    git clone https://github.com/jwillikers/fan-controller.git
  3. Change into the project directory.

    cd fan-controller
  4. Install just by following the instructions in the installation section.

  5. Hold down the button marked bootsel on the QT Py RP2040 while plugging it in to your computer with a USB-C cable. The RP2040 should automatically be mounted as a disk on your computer.

  6. To download and install CircuitPython, run just install-circuitpython.

    just install-circuitpython
  7. Run just init to initialize the venv.

    just init
  8. Mount the QT Py RP2040 if needed.

    udisksctl mount --block-device /dev/sda1
  9. Run just install to install everything to the QT Py RP2040.

    just install

Development

  1. Run just init-dev to initialize the virtual environment for development. This will install all of the necessary dependencies and the pre-commit hooks.

    just init-dev
  2. To update dependencies, run just update.

    just update
  3. Use just --list to list other available tasks.

    just --list

Documentation

CircuitPython Documentation

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

This repository is licensed under the GPLv3, a copy of which is provided here.

© 2022-2024 Jordan Williams

Authors

About

A simple program to set the speed of a fan using the RP2040 QT Py and the EMC2101 fan controller

Topics

Resources

License

Stars

Watchers

Forks