Code Monkey home page Code Monkey logo

gpio_fan_control's Introduction

This repository contains code to control a Noctua PWM fan with GPIO pins, based on the CPU and ambient temperatures.

GPIO Fan Control

Hardware

Using Noctua 5V PWM fan. Note that the circuit diagram Noctua provides as an example for driving the PWM fan is incorrect. It should be a standard CMOS inverter circuit.

Pinout for Orange Pi Plus 2 is here: https://www.meccanismocomplesso.org/en/a-look-back-at-the-orange-pi-plus-2-board/

Software

The code for Armbian uses pyGPIO, which is not available in pip. Install as follows:

sudo apt-get install python-dev
git clone https://github.com/chwe17/pyGPIO.git
cd pyGPIO
sudo python setup.py install

fan_curve_control.py controls the fan speed, and requires a config file setting:

  • Which pin to use for the PWM signal
  • The location of a database to log the temperatures and fan duty cycle
  • The file containing the cpu temperature

The controller sets the fan speed to run at one of three possible speeds.

Monitoring

Also included is a dockerised flask web app to display a graph showing measured temperatures and the duty cycle of the fan. The docker-compose.yml file requires two variables to be set in a .env file:

  • The secret key for the web app
  • The location of the database with the temperature and duty cycle information

The secret key is passed to the flask app in the container as an environment variable.

gpio_fan_control's People

Contributors

ejep avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.