SlideShare a Scribd company logo
1 of 14
“TEMPERATURE CONTROLLED FAN”

                    A PROJECT REPORT
                        Submitted by


             PEEYUSH PASHINE(2011H140033H)
             PRAVESH TAMRAKAR(2011H140036H)
             SRI KRISHNA YADAV(2011H140031H)
                J GANESH(2011H140032H)



                 M.E. (EMBEDDED SYSTEMS)
BIRLA INSTITUTE OF TECHNOLOGY AND SCINCE PILANI-HYDERABAD




                                                            1
TABLE OF CONTENTS                  Page No.

1)Block Diagram
  1.1 8051(AT89C51)                     3
  1.2 Temperature sensor(LM35)          3
  1.3 ADC 0808                          3
  1.4 7 Segment display                 4
2)Working                               4
3)Simulations                           5
4)Snapshots                             6
5)Conclusion                            7
6)Application                           7
7)Future work                           7
8)Appendix                              8



LIST OF FIGURES                  Page No.
1)Fig1                              3

2)Fig2                              4

3)Fig3                              4

4)Fig4                              5

5)Fig5                              5

6)Fig6                              6

7)Fig7                              7




                                              2
ABSTRACT
This project is used to control the fan speed according to the temperature and it also
indicates the temperature. The system will get the temperature sense from the
temperature measuring IC corresponding to which temperature digits are obtained and
displayed and it will control the speed of fan according the duty cycle(PWM) values
stored in a lookup table according to the temperature measured .

Hardware tools :- microcontroller AT89C51, Temperature measuring IC (LM35),
resistors, capacitors,7 segment displays, motor(fan), power supply ,op amp ic, ADC
0808.




  1. Block Diagram




               Fig 1(schematic block diagram of temperature controlled fan)

     Description :-As in Fig 1,the block diagram contains 8051 microcontroller, power
     supply and reset circuit ,8 bit ADC ,temperature sensor LM35,motor driver L293D,
     and DC motor(bipolar),sensor opamp circuit for generating interrupt(to enable or
     disable entire operation) ,input switches for manual operation and display devices(7
                                                                                         3
segment).The flow of program is as power supply is provided to motor
driver,8051,switches and ADC0808.The measured temperature is given to ADC and
converted digital data from ADC is given to 8051 for further operation, display and
speed variation, motor is driven by driver circuit.

1.1   8051(AT89c51) :- AT89C51 is a 8 bit microcontroller belongs to INTEL’s
      8051 family. It has 16 bits of address,128 bytes of RAM, two 16 bit
      timer/counter, 6 interrupt(2 external hardware interrupt INT1and INT2),4k
      bytes of ROM, which can be extended up to 64Kbytes.It has got wide variety of
      instructions like data transfer, arithmetic and logical instruction. In addition it
      has feature of branch instruction, serial communication, timer feature and ISR
      execution.
1.2   Temperature sensor (LM 35):-                   The LM35 series are precision
      integrated-circuit temperature sensor, whose output is linearly proportional to
      Celsius scale. The LM35(fig 2) does not require any external calibration or
      trimming to provide accuracies of +-1/4 degree centigrade to +-3/4 centigrade
      over -55 to +150 degree centigrade




                    Fig 2(LM35 Connection)

1.3   ADC0808:- The ADC0808, ADC0809 data acquisition component is a
      monolithic CMOS device with an 8-bit analog-to-digital converter, 8-channel
      multiplexer and microprocessor compatible control logic. The 8-bit A/D
      converter uses successive approximation as the conversion technique. The
      converter features a high impedance chopper stabilized comparator, a 256R
      voltage divider with analog switch tree and a successive approximation register.
      The 8-channel multiplexer can directly access any of 8-single-ended analog
      signals. It has a total of eight analogue input channels, out of which any one can
      be selected using address lines A, B and C. Here, in this case, input channel IN0
      is selected by grounding A, B and C address lines,as shown in figure3 below.




                                                                                       4
Fig 3(ADC interfacing with 8051)

       1.4   Seven Segment display: - A seven-segment display (SSD), or seven-
             segment indicator, is a form of electronic display device for displaying decimal
             numerals that is an alternative to the more complex dot-matrix displays. Seven-
             segment displays are widely used in digital clocks electronic meters and other
             electronic devices for displaying numerical information. For displaying each
             alphanumeric code, 7 segments requires unique hex code.the schematic is as in
             fig4 and 5 below.



