Skip to content

LeanWasTaken/FanControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PC Fan Controller

ESP32-C3 based PWM fan controller with web interface and RPM monitoring.

Features

  • PWM Speed Control: 0-100% with 25kHz frequency
  • RPM Monitoring: Real-time tachometer readings
  • Web Interface: Remote control via WiFi
  • Speed Persistence: Settings saved to EEPROM
  • Serial Commands: Direct control via USB

Hardware

  • Board: Adafruit QT Py ESP32-C3
  • Fan PWM: Pin 9 (25kHz, 8-bit)
  • Tachometer: Pin 8 (interrupt-based)
  • Power: 5V via USB-C

Setup

  1. Install PlatformIO

    pip install platformio
  2. Configure WiFi

    cp include/config_example.h include/config.h
    # Edit config.h with your WiFi credentials
  3. Build and Upload

    platformio run --target upload
  4. Upload Web Files

    platformio run --target uploadfs

Usage

Web Interface

  • Connect to the IP address shown in serial monitor
  • Adjust fan speed with slider (0-100%)
  • Monitor real-time RPM

Serial Commands

  • speed <0-100> - Set fan speed percentage
  • status - Display current speed and RPM

Wiring

ESP32-C3    PC Fan Header    External 12V PSU
--------    -------------    ----------------
Pin 9   →   PWM (Blue)
Pin 8   →   Tach (Yellow)
GND     →   GND (Black)  →   GND (-)
            +12V (Red)   →   +12V (+)

Note: Fan requires external 12V power supply. ESP32-C3 provides PWM control signal only.

API Endpoints

  • GET / - Web interface
  • POST /setSpeed?speed=<0-100> - Set fan speed
  • GET /status - JSON status response

License

MIT License

About

Control PC PWM fans with an ESP32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published