tjko / fanpico

Fanpico: Open Source Smart PWM (PC) Fan Controller
GNU General Public License v3.0
115 stars 10 forks source link
diy electronics fan-control firmware hardware mqtt open-source open-source-hardware oshw pc pcb pwm pwm-fan-controller raspberry-pi raspberry-pi-pico rp2040 scpi temperature

Fanpico: Smart PWM (PC) Fan Controller

CI CodeQL

[OSHW] US002599 | Certified open source hardware | oshwa.org/cert

Fanpico is a smart PWM (PC) fan controller based around Raspberry Pi Pico (RP2040 MCU). Fanpico operates as standalone controller that can be configured and left running. It does not require any drivers and doesn't care what OS is being used. FanPico is an Open-source hardware (OSHW) project.

FanPico

What is it for?

Features

Interfaces

For more documentation check FanPico Wiki

Sponsors

I would like to thank following sponsors, who have helped FanPico project:

Where can I get one?

Currently Fanpico is available as a DIY project. Check discussion forums for places to purchase Kits or PCBs: Places to Purchase FanPico

(Instructions for building the kit are in FanPico Wiki)

However, if there is sufficient interest, then ready-made units may be made available for sale. If you'd be interested in purchasing FanPico pease indicate your interest here: FanPico Forum

DIY Option

You can upload the Kerber files (found under boards directory) to your favorite PCB maker website and get your boards produced in matter of days. Component list (BOM or bill of materials) is found under boards directory as well along with the electrical schematics.

NOTE, check discussions forum for giveaways for free PCBs.

Review Units

If you are member of press (or YouTuber) and would like to review/test Fanpico. Please contact me via email.

How Can I help?

Hardware

Fanpico is Open Source Hardware, reference design is provided for the "0804" model (8 fan outputs and 4 motherboard fan inputs), and "0804D" model that adds OLED display support (hence the "D" suffix).

Additional models with different combinations of fan inputs/outputs could be easily designed (takining into account limitations of Raspberry Pi Pico I/O limits). New and improved PCB models/designs are most welcome.

Model "0840D" with (with right-angle connectors):

Fanpico-0804D

Model "0804" without display (with straight connectors):

Fanpico-0804

Hardware Design

Fanpico (reference design) utilizes all available I/O pins on a Raspberry Pi Pico.

To help design and test Fanpico couple other projects were born:

Projects based on FanPico firmware:

Models (PCB designs)

Currently following models are available:

Model Fans (Outputs) MB Fan (Inputs) External Temperature Sensors Display Notes
FANPICO-0804 8 4 2 N First publicly available board (reference design).
FANPICO-0804D 8 4 2 Y Support for OLED (128x64 or 128x128) displays
FANPICO-0401D 4 1 2 Y Adds QWIIC and 1-Wire connectors. PCB under development

(all boards have one additional 'on-board' temperature sensor on the RP2040 MCU itself)

Models ending with "D" support a display to see 'real-time' status of fans and temperatures.

OLED panel directly mounted on the PCB:

FanPico OLED Display

LCD Panel attached via a short cable:

FanPico LCD Display

Accessory Boards (PCB designs)

Following accessories are available:

Model Info
OLED-Adapter Mounting adapter for OLED boards with different pinouts.
Power-Board Adapter for using high-power fans with FanPico.

Firmware

Firmware is developed in C using the Pico SDK. Pre-compiled firmware is released when there is new major features or bug fixes.

Latest pre-compiled firmware image can be found here: Releases

To get latest firmware with latest updates/fixes you must compile the firmware from the sources.

Installing firmware image

Firmware can be installed via the built-in UF2 bootloader on the Raspberry Pi Pico or using the debug header with Picoprobe, etc...

Selecting Right Firmware to use

Each release (zip file) contains multiple different firmware files. Make sure to select firmware for the board you're using and for the pico model ("pico_w" if using Pico W).

Firmware file names have format: fanpico--.uf2

fanpico-0401D-pico.uf2
fanpico-0401D-pico_w.uf2
fanpico-0804-pico.uf2
fanpico-0804-pico_w.uf2
fanpico-0804D-pico.uf2
fanpico-0804D-pico_w.uf2

Upgrading Firmware

Firmware upgrade steps:

Building Firmware Images

Raspberry Pi Pico C/C++ SDK is required for compiling the firmware:

Requirements / Dependencies

Install Pico SDK

Pico SDK must be installed working before you can compile fanpico.

Instructions on installing Pico SDK see: Getting started with Raspberry Pi Pico

(Make sure PICO_SDK_PATH environment variable is set)

Downloading sources

Create some directory for building fanpico ('src' used in this example):

$ mkdir src
$ cd src
$ git clone https://github.com/tjko/fanpico.git
$ git submodule update --init --recursive
Building fanpico firmware

To build fanpico firmware, first create a build directory:

$ cd fanpico
$ mkdir build

Select which board to build firmware for (default is "0804") and which Pico is to be used (default is "pico"):

$ cd build
$ cmake -DFANPICO_BOARD=0804D -DPICO_BOARD=pico_w ..

Then compile fanpico:

$ make -j

After successful compile you should see firmware binary in the build directory: subdirectory:

$ ls *.uf2
fanpico.uf2

If you have picotool installed you can check the firmware image information:

$ picotool info -a fanpico.uf2
File fanpico.uf2:

Program Information
 name:          fanpico
 version:       1.4.0 (Mar 24 2023)
 web site:      https://github.com/tjko/fanpico/
 description:   FanPico-0804D - Smart PWM Fan Controller
 features:      USB stdin / stdout
 binary start:  0x10000000
 binary end:    0x10093648

Fixed Pin Information
 0:   TX (Serial) / MISO (SPI)
 1:   RX (Serial) / CS (SPI)
 2:   SDA (I2C) / SCK (SPI)
 3:   SCL (I2C) / MOSI (SPI)
 4:   Fan1 PWM signal (output)
 5:   Fan2 PWM signal (output)
 6:   Fan3 PWM signal (output)
 7:   Fan4 PWM signal (output)
 8:   Fan5 PWM signal (output)
 9:   Fan6 PWM signal (output)
 10:  Fan7 PWM signal (output)
 11:  Fan8 PWM signal (output)
 12:  MB Fan1 tacho signal (output)
 13:  MB Fan1 PWM signal (input)
 14:  MB Fan2 tacho signal (output)
 15:  MB Fan2 PWM signal (input)
 16:  MB Fan3 tacho signal (output)
 17:  MB Fan3 PWM signal (input)
 18:  MB Fan4 tacho signal (output)
 19:  MB Fan4 PWM signal (input)
 20:  Multiplexer S2 (output)
 21:  Multiplexer S1 (output)
 22:  Multiplexer S0 (output)
 26:  Multiplexer A [tacho signal] (input)
 27:  Temperature Sensor1 (input)
 28:  Temperature Sensor2 (input)

Build Information
 sdk version:       1.5.0
 pico_board:        pico_w
 build date:        Mar 24 2023
 build attributes:  Release