DIGIT----   0        1       2       3        5       5       6        7       8       9
HEX CODE
             7E       30      6D      79       33      5B      5F       70      7F      7B




             Fig 4 (7 segment)                Fig 5(7 segment diagram)



   2. Working: -       In fig 1 all the modules used are integrated, here is the working
 description about project. Speed of fan is monitored by temperature variation. Basic idea
 behind project is getting the temperature, displaying the temperature and change in
 temperature is reflected as change in speed of fan. We are using LM35 temperature
 sensor(shown in fig 2), whose output is given to ADC(see fig 3).The entire working is
 enabled or disabled by external interrupt(so it acts as a switch)the interrupt signal is
 generated by opamp sensor, which can be calibrated for different type of sensors.

         The output of ADC used to select unique values of temperature from look up table in
 program, based on different output values of ADC, different 2 digits value for temperature
 representation are selected, which in turn are provided to display port. Display port includes
 7 segment display devices(refer fig 4 and 5), where alphanumeric symbols/digits are
 displayed using some special HEX code, preconfigured for 1 seven segment display. By
 enabling one 7 segment at a time, no of digits can be displayed to several segments via just
 one port. We are using two 7 segment display required to represent 2 digit temperature (Here
 Celsius is taken by default)

                                                                                             5
Finally the displayed values from a temporary register are used to select the
distinguish delay according to digits. For speed variation we have used PWM concept which
in turn stands by duty cycle variation. Duty cycle variation needs, different on time and off
time duration, which are generated in program through delay generation logic, where value
of digit is inversely proportional to the delay value selected for off time delay from the speed
lookup table. This varying speed controls the running motion of dc motor. Further we have 2
modes of operation, manual and automatic, depending upon the status of active low input
switches, mode operation can selected.

3.Simulation :-
      Example: - lets take the output of ADC as 42H=01000010B

                Corresponding to this value 35 from the temperature table is selected and
      displayed through the codes required at 7 segment display from display table. That
      code here is ED for 3 and 2B for 5.Now one digit is displayed at a time through the
      display port, which is connected to 7 segments.

                  Further for 3(msb digit) the delay value from speed table is selected, which
      is 12 here, and for 5(lsb digit) it is 8.12 is added 5 times, as in code and then summed
      with 8, so we get 5*12+8=68,which is value for off delay. The ondelay is 100-68= 32.
      So duty cycle of pulse is 32/68=47.05%

      Now suppose temperature is increased to 44 degree Celsius. Through similar
      calculation we get duty cycle value as,

      =>offtime=5*10+10=60,=>ontime           =100-60=40,                  hence           duty
      cycle=40/60=66.66%(hence speed of the motor will increase)

4. Snapshots: - Fig 6(circuit schematic in Multisim)




                                                                                              6
Fig 7(hardware implementation)
5. Conclusion: -     The problem statement is implemented .Hardware part is halfway
implemented. Through simulations and after running the code in IDE abstract is verified.

6. Application:-This project can be use everywhere where power consumption has to be
controlled. In home appliance, at institutes, firms, organizations, industries (to regulate
output things via temperature).In computers, it can be use to cool the processor, as it gets
heated, the speed of fan can be made proportional to the temperature rise and fall.

7. Future work:-This           concept can be utilized further, by interfacing it with more
devices, like Air conditioner, etc..




                                                                                          7
8. APPENDIX
       CODE:
       ;-------------------------------------------
       ;
       ;     SPDT             = Auto/Manual
       ;     SW2              = Off
       ;     SW3              = fcheck
       ;
       ;-------------------------------------------
off    equ    P1.0 // switch off, motors/fan will off if switch is off, active low switch
fcheck equ P1.1 // switch fcheck ,active low, if enabled vary the speed of fan according to
temperature value
automanual equ        P1.2        // active low switch ,if switch is off do automatic
operation,otherwise manual


soc    equ P3.1           // start of conversion for adc
                                                                                              8
read equ        P3.0        // read the content of adcport


EXT_SIGNL equ               P3.3      // INT1 interrupt used to enable or disable operation
mode equ           20H          // mode, automatic if set and manual if it is reset
done      equ    21H       // a ram location used for interrupt ISR,for enabling and disabling
operation
adc      equ    30H            // a ram location used to store the values from adcport
adcport equ               P2         // adcport
scratchpad         equ 40H             // a random ram location used for storage purpose in program
disp     equ     P0          // 7 segment display port
dc_mot1_t1          equ            p1.3      // terminal 1 of dc motor
dc_mot1_t2          equ            p1.4      // terminal 2 of dc motor




org 0H                   //start of the program, PC initialization
sjmp start             //skip the interrupt vector location, jump to start(main program)


 org 13H               // INT1 vector location
 setb done
 reti                  // return from the interrupt


start:
        clr EXT_SIGNL                       // resetting all bits at initialization
        clr done
        clr mode
         mov IE,#10000011B
scan:
         acall read_temp              //call read_temp subroutine, used to measure the
         temperature values from adcport
         JNB automanual, auto                     // deciding to do automatic or manual operation
         based upon switch status
                                                                                                    9
clr mode                 //if manual clear the mode
        sjmp manual                 // jump to manual operation
auto:
        setb mode                 // otherwise set the mode bit for automatic operation
