Temperature Controlled Fan using Arduino

In this arduino based project, we are going to control DC fan speed according to the room temperature and show these parameter changes on a 16×2 LCD display. It is accomplished by the data communications between Arduino, LCD, DHT11 sensor Module and DC fan that is controlled by using PWM. PWM is a technique by using which we can control voltage.


Circuit Components

  1. Arduino UNO
  2. DHT11 sensor
  3. DC Fan
  4. 2n2222 transistor
  5. 9 volt battery
  6. 16×2 LCD
  7. 1K resistor
  8. Connecting wires

This project consists of three sections. One senses the temperature by using humidity and temperature sensor namely DHT11. Second section reads the dht11 sensor module’s output and extracts temperature value into a suitable number in Celsius scale and control the fan speed by using PWM. And last part of system shows humidity and temperature on LCD and Fan driver.

Here in this project we have used a sensor module namely DHT11 that are already have discuss our previous project namely “Humidity and Temperature Measurement using Arduino”. Here we have only used this DHT sensor for sensing temperature, and then programmed our arduino according to the requirements.

Working of this project is very simple. We have created PWM at pwm pin of arduino and applied it at base terminal of transistor. Then transistor creates a voltage according to the pwm input.

pwm wave form

Fan speed and PWM values and duty cycles values are showing in given table


Duty Cycle

PWM Value

Fan Speed

Less 26




20 %















Greater 29




What is PWM? PWM is a technique by using we can control the voltage or power. To understand it more simply, if you are applying 5 volt for driving a motor then motor will moving with some speed, now if we reduces applied voltage by 2 means we apply 3 volt to motor then motor speed also decreases. This concept is used in the project to control the voltage using PWM. (To understand more about PWM, check this circuit: 1 Watt LED Dimmer)


The main game of PWM is digital pulse with some duty cycle and this duty cycle is responsible for controlling the speed or voltage.

Suppose we have a pule with duty cycle 50% that means it will give half of voltage that we apply.

Formula for duty cycle given below:

Duty Cycle=  Ton/T

Where T= total time or Ton+Toff

And Ton= On time of pulse (means 1 )

And Toff= Off time of pulse (means 0)

Automatic temprature

Read More:  Temperature Controlled Fan using Arduino

This Post / Project can also be found using search terms:

  • what is the use of temperature controlled fan
  • arduino controlled 5v fan using dht11
  • arduino fan speed controlled using temperature dht11
  • arduino fan temperature control

Leave a Comment

= 5 + 3

(Spamcheck Enabled)

Read previous post:
Interfacing 16×2 LCD with Arduino

To establish a good communication between human world and machine world, display units play an important role. And so they...

Scroll to top