Driving Behavioral Change for Information Management through Data-Driven Gree...
Temp based fan speed control
1. IIST
TEMPERATURE BASED FAN SPEED CONTROL
INSTRUMENTATION AND MEASUREMENT LAB PROJECT
5TH SEMESTER
AVIONICS
KOSURU SAI MALLESWAR (SC09B093)
DHRUTI RANJAN GAAN (SC09B017)
MYNAM HARINATH (SC09B146)
2. Contents
1. INTRODUCTION
2. THEORY
2.1. LM35 (Temperature sensor)
2.2. ATMEGA micro controller unit
2.3. Brushless variable speed DC motor [DR-6634-514]
2.4. N mosfet (BUK9575-100A)
2.5. PWM (Pulse width modulation)
3. METHODOLOGY
3.1. Circuit schematic
3.2. Control algorithm - Flow chart
3.3. Hardware implementation
3.4. Software implementation
4. APPLICATIONS
5. CONCLUSION
APPENDIX
Program code
List of components
3. 1. INTRODUCTION
The idea behind the project TEMPERATURE BASED FAN SPEED CONTROL is to control the
speed of the fan using microcontroller based on the variation in temperature detected by the
temperature sensor.
In this project we are using LM35 series analog temperature sensor. This is a precision integrated-
circuit, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. It is
rated to operate over a -55° to +150°C temperature range. It has + 10.0 mV/°C linear scale
factor.The output of this sensor will be connected to ATMEGA-32 micro controller’s PORT-A. The
inbuilt ADC in ATMEGA is used for converting into Digital format. That will be used by ATMEGA
to generate control logic. Then the PWM output from ATMEGA micro-controller is given to
variable speed DC motor through a motor driver stage.
4. 2. THEORY
2.1. LM35 TEMPERATURE SENSOR
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is
linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over
linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a
largeconstant voltage from its output to obtain convenient Centigradescaling. The LM35 does not
require any external calibration or trimming to provide typical accuracies of ± 1/4°Cat room
temperature and ±3/4°C, over a full -55 to +150°Ctemperature range. Low cost is assured by
trimming andcalibration at the wafer level. The LM35’s low output impedance,linear output, and
precise inherent calibration makeinterfacing to readout or control circuitry especially easy. Itcan be
used with single power supplies, or with plus andminus supplies. As it draws only 60 µA from its
supply, it hasvery low self-heating, less than 0.1°C in still air. The LM35 israted to operate over a -
55° to +150°C temperature range.
Full range centigrade temperature sensor:
MATHEMATICAL MODELLING:
Range of sensor output: -550 mV to 1500mV (for temperature range of -55 to 150 degree Celsius).
Range of ADC input for ATMEGA: 0 to 5 V
ADC output: 0 To1023 (10 bit)
For every 1 degree Celsius temperature rise , rise of sensor output is 10mV
For every 5 milli volt input rise to ADC, count increments by 1
ADC_OUT = 1023 * (ADC_IN)/5000;
So Temperature = ADC_OUT /2.046;
5. 2.2. ATMEGA-32 MICRO CONTROLLER UNIT:
Microcontrollers must contain at least two primary components – memory (RAM), and an
instruction set. RAM is a type of internal logic unit that stores information temporarily. RAM
contents disappear when the power is turned off. While RAM is used to hold any kind of data, some
RAM is specialized, referred to as registers. The instruction set is a list of all commands and their
corresponding functions. During operation, the microcontroller will step through a program (the
firmware). Each valid instruction set and the matching internal hardware that differentiate one
microcontroller from another.
Most microcontrollers also contain read-only memory (ROM), programmable read-only memory
(PROM), or erasable programmable read-only memory (EPROM). Al1 of these memories are
permanent: they retain what is programmed into them even during loss of power. They are used to
store the firmware that tells the microcontroller how to operate. They are also used to store
permanent lookup tables. Often these memories do not reside in the microcontroller; instead, they
are contained in external ICs, and the instructions are fetched as the microcontroller runs. This
enables quick and low-cost updates to the firmware by replacing the ROM.
Where would a microcontroller be without some way of communicating with the outside world?
This job is left to input/output (I/O) port pins. The number of I/O pins per controllers varies greatly,
plus each I/O pin can be programmed as an input or output (or even switch during the running of a
program). The load (current draw) that each pin can drive is usually low. If the output is expected
to be a heavy load, then it is essential to use a driver chip or transistor buffer.
Most microcontrollers contain circuitry to generate the system clock. Thissquare wave is the
heartbeat of the microcontroller and all operations aresynchronized to it. Obviously, it controls the
speed at which the microcontrollerfunctions. All that needed to complete the clock circuit would be
the crystal or RCcomponents. We can, therefore precisely select the operating speed critical to
manyapplications.
To summarize, a microcontroller contains (in one chip) the following elements:
Instruction set
RAM
ROM,PROM or EPROM
I/O ports
Clock generator
Reset function
Watchdog timer
Serial port
Interrupts
Timers
Analog-to-Digital converters
Digital-to-Analog converters
6. In order to maximize performance and parallelism, the AVR uses a HARVARD architecture with separate
memories and buses for program and data. Instructions in the program memory are executed with a single
level pipelining. While one instruction is being executed, the next instruction is pre-fetched from the program
memory. This concept enables instructions to be executed in every clock cycle.
7. 2.3. Brushless variable speed DC motor [DR-6634-514]
Brushless DC motors use a rotating permanent magnet or soft magnetic core in the rotor, and stationary
electrical magnets on the motor housing. A motor controller converts DC to AC. This design is simpler
than that of brushed motors because it eliminates the complication of transferring power from outside the
motor to the spinning rotor. Advantages of brushless motors include long life span, little or no
maintenance, and high efficiency. Disadvantages include high initial cost, and more complicated motor
speed controllers. Some such brushless motors are sometimes referred to as "synchronous motors"
although they have no external power supply to be synchronized with, as would be the case with normal
AC synchronous motors.
DC Motor DR-6634-514:
8. 2.4. BUK9575-100A:
Logic level N-channel enhancement mode Metal Oxide SemiconductorField-Effect Transistor(MOSFET) in a plastic
package, using Trench MOS technology. This product has been designed and qualified to the appropriate AEC standard
for use in automotive critical applications. It has low conduction losses due to low on-state resistance.This transistor can
be switched on and off very rapidly (millions of times per second) and can handle the large currents required for big
motors.
Specifications:
2.5. PULSE WIDTH MODULATION:
The Pulse-Width-Modulation (PWM) in microcontroller is used to control duty cycle of DC motor
drive. PWM is an entirely different approach to controlling the speed of a DCmotor. Power is
supplied to the motor in square wave of constant voltage butvarying pulse-width or duty cycle. Duty
cycle refers to the percentage of one cycleduring which duty cycle of a continuous train of pulses.
Since the frequency is heldconstant while the on-off time is varied, the duty cycle of PWM is
determined by thepulse width. Thus the power increases duty cycle in PWM.
The expression of duty cycle is determined by,
Basically, the speed of a DC motor is a function of the input power and drive characteristics. While
the area under an input pulse width train is measure of theaverage power available from such an
input.
9. 3. METHODOLOGY
3.1. Circuitschematic:
Pins used in ATMEGA 32:
PORTA: pin 0 is for giving analog input from sensor
PORTC: pins 0,1,2,3 are connected to D4, D5, D6, D7 for data transmission to LCD;
Pins 4, 5, 6 are connected to EN, RD, RS of LCD module.
PORTB: pin 3 is used for PWM output
11. 3.3. Hardware implementation:
Micro controller unit is used as the controller to maintain the DC motor speed at desired value, based on the
input from the temperature sensor, in order to control the temperature.The duty cycle of the PWM (Pulse
width modulation) from microcontroller will determine the speed of the DC motor.
Block diagram:
Most digital logic circuits and processors need a +5 volt power supply. To use these parts we need to
build a regulated +5 volt source. Usually, we start with an unregulated power supply ranging from 9
volts to 15 volts DC. To make +5 volt power supply, we can use a LM7805 voltage regulator IC.
Sometimes the input supply line may be noisy. To help smooth out this noise and get a better 5 volt
output, capacitors can be added to the circuit.
3.4. Software Implementation:
For software implementation, we used AVR STUDIO for writing programs for microcontroller in
Embedded C language. We have imported the HEX file formed into EXTREME BURNER-AVR,
and then programmed the micro controller through USB cable interface.
Main steps involved in the program:
Initialization of the port A for analog input from sensor
Initialization of LCD module for displaying temperature
Initialization of the PWM module
Initialization of the TIMER 1
The micro controller reads the input from the sensor with fixed amount of delays. Then, the analog
input is converted into 10 bit digital format by ADC unit inside the micro controller, which indicates
the temperature. Depending on the temperature value, the PWM duty cycle will be adjusted by the
micro controller.
12. PWM output waveforms for different temperature ranges:
For Duty cycle 20% (25 to 35 deg) For Duty cycle 40% (35 to 45 deg)
For duty cycle 60% (45 to 55 deg) For Duty cycle 80% (55 to 65 deg)
13. 4. Applications
Temperature based fan speed controller is useful for cooling the processor in the laptops and
personal computers “more efficiently”. Generally fan in laptop comes with only two or three
possible speeds. So it results in more power consumption. The fan designed in this project,
has different values of speed according to temperature change. This can be also used in small
scale industries for cooling the electrical/mechanical equipment. The whole circuit except
motor and fan can be manufactured on a single PCB, and it can be used for temperature
based control operations.
5. CONCLUSION
Here, we did the project with a fan speed with fixed PWM duty cycle for each 10 degree centigrade
interval from 25 to 65 degree Celsius. Care should be taken such that delays will not affect the open loop
control system performance. Temperature should not vary abruptly, otherwise it will cause degradation of
the system performance.
15. initPWM();
uint16_t adc_result;
InitLCD(LS_BLINK|LS_ULINE);
LCDClear();
InitADC();
while (1)
{ LCDClear();
LCDWriteString("FAN CONTROL");
LCDWriteStringXY(0,1,"TEM=");
adc_result=ReadADC(0);
temp=(adc_result/2);
LCDWriteIntXY(4,1,temp,4);
if (temp<=25)
{ SetPWMOutput(0); }
if (temp>25&&temp<=35)
{ SetPWMOutput(50); }
if (temp>35&&temp<45)
{ SetPWMOutput(100); }
if (temp>45&&temp<=55)
{ SetPWMOutput(150); }
if (temp>55&&temp<=65)
{ SetPWMOutput(200); }
if (temp>=65)
{ SetPWMOutput(245); }
_delay_loop_2(0);
}
}
16. LIST OF COMPONENTS:
1. LM35 (Temperature sensor)
2. ATMEGA32 micro-controller unit
3. Brushless variable speed DC motor [DR-6634-514]
4. N mosfet (BUK9575-100A)
5. Resistors (10k ohm,1k ohm)
6. Breadboard
7. Red LED
8. LM7805 voltage regulator IC
9. Diodes (1N914)
10. Capacitors (0.1uf )