manual:
        JB mode,inauto      //if mode is set operation is automatic otherwise manual
        JNB off,fanoff           //manual:if off is enabled, go to subroutine fanoff
   JNB fcheck,fanspeed         //manual:if fcheck is enabled vary the speed of fan
   sjmp scan                   //start scan for new data processing
fanoff:
          clr dc_mot1_t1              // off the fan
          clr dc_mot1_t2
back:
          JNB off,back               // if switch off is enabled stay in loop
          sjmp scan                //otherwise start again for new data
fanspeed:
          mov DPTR,#Sptable                // load the speedtable in dptr, which signifies
          delay count,
                                   according to temperature for varying duty cycle
                                   according to temperature
          acall temp_checker             // call the temp_checker subroutine
          setb dc_mot1_t1              // start the dc motor(running)
           clr dc_mot1_t2
          acall ondelay              // call ondelay
          clr dc_mot1_t1               // stop dc motors/fan
           clr dc_mot1_t2
           acall offdelay             // call offdelay
           sjmp scan                 // start the new operation
inauto:
          mov a,adc              //copy the adc(temperature value) data into reg A
          clr c
                                                                                             10
cjne a,#30H,chk           //compare the temperature with 30,if not equal
                                   jump to check whether the temperature is greater or lesser
                                  than 30 if greater vary the speed of fan according to
                                  temperature value,otherwise
                                   off the fan
chk:
        jc fanoff                 // if carry generated(temp<30)off the fan
        clr c                    // clear the carry flag
       sjmp fanspeed            // otherwise jump to fanspeed subroutine,to vary the speed of
       fan acc to temperature
read_temp:
            clr soc
            nop
            setb soc                // start the adc
here: jnb done,here                  // if interrupt occurred, enable the operation, otherwise
stay here
       clr done
       clr read                  // enable read operation from adc
       mov a,adcport                 //copy the content of adcport in A
       setb read                  // disable read operation now
       mov dptr,#ttable               //load the temperature table in dptr
       movc a,@a+dptr            //acc to adc value, temperature values are choosen,and
copied to A
       mov adc,a                   //copying the temperature value to adc ram
       mov dptr,#dtable                // load the display values table in dptr
        swap a                     // swap the content(temperature value) of A
        anl a,#0FH                   // MASK THE LOWER BYE(ACTUAL UPPER DIGIT
       OF TEMPERATURE VALUE)
       movc a,@a+dptr                   // copying the corresponding display(hex code for 7
       segment) in A

                                                                                                 11
mov adcport,#00                 // declare adcport as output port(used to enable the 7
      segments, dual purpose)
      mov adcport,#1000b                // enabling the 1st 7 segment display
      mov disp,a                   // copy the hex code(for display digit acc to code) in
      display port(7 segment)
      acall delay                 // call normal delay
      mov adcport,#00                 // declare adcport as output port(used to enable the 7
segments, dual purpose)
      mov adcport,#0100b                // enabling the 2nd 7 segment display
      mov a,adc                    //copying the temperature value to adc ram
      anl a,#0FH                   // MASK THE LOWER BYE
      movc a,@a+dptr                   // copying the corresponding display(hex code for 7
      segment) in A
      mov disp,a                   // copy the hex code(for display digit acc to code) in
display port(7 segment)
      acall delay                 // call normal delay
       ret
ondelay: /*computing ondelay by subtracting the offdelay count from 100
mov r4,#100 basically calculating different duty cycle value and thus using pwm,
             varying the speed, according to temperature for which distinguish delay
              is generated using temp_check subroutine and sptable */
mov a,r4
            subb a,r2
bigloop1:
            mov r3,#50h
            djnz r3,$
            dec a
            jnz bigloop1
            ret
offdelay:

                                                                                               12
mov scratchpad, r2          //offdelay is computed via sptable delay count         and
temp_check subroutine
bigloop2: mov r3,#50h
loop:      djnz r3,loop
          djnz r2,bigloop2
           mov r2, scratchpad
           ret
delay:
          mov r6,#20               // normal delay
wait:
          mov r5,#255
          djnz r5,$
          djnz r6,wait
          ret


temp_checker:                  // subroutine used to generate different offdelay regarding
different temperature value
          clr c
          mov r2,#00             // initializing r2 with 0
          mov r1,#5             // a normal assumed count
          mov a, adc             // copying the content of adc(temperature) in A
          swap a               // swap the reg A content
          anl a,#0fh            // mask the lower nibble(higher digit,as it swaped)
          movc a,@a+DPTR // copy the speed table content to a,acc to temp digit
go:       addc a,r2            // add content of a(sptable delay value) 5 times to itself to have
a considerable delay count
         djnz r1,go
         mov r2,a             // copy content of A to r2
         mov a,adc             // again load value of adc to A
         anl a,#ofh           // mask lower nibble
         movc a,@a+DPTR         // copy the speedtable content to A,acc to temp digit
                                                                                               13
