Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Temperature Dependent Fan

By Ashutosh Bhatt November 9, 2012

Obviously you might have seen so many temperature controller and indicator applications using different microcontrollers, micro-processors or other controlling devices. But this is the actual application of temperature controller that controls speed of DC fan as temperature varies. It is not a simple ON-OFF type controller that switches fan ON / OFF when temperature increases / decreases certain limit. But it is a type of controller that continuously varies speed of DC fan as temperature increases / decreases. That is a demo of actual industrial application.

 
In industry fan may be AC or DC (most probably AC) or it may be cooler. As the temperature increases the speed of fan also increases linearly to cool it down. And as temperature decreases the speed also decreases. For any constant temperature the speed also remains constant.
 
So here I present a demo of same kind of application. As the temperature increases from 25 oC to 55 oC the speed of DC fan increases from min to max. obviously the industrial temperature range will be in terms of 100 oC to 100 oC or even more but here for demo I have design it for very low range. At the end of article I have suggested some ideas some modifications with which the project can be used for actual industrial application.
 
Temperature Controlled Fan Block Diagram: –
 
System-block-diagram.jpg
 
The figure shows major building blocks of the system as temperature sensor, ADC (Analog to Digital Convertor), micro-controller (AT89C52), DC driver and 5-LED bar graph display. Let us see the function of each block in brief.
 
Temperature sensor: – it’s a transducer. It converts temperature into equivalent electrical signal. Its output voltage increases linearly with increase in temperature. So by measuring the output voltage we may observe increase or decrease in temperature.
 
ADC: – because the output of sensor is an analog form, it must be converted into equivalent digital form before it is given to micro-controller. So, 8-bit ADC converts analog signal from sensor into 8-bit digital signal that is given to micro-controller.
 
Micro-controller: – it performs following tasks
·                     Controls ADC and reads digital value at periodic interval
·                     Generates PWM and controls speed of DC fan through DC driver
·                     Indicates current speed on LED bar graph display.
 
LED bar graph: – its 5-step bar graph that displays min speed as one LED ON and max speed as all five LEDs ON
 
DC Driver: – the direct micro-controller output is not able to drive DC motor. So the DC driver will take input PWM signal from micro-controller and generates enough current to drive DC motor through this PWM.
 

Circuit

Complete circuit: –
I have divided complete circuit in three different sections
1.                  ADC section
2.                  Controller section
3.                  DC driver section
 
ADC Section: –
 
ADC-Section.jpg
 
LM35 is semiconductor type temperature sensor. Here are its main features
1.                  Calibrated directly in ° Celsius (Centigrade)
2.                   Linear + 10.0 mV/°C scale factor
3.                   0.5°C accuracy guaranteed (at +25°C)
4.                   Rated for full ?55° to +150°C range
5.                   Operates from 4 to 30 volts
6.                  Less than 60 ?A current drain
7.                  Low self-heating, 0.08°C in still air
8.                   Nonlinearity only ±1?4°C typical
9.                  Low impedance output, 0.1 W for 1 mA load
 
So its output changes to ±10 mV with change in ± 1 oC. I have set the reference voltage (Vref) of ADC to 2.56 V. so its full scale input voltage will be 5.12 V. and resolution will be
ADC resolution           = FSV / (28 – 1)
= 5.12 / 256
= 0.02
   = 20 mV
From above calculation we can say that for every 2 oC change in temperature, the ADC output will change. So ADC output is perfectly calibrated to oC change in temperature. Its control signals and data bus are interfaced with micro-controller. There are four control signals CS, RD, WR, INTR, and 8-bit data bus.
·                     8-bit data bus – it is connected with port P1 of 89C52. It sends 8-bit digital data equivalent to analog output form LM35.
·                     CS (chip select) – active low input signal. Connected to ground permanently to always enable chip.
·                     RD (read enable) – active low input signal. Connected with pin no 17 (P3.7) of 89C52
·                     WR (write enable) – active low input also known as start of conversion (SoC). Connected with pin no 16 (P3.6) of 89C52
·                     INTR (interrupt out) – low output signal also know as end of conversion (EoC). Connected with pin no 13 (P3.3 of 89C52)
 

Controller and driver section

Controller and driver section: –
The details of the circuit have been mentioned in the Circuit Diagram Tab. 
Connections: –
The connections from previous sections (ADC) are shown. Five LEDs LED1 to LED5 are connected to port2 pins P2.0 to P2.4 as shown. A 12 MHz crystal with two 33 pF capacitors is connected to 89C52 crystal pins to provide clock signal. A capacitor C4 with diode D1 and resistor R4 forms power on reset circuit. This completes temperature controller section.
 
