Intermediate Project

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.

Smart Fan Controller

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

ItemValue
Difficulty⭐⭐⭐ Intermediate
Build Time3–6 Hours
Supply Voltage5 V, 12 V or 24 V DC
Fan TypeBrushless DC Fan (2, 3 or 4 Wire)
Control MethodPWM 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

QuantityComponent
1Arduino Nano, ESP32 or STM32
1Temperature Sensor (LM35, DS18B20 or NTC)
1N-Channel Logic-Level MOSFET
112 V Brushless DC Fan
1Flyback Diode (for brushed DC fans if required)
1OLED or LCD Display (Optional)
1Buzzer (Optional)
SeveralResistors and Capacitors

Applications

  • Audio power amplifiers.
  • Computer cooling.
  • Bench power supplies.
  • Battery chargers.
  • Solar inverters.
  • 3D printers.
  • Industrial control cabinets.
  • Server racks.

Testing

  1. Verify all wiring before powering the circuit.
  2. Measure the supply voltage.
  3. Confirm the temperature sensor is detected.
  4. Warm the sensor gently with your hand or warm air.
  5. Observe the fan speed increasing smoothly.
  6. Allow the sensor to cool and verify the fan slows down.
  7. Test the over-temperature alarm if installed.
  8. 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.

Next Project

Continue by building an Automatic Battery Cooling System, where multiple temperature sensors and cooling fans protect high-capacity battery packs during charging and discharging.

Next Project → Automatic Battery Cooling System