# Dell OptiPlex 3050 Micro Fan Control Script This Bash script provides simple, temperature-based fan control for the **Dell OptiPlex 3050 Micro**. It's designed to reduce idle fan noise by lowering the fan speed when the system is cool, while still ramping it up appropriately under load. --- ## 📋 Overview By reading CPU temperature from the system's `hwmon` interface and adjusting the fan speed via PWM (pulse-width modulation), this script allows you to override the default, often overly aggressive fan behavior. --- ## ⚙️ How It Works 1. **Monitors CPU Temperature** - Reads from: `/sys/class/hwmon/hwmon1/temp1_input` *(Path may vary depending on your system — adjust as needed.)* 2. **Controls Fan Speed** - Writes PWM values to: `/sys/class/hwmon/hwmon2/pwm1` *(This controls the fan speed. Also may vary.)* 3. **Temperature-Based Fan Speed Logic** | Temperature (°C) | Fan Speed (PWM) | Approximate Speed | |------------------|------------------|--------------------| | < 50°C | 25 | ~25% | | 50–59°C | 45 | ~50% | | 60–64°C | 60 | ~75% | | 65–74°C | 120 | High | | ≥ 75°C | 255 | Maximum | | ≥ 85°C | 255 + warning | Emergency max speed| 4. **Failsafe Mechanism** - If temperature exceeds **85°C**, the fan is forced to maximum and a message is logged to `/dev/kmsg`. --- ## 🧪 Requirements - A Linux system with PWM-capable fan control (`/sys/class/hwmon/...`) - Root access to write PWM values - Adjusted system paths if `hwmon1` and `hwmon2` differ on your machine --- ## 🚀 Usage 1. Make the script executable: ```bash chmod +x fan_control.sh