add a,r2      //add the content of a with r2,to get final delay sum for off delay
     mov r2,a               // copy it to r2
     ret


  org 300h                   // temperature table, values chose acc to adc values
   ttable: DB 25 26 27 28 29 30 31 32
           DB 33 34 35 36 37 38 39 40
           DB 41 42 43 44 45 46 47 48
           DB 49 50 51 52 53 54 55 56
           DB 57 58 59 60 61 62 63 64
           DB 65 66 67 68 69 70 71 72
           DB 73 74 75 76 77 78 79 80
           DB 81 82 83 84 85 86 87 88
           DB 89 90 91 92 93 94 95 96 97
           DB 97 98 99 100 101 102 103 104
           DB 105 106 107 108 109 110 111 112
           DB 113 114 115 116 117 118 119 120


org 400h     // 7 segment hex code reqd to display corresponding digits from 0 to 9
  dtable: DB 54 32 78 ED 4F 2B 8E 6C AC D4


ORG 500H         //speedtable,have delay values corresponding to digit from 0 to 9
 Sptable: DB 18 16 14 12 10 8 6 4 2 1


           END




                                                                                         14

More Related Content

What's hot

Temperature based fan speed control &amp; monitoring using arduino
Temperature based fan speed control &amp; monitoring using arduinoTemperature based fan speed control &amp; monitoring using arduino
Temperature based fan speed control &amp; monitoring using arduinoJagannath Dutta
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
 
AUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORAUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORPankaj Jagadale
 
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINODESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINORatnesh Kumar chaurasia
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorEdgefxkits & Solutions
 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed controlSai Malleswar
 
Temperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingTemperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingJagannath Dutta
 
Automatic fan controller based on room temperature
Automatic fan controller based on room temperatureAutomatic fan controller based on room temperature
Automatic fan controller based on room temperaturenikhilreddy411
 
Predefined speed control of bldc motor
Predefined speed control of bldc motorPredefined speed control of bldc motor
Predefined speed control of bldc motorEdgefxkits & Solutions
 
Automatic tempearture controlled fan
Automatic tempearture controlled fanAutomatic tempearture controlled fan
Automatic tempearture controlled fan Abin Baby
 
Temperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontrollerTemperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontrollerÇdh Suman
 
Intelligent Substation & its applications
Intelligent Substation & its applicationsIntelligent Substation & its applications
Intelligent Substation & its applicationsGowtham MG
 
smart grid seminar report
smart grid seminar reportsmart grid seminar report
smart grid seminar reportramesh kumawat
 
Auto power supply control from 4 different sources using pic microcontroller
Auto power supply control from 4 different sources using pic microcontrollerAuto power supply control from 4 different sources using pic microcontroller
Auto power supply control from 4 different sources using pic microcontrollerEdgefxkits & Solutions
 
Drives lec 13_14_Speed Control of DC Motors
Drives lec 13_14_Speed Control of DC MotorsDrives lec 13_14_Speed Control of DC Motors
Drives lec 13_14_Speed Control of DC MotorsMohammad Umar Rehman
 
Temperature based fan controller
Temperature based fan controllerTemperature based fan controller
Temperature based fan controllerShahbaz Makandar A.
 
Multilevel inverter technology
Multilevel inverter technologyMultilevel inverter technology
Multilevel inverter technologygmrit
 
Automatic temperature control
Automatic temperature control Automatic temperature control
Automatic temperature control RANJAN KUMAR
 

What's hot (20)

Temperature based fan speed control &amp; monitoring using arduino
Temperature based fan speed control &amp; monitoring using arduinoTemperature based fan speed control &amp; monitoring using arduino
Temperature based fan speed control &amp; monitoring using arduino
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontroller
 
AUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORAUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTOR
 
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINODESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulator
 
Temp based fan speed control
Temp based fan speed controlTemp based fan speed control
Temp based fan speed control
 
Temperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingTemperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring using
 
Automatic fan controller based on room temperature
Automatic fan controller based on room temperatureAutomatic fan controller based on room temperature
Automatic fan controller based on room temperature
 
Predefined speed control of bldc motor
Predefined speed control of bldc motorPredefined speed control of bldc motor
Predefined speed control of bldc motor
 
Automatic tempearture controlled fan
Automatic tempearture controlled fanAutomatic tempearture controlled fan
Automatic tempearture controlled fan
 
PWM RECTIFIER
PWM RECTIFIERPWM RECTIFIER
PWM RECTIFIER
 
Temperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontrollerTemperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontroller
 
Intelligent Substation & its applications
Intelligent Substation & its applicationsIntelligent Substation & its applications
Intelligent Substation & its applications
 
smart grid seminar report
smart grid seminar reportsmart grid seminar report
smart grid seminar report
 
Auto power supply control from 4 different sources using pic microcontroller
Auto power supply control from 4 different sources using pic microcontrollerAuto power supply control from 4 different sources using pic microcontroller
Auto power supply control from 4 different sources using pic microcontroller
 
Drives lec 13_14_Speed Control of DC Motors
Drives lec 13_14_Speed Control of DC MotorsDrives lec 13_14_Speed Control of DC Motors
Drives lec 13_14_Speed Control of DC Motors
 
Temperature based fan controller
Temperature based fan controllerTemperature based fan controller
Temperature based fan controller
 
Multilevel inverter technology
Multilevel inverter technologyMultilevel inverter technology
Multilevel inverter technology
 
types of motors ppt
types of motors ppttypes of motors ppt
types of motors ppt
 
Automatic temperature control
Automatic temperature control Automatic temperature control
Automatic temperature control
 

Similar to Temperature Controlled Fan Report

Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Hari Prakash
 
Micro Processor Lab Manual!
Micro Processor Lab Manual!Micro Processor Lab Manual!
Micro Processor Lab Manual!PRABHAHARAN429
 
Microprocessor project
Microprocessor projectMicroprocessor project
Microprocessor projectprapyapokharel
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310DHEERAJ DHAKAR
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manualDhaval Shukla
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices Sachin Mehta
 
Design, Construction and Operation of a 4-Bit Counting Circuit
Design, Construction and Operation of a 4-Bit Counting CircuitDesign, Construction and Operation of a 4-Bit Counting Circuit
Design, Construction and Operation of a 4-Bit Counting CircuitIOSR Journals
 
FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot IJECEIAES
 
Automatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessorAutomatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessorsubhradeep mitra
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET Journal
 
SKS-3058N Auto EECS and ECU For Examine-Analyzing Tester
SKS-3058N Auto EECS and ECU For Examine-Analyzing TesterSKS-3058N Auto EECS and ECU For Examine-Analyzing Tester
SKS-3058N Auto EECS and ECU For Examine-Analyzing TesterJack Chen
 
Introduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemIntroduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemRani Loganathan
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
Low Cost Temperature and Humidity Estimator with Atmega8 Microcontroller
Low Cost Temperature and Humidity Estimator with Atmega8 MicrocontrollerLow Cost Temperature and Humidity Estimator with Atmega8 Microcontroller
Low Cost Temperature and Humidity Estimator with Atmega8 MicrocontrollerYogeshIJTSRD
 

Similar to Temperature Controlled Fan Report (20)

Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310
 
Micro Processor Lab Manual!
Micro Processor Lab Manual!Micro Processor Lab Manual!
Micro Processor Lab Manual!
 
Microprocessor project
Microprocessor projectMicroprocessor project
Microprocessor project
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices
 
Design, Construction and Operation of a 4-Bit Counting Circuit
Design, Construction and Operation of a 4-Bit Counting CircuitDesign, Construction and Operation of a 4-Bit Counting Circuit
Design, Construction and Operation of a 4-Bit Counting Circuit
 
K010137378
K010137378K010137378
K010137378
 
FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot
 
Automatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessorAutomatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessor
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
LED MATRIX SCROLLING
LED MATRIX SCROLLING LED MATRIX SCROLLING
LED MATRIX SCROLLING
 
Ic2414251429
Ic2414251429Ic2414251429
Ic2414251429
 
L(1)
L(1)L(1)
L(1)
 
SKS-3058N Auto EECS and ECU For Examine-Analyzing Tester
SKS-3058N Auto EECS and ECU For Examine-Analyzing TesterSKS-3058N Auto EECS and ECU For Examine-Analyzing Tester
SKS-3058N Auto EECS and ECU For Examine-Analyzing Tester
 
Introduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemIntroduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light system
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
Low Cost Temperature and Humidity Estimator with Atmega8 Microcontroller
Low Cost Temperature and Humidity Estimator with Atmega8 MicrocontrollerLow Cost Temperature and Humidity Estimator with Atmega8 Microcontroller
Low Cost Temperature and Humidity Estimator with Atmega8 Microcontroller
 

More from Peeyush Pashine (17)

Temperature Controlled Fan
Temperature Controlled FanTemperature Controlled Fan
Temperature Controlled Fan
 
Robots
RobotsRobots
Robots
 
Power Ingredients
Power IngredientsPower Ingredients
Power Ingredients
 
Itms
ItmsItms
Itms
 
Ecg
EcgEcg
Ecg
 
Dsp Presentation
Dsp PresentationDsp Presentation
Dsp Presentation
 
Adder Presentation
Adder PresentationAdder Presentation
Adder Presentation
 
My Report on adders
My Report on addersMy Report on adders
My Report on adders
 
Decimal arithmetic in Processors
Decimal arithmetic in ProcessorsDecimal arithmetic in Processors
Decimal arithmetic in Processors
 