In driver section, IC 555 is configured in monostable mode that receives PWM from 89C52 as trigger input and it generates exact inverted PWM. Its time constant is less than 0.1 ms that is decided by R1C1. This PWM output is fed at the base of PNP type Darlington pair transistor TIP127. The collector of TIP127 is connected to DC fan motor. It will provide enough current to drive motor.
 
Operation: –
·                     The micro-controller initially starts rotating motor at minimum speed by applying 30% duty cycle.
·                     Then periodically it will read the digital value of current temperature from ADC
·                     If new value is higher than previous value then duty cycle is increased in 5 steps as 30%, 50%, 70%, 80% and 90%.
·                     Similarly if new value is lower duty cycle is decreased in same steps.
·                     If temperature remains constant the output duty cycle also remains constant and so does the speed.  
·                     So this is continuous process. The micro-controller continuously reads new temperature value and continuously varies speed of fan.
 

Software program

Software program: –
The program loaded into micro-controller is written in C language and compiled using keil IDE. The code can be retrieved from the Code tab.
There are two functions and one main function.
Main() function initializes the ports, enable interrupts and enable ADC to start conversion. Then it continuously generates PWM to drive motor. The duty cycle is changed by other two functions.
Int1() is an interrupt function. It reads digital value given by ADC. Then it increases or decreases duty cycle as per received value.
Delay() function generates variable delay in step of 1 ms. If value passed to it is 5 that means it will generate delay of 5 ms and so on.
 
Now if anyone wants to build the same project for actual industrial application then the things to be modified in the project are sensor and driver circuit. As a sensor, RTD or thermocouple can be used. But it cannot be connected to ADC directly. You need proper signal conditioning circuit. To drive any high power DC motor it requires power MOSFET or SCR chopper base circuit. If it’s AC motor then DIAC-TRIAC arrangement can be made.

 

Video

Video

 

 

 

 

Project Source Code

###


 

#include<reg51.h>

#include<string.h>     

sbit wr = P3^6;

sbit rd = P3^7;           

sbit op = P0^0;           

sbit eoc = P3^3;         

unsigned char data d;

unsigned int d1=3,d2=7;

void delay(int a)

 {

            int k;

            TL0 = 0x26;

            TH0 = 0xFC;

            TR0 = 1;

            for(k=0;k<a;k++)

              {

                        while(TF0==0);

                        TF0 = 0;

                        TL0 = 0x26;

                        TH0 = 0xFC;

              }

            TR0 = 0;

}

void int1(void) interrupt 2

  {

            rd = 0;

            d=P1;

            rd=1;  

            if(d>=0x19 && d<=0x1E) {d1=3;d2=7;P2=0x01;}

            else if(d>=0x1F && d<=0x24) {d1=5;d2=5;P2=0x03;}

            else if(d>=0x25 && d<=0x2A) {d1=7;d2=3;P2=0x07;}

            else if(d>=0x2B && d<=0x30) {d1=8;d2=2;P2=0x0F;}

            else if(d>=0x31 && d<=0x37) {d1=9;d2=1;P2=0x1F;}

            wr = 0;

            wr = 1;

  } 

void main()

  {

            TMOD = 0x01;          

            P0=0x00;                         

            P0=0x1F;

            op=0;

            P1=0xFF;       

            eoc=1;

            IE=0x84;        

     wr = 0;

            wr = 1;            

            while(1)

              {

                        op=1;

                        delay(d1);

                        op=0;

                        delay(d2);              }

  }

 

 

 

###

 


Circuit Diagrams

Temperature-Controlled-Fan


Filed Under: Electronic Projects
Tagged With: ac motor, ceiling fan, motor, temprature
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • System for measuring the amount of Joules delivered from a capacitor discharge.
  • Two sections broadband impedance matching
  • The GaN revolution must now happen?
  • How to find the resonance frequency and impedance of a planar spiral coil in HFSS?
  • PhD for Electronics Designers

RSS Electro-Tech-Online.com Discussions

  • The Analog Gods Hate Me
  • Impact of Tariffs on PCB Fab
  • More fun with ws2812 this time XC8 and CLC
  • I Wanna build a robot
  • Wierd makita battery

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz
  • Amphenol RF introduces SMPM to SMPM assemblies on RG-178 cable

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe