Build a Smart Temperature-Controlled Fan
Many electronic devices require cooling to maintain reliable operation. A smart fan controller automatically adjusts the speed of a cooling fan according to temperature, reducing noise, lowering power consumption and extending the life of both the fan and the equipment. This project demonstrates how to build an intelligent fan controller using temperature sensors, a microcontroller and PWM (Pulse Width Modulation) speed control.
Project Overview
The controller continuously measures the temperature of the equipment using an electronic temperature sensor.
As the temperature increases, the controller gradually increases the fan speed. When the temperature falls, the fan slows down or switches off, keeping the equipment cool while minimising noise.
Project Difficulty
| Item | Value |
|---|---|
| Difficulty | ⭐⭐⭐ Intermediate |
| Build Time | 3–6 Hours |
| Supply Voltage | 5 V, 12 V or 24 V DC |
| Fan Type | Brushless DC Fan (2, 3 or 4 Wire) |
| Control Method | PWM or Variable Voltage |
Main Sections
| Section | Function |
|---|---|
| Temperature Sensor | Measures heat sink or ambient temperature. |
| Microcontroller | Calculates the required fan speed. |
| PWM Output | Controls fan speed. |
| MOSFET Driver | Supplies power to the fan. |
| Display (Optional) | Shows temperature and fan speed. |
| Alarm | Warns of excessive temperature. |
Recommended Temperature Sensors
| Sensor | Interface | Application |
|---|---|---|
| LM35 | Analogue | General-purpose monitoring. |
| DS18B20 | Digital (1-Wire) | High accuracy. |
| NTC Thermistor | Analogue | Low-cost designs. |
| TMP36 | Analogue | Simple monitoring projects. |
How the Circuit Works
The temperature sensor measures the heat sink or surrounding air.
The microcontroller continuously reads the temperature and compares it with preset thresholds.
Using PWM, the controller adjusts the average power delivered to the fan. Low temperatures result in low fan speed, while higher temperatures increase the duty cycle, causing the fan to spin faster.
If the temperature exceeds a critical limit, the controller can activate an alarm or force the fan to maximum speed.
Typical Components
| Quantity | Component |
|---|---|
| 1 | Arduino Nano, ESP32 or STM32 |
| 1 | Temperature Sensor (LM35, DS18B20 or NTC) |
| 1 | N-Channel Logic-Level MOSFET |
| 1 | 12 V Brushless DC Fan |
| 1 | Flyback Diode (for brushed DC fans if required) |
| 1 | OLED or LCD Display (Optional) |
| 1 | Buzzer (Optional) |
| Several | Resistors and Capacitors |
Applications
- Audio power amplifiers.
- Computer cooling.
- Bench power supplies.
- Battery chargers.
- Solar inverters.
- 3D printers.
- Industrial control cabinets.
- Server racks.
Testing
- Verify all wiring before powering the circuit.
- Measure the supply voltage.
- Confirm the temperature sensor is detected.
- Warm the sensor gently with your hand or warm air.
- Observe the fan speed increasing smoothly.
- Allow the sensor to cool and verify the fan slows down.
- Test the over-temperature alarm if installed.
- Measure the PWM signal using an oscilloscope if available.
Troubleshooting
| Problem | Possible Cause |
|---|---|
| Fan never starts | No power, incorrect MOSFET wiring or software error. |
| Fan always runs at full speed | Temperature threshold too low or PWM output incorrect. |
| Temperature reading incorrect | Sensor wiring or calibration problem. |
| Fan speed unstable | Electrical noise or unstable PWM frequency. |
| Display not working | Incorrect wiring or software configuration. |
Project Improvements
- Support multiple temperature sensors.
- Control several cooling fans independently.
- Add Wi-Fi monitoring using ESP32.
- Create a smartphone monitoring application.
- Store temperature history on an SD card.
- Display temperature graphs on a TFT screen.
- Send over-temperature notifications.
- Automatically shut down equipment if overheating occurs.
Skills Learned
- Temperature sensing.
- PWM motor control.
- MOSFET switching.
- Microcontroller programming.
- Automatic control systems.
- Electronic cooling design.
Safety Notes
- Ensure the fan voltage matches the power supply.
- Mount the temperature sensor securely to the heat source for accurate measurements.
- Keep wiring away from rotating fan blades.
- Provide adequate ventilation around heat-generating components.
- Test the controller thoroughly before relying on it to protect expensive equipment.
Key Points
- A smart fan controller automatically adjusts cooling according to temperature.
- PWM provides efficient and quiet fan speed control.
- Temperature sensors enable precise thermal management.
- Automatic cooling improves reliability and reduces energy consumption.
- Smart fan controllers are ideal for amplifiers, power supplies, computers and industrial equipment.