Control Unit Working
Control Unit WorkingControl Unit Working
Control Unit Working
 
Parallel Prefix Adders Presentation
Parallel Prefix Adders PresentationParallel Prefix Adders Presentation
Parallel Prefix Adders Presentation
 
Smith Adder
Smith AdderSmith Adder
Smith Adder
 
Smith Adder
Smith AdderSmith Adder
Smith Adder
 
Good report on Adders/Prefix adders
Good report on Adders/Prefix addersGood report on Adders/Prefix adders
Good report on Adders/Prefix adders
 
Kogge Stone Adder
Kogge Stone AdderKogge Stone Adder
Kogge Stone Adder
 
111adder
111adder111adder
111adder
 
Report adders
Report addersReport adders
Report adders
 

Temperature Controlled Fan Report

  • 1. “TEMPERATURE CONTROLLED FAN” A PROJECT REPORT Submitted by PEEYUSH PASHINE(2011H140033H) PRAVESH TAMRAKAR(2011H140036H) SRI KRISHNA YADAV(2011H140031H) J GANESH(2011H140032H) M.E. (EMBEDDED SYSTEMS) BIRLA INSTITUTE OF TECHNOLOGY AND SCINCE PILANI-HYDERABAD 1
  • 2. TABLE OF CONTENTS Page No. 1)Block Diagram 1.1 8051(AT89C51) 3 1.2 Temperature sensor(LM35) 3 1.3 ADC 0808 3 1.4 7 Segment display 4 2)Working 4 3)Simulations 5 4)Snapshots 6 5)Conclusion 7 6)Application 7 7)Future work 7 8)Appendix 8 LIST OF FIGURES Page No. 1)Fig1 3 2)Fig2 4 3)Fig3 4 4)Fig4 5 5)Fig5 5 6)Fig6 6 7)Fig7 7 2
  • 3. ABSTRACT This project is used to control the fan speed according to the temperature and it also indicates the temperature. The system will get the temperature sense from the temperature measuring IC corresponding to which temperature digits are obtained and displayed and it will control the speed of fan according the duty cycle(PWM) values stored in a lookup table according to the temperature measured . Hardware tools :- microcontroller AT89C51, Temperature measuring IC (LM35), resistors, capacitors,7 segment displays, motor(fan), power supply ,op amp ic, ADC 0808. 1. Block Diagram Fig 1(schematic block diagram of temperature controlled fan) Description :-As in Fig 1,the block diagram contains 8051 microcontroller, power supply and reset circuit ,8 bit ADC ,temperature sensor LM35,motor driver L293D, and DC motor(bipolar),sensor opamp circuit for generating interrupt(to enable or disable entire operation) ,input switches for manual operation and display devices(7 3
  • 4. segment).The flow of program is as power supply is provided to motor driver,8051,switches and ADC0808.The measured temperature is given to ADC and converted digital data from ADC is given to 8051 for further operation, display and speed variation, motor is driven by driver circuit. 1.1 8051(AT89c51) :- AT89C51 is a 8 bit microcontroller belongs to INTEL’s 8051 family. It has 16 bits of address,128 bytes of RAM, two 16 bit timer/counter, 6 interrupt(2 external hardware interrupt INT1and INT2),4k bytes of ROM, which can be extended up to 64Kbytes.It has got wide variety of instructions like data transfer, arithmetic and logical instruction. In addition it has feature of branch instruction, serial communication, timer feature and ISR execution. 1.2 Temperature sensor (LM 35):- The LM35 series are precision integrated-circuit temperature sensor, whose output is linearly proportional to Celsius scale. The LM35(fig 2) does not require any external calibration or trimming to provide accuracies of +-1/4 degree centigrade to +-3/4 centigrade over -55 to +150 degree centigrade Fig 2(LM35 Connection) 1.3 ADC0808:- The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an 8-bit analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register. The 8-channel multiplexer can directly access any of 8-single-ended analog signals. It has a total of eight analogue input channels, out of which any one can be selected using address lines A, B and C. Here, in this case, input channel IN0 is selected by grounding A, B and C address lines,as shown in figure3 below. 4
  • 5. Fig 3(ADC interfacing with 8051) 1.4 Seven Segment display: - A seven-segment display (SSD), or seven- segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven- segment displays are widely used in digital clocks electronic meters and other electronic devices for displaying numerical information. For displaying each alphanumeric code, 7 segments requires unique hex code.the schematic is as in fig4 and 5 below. DIGIT---- 0 1 2 3 5 5 6 7 8 9 HEX CODE 7E 30 6D 79 33 5B 5F 70 7F 7B Fig 4 (7 segment) Fig 5(7 segment diagram) 2. Working: - In fig 1 all the modules used are integrated, here is the working description about project. Speed of fan is monitored by temperature variation. Basic idea behind project is getting the temperature, displaying the temperature and change in temperature is reflected as change in speed of fan. We are using LM35 temperature sensor(shown in fig 2), whose output is given to ADC(see fig 3).The entire working is enabled or disabled by external interrupt(so it acts as a switch)the interrupt signal is generated by opamp sensor, which can be calibrated for different type of sensors. The output of ADC used to select unique values of temperature from look up table in program, based on different output values of ADC, different 2 digits value for temperature representation are selected, which in turn are provided to display port. Display port includes 7 segment display devices(refer fig 4 and 5), where alphanumeric symbols/digits are displayed using some special HEX code, preconfigured for 1 seven segment display. By enabling one 7 segment at a time, no of digits can be displayed to several segments via just one port. We are using two 7 segment display required to represent 2 digit temperature (Here Celsius is taken by default) 5
  • 6. Finally the displayed values from a temporary register are used to select the distinguish delay according to digits. For speed variation we have used PWM concept which in turn stands by duty cycle variation. Duty cycle variation needs, different on time and off time duration, which are generated in program through delay generation logic, where value of digit is inversely proportional to the delay value selected for off time delay from the speed lookup table. This varying speed controls the running motion of dc motor. Further we have 2 modes of operation, manual and automatic, depending upon the status of active low input switches, mode operation can selected. 3.Simulation :- Example: - lets take the output of ADC as 42H=01000010B Corresponding to this value 35 from the temperature table is selected and displayed through the codes required at 7 segment display from display table. That code here is ED for 3 and 2B for 5.Now one digit is displayed at a time through the display port, which is connected to 7 segments. Further for 3(msb digit) the delay value from speed table is selected, which is 12 here, and for 5(lsb digit) it is 8.12 is added 5 times, as in code and then summed with 8, so we get 5*12+8=68,which is value for off delay. The ondelay is 100-68= 32. So duty cycle of pulse is 32/68=47.05% Now suppose temperature is increased to 44 degree Celsius. Through similar calculation we get duty cycle value as, =>offtime=5*10+10=60,=>ontime =100-60=40, hence duty cycle=40/60=66.66%(hence speed of the motor will increase) 4. Snapshots: - Fig 6(circuit schematic in Multisim) 6
  • 7. Fig 7(hardware implementation) 5. Conclusion: - The problem statement is implemented .Hardware part is halfway implemented. Through simulations and after running the code in IDE abstract is verified. 6. Application:-This project can be use everywhere where power consumption has to be controlled. In home appliance, at institutes, firms, organizations, industries (to regulate output things via temperature).In computers, it can be use to cool the processor, as it gets heated, the speed of fan can be made proportional to the temperature rise and fall. 7. Future work:-This concept can be utilized further, by interfacing it with more devices, like Air conditioner, etc.. 7
  • 8. 8. APPENDIX CODE: ;------------------------------------------- ; ; SPDT = Auto/Manual ; SW2 = Off ; SW3 = fcheck ; ;------------------------------------------- off equ P1.0 // switch off, motors/fan will off if switch is off, active low switch fcheck equ P1.1 // switch fcheck ,active low, if enabled vary the speed of fan according to temperature value automanual equ P1.2 // active low switch ,if switch is off do automatic operation,otherwise manual soc equ P3.1 // start of conversion for adc 8
  • 9. read equ P3.0 // read the content of adcport EXT_SIGNL equ P3.3 // INT1 interrupt used to enable or disable operation mode equ 20H // mode, automatic if set and manual if it is reset done equ 21H // a ram location used for interrupt ISR,for enabling and disabling operation adc equ 30H // a ram location used to store the values from adcport adcport equ P2 // adcport scratchpad equ 40H // a random ram location used for storage purpose in program disp equ P0 // 7 segment display port dc_mot1_t1 equ p1.3 // terminal 1 of dc motor dc_mot1_t2 equ p1.4 // terminal 2 of dc motor org 0H //start of the program, PC initialization sjmp start //skip the interrupt vector location, jump to start(main program) org 13H // INT1 vector location setb done reti // return from the interrupt start: clr EXT_SIGNL // resetting all bits at initialization clr done clr mode mov IE,#10000011B scan: acall read_temp //call read_temp subroutine, used to measure the temperature values from adcport JNB automanual, auto // deciding to do automatic or manual operation based upon switch status 9
  • 10. clr mode //if manual clear the mode sjmp manual // jump to manual operation auto: setb mode // otherwise set the mode bit for automatic operation manual: JB mode,inauto //if mode is set operation is automatic otherwise manual JNB off,fanoff //manual:if off is enabled, go to subroutine fanoff JNB fcheck,fanspeed //manual:if fcheck is enabled vary the speed of fan sjmp scan //start scan for new data processing fanoff: clr dc_mot1_t1 // off the fan clr dc_mot1_t2 back: JNB off,back // if switch off is enabled stay in loop sjmp scan //otherwise start again for new data fanspeed: mov DPTR,#Sptable // load the speedtable in dptr, which signifies delay count, according to temperature for varying duty cycle according to temperature acall temp_checker // call the temp_checker subroutine setb dc_mot1_t1 // start the dc motor(running) clr dc_mot1_t2 acall ondelay // call ondelay clr dc_mot1_t1 // stop dc motors/fan clr dc_mot1_t2 acall offdelay // call offdelay sjmp scan // start the new operation inauto: mov a,adc //copy the adc(temperature value) data into reg A clr c 10
  • 11. cjne a,#30H,chk //compare the temperature with 30,if not equal jump to check whether the temperature is greater or lesser than 30 if greater vary the speed of fan according to temperature value,otherwise off the fan chk: jc fanoff // if carry generated(temp<30)off the fan clr c // clear the carry flag sjmp fanspeed // otherwise jump to fanspeed subroutine,to vary the speed of fan acc to temperature read_temp: clr soc nop setb soc // start the adc here: jnb done,here // if interrupt occurred, enable the operation, otherwise stay here clr done clr read // enable read operation from adc mov a,adcport //copy the content of adcport in A setb read // disable read operation now mov dptr,#ttable //load the temperature table in dptr movc a,@a+dptr //acc to adc value, temperature values are choosen,and copied to A mov adc,a //copying the temperature value to adc ram mov dptr,#dtable // load the display values table in dptr swap a // swap the content(temperature value) of A anl a,#0FH // MASK THE LOWER BYE(ACTUAL UPPER DIGIT OF TEMPERATURE VALUE) movc a,@a+dptr // copying the corresponding display(hex code for 7 segment) in A 11
  • 12. mov adcport,#00 // declare adcport as output port(used to enable the 7 segments, dual purpose) mov adcport,#1000b // enabling the 1st 7 segment display mov disp,a // copy the hex code(for display digit acc to code) in display port(7 segment) acall delay // call normal delay mov adcport,#00 // declare adcport as output port(used to enable the 7 segments, dual purpose) mov adcport,#0100b // enabling the 2nd 7 segment display mov a,adc //copying the temperature value to adc ram anl a,#0FH // MASK THE LOWER BYE movc a,@a+dptr // copying the corresponding display(hex code for 7 segment) in A mov disp,a // copy the hex code(for display digit acc to code) in display port(7 segment) acall delay // call normal delay ret ondelay: /*computing ondelay by subtracting the offdelay count from 100 mov r4,#100 basically calculating different duty cycle value and thus using pwm, varying the speed, according to temperature for which distinguish delay is generated using temp_check subroutine and sptable */ mov a,r4 subb a,r2 bigloop1: mov r3,#50h djnz r3,$ dec a jnz bigloop1 ret offdelay: 12
  • 13. mov scratchpad, r2 //offdelay is computed via sptable delay count and temp_check subroutine bigloop2: mov r3,#50h loop: djnz r3,loop djnz r2,bigloop2 mov r2, scratchpad ret delay: mov r6,#20 // normal delay wait: mov r5,#255 djnz r5,$ djnz r6,wait ret temp_checker: // subroutine used to generate different offdelay regarding different temperature value clr c mov r2,#00 // initializing r2 with 0 mov r1,#5 // a normal assumed count mov a, adc // copying the content of adc(temperature) in A swap a // swap the reg A content anl a,#0fh // mask the lower nibble(higher digit,as it swaped) movc a,@a+DPTR // copy the speed table content to a,acc to temp digit go: addc a,r2 // add content of a(sptable delay value) 5 times to itself to have a considerable delay count djnz r1,go mov r2,a // copy content of A to r2 mov a,adc // again load value of adc to A anl a,#ofh // mask lower nibble movc a,@a+DPTR // copy the speedtable content to A,acc to temp digit 13
  • 14. add a,r2 //add the content of a with r2,to get final delay sum for off delay mov r2,a // copy it to r2 ret org 300h // temperature table, values chose acc to adc values ttable: DB 25 26 27 28 29 30 31 32 DB 33 34 35 36 37 38 39 40 DB 41 42 43 44 45 46 47 48 DB 49 50 51 52 53 54 55 56 DB 57 58 59 60 61 62 63 64 DB 65 66 67 68 69 70 71 72 DB 73 74 75 76 77 78 79 80 DB 81 82 83 84 85 86 87 88 DB 89 90 91 92 93 94 95 96 97 DB 97 98 99 100 101 102 103 104 DB 105 106 107 108 109 110 111 112 DB 113 114 115 116 117 118 119 120 org 400h // 7 segment hex code reqd to display corresponding digits from 0 to 9 dtable: DB 54 32 78 ED 4F 2B 8E 6C AC D4 ORG 500H //speedtable,have delay values corresponding to digit from 0 to 9 Sptable: DB 18 16 14 12 10 8 6 4 2 1 END 14