Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Temperature Controlled Fan

By Saif Ullah Qureshi, Lahore, Pakistan

[[wysiwyg_imageupload:3627:]]

 

This Project is submitted by Mr. Saif Ullah Qureshi from UET,Lahore, Pakistan


 A simple project using microcontroller AT89S51 to control the speed of 12V fan according to the surrounding temperature. In this project we use the concept of PWM (pulse width modulation) to increase or decrease the speed of fan. We also interface 2*16 characters LCD which shows the outside temperature through the temperature sensor. Followings are the details of the project.

 

Pulse-width modulation (PWM), OR pulse-duration modulation (PDM), is a commonly used technique for controlling power to inertial electrical devices, made practical by modern electronic power switches.
The average value of voltage (and current) fed to the load is controlled by turning the switch between supply and load on and off at a fast pace. The longer the switch is on compared to the off periods, the higher the power supplied to the load is.
 

Temperature Controlled Fan1

Components
•           Microcontroller AT89C52
•           ADC0804 LCN
•           Opt Coupler ILD74
•           Temperature Sensor LM35
•           16*2 LCD Display
•           Voltage Regulator L7805
•           Resistors
•           Capacitors
•           Diodes
•           Transistor TIP120
•           Crystal Oscillator 12MHz
•           Electric Fan 12 V
 
Working criteria
The temperature controlled fan circuit will automatically control the speed of fan according to the temperature. A temperature sensor is used to sense the temperature. The speed of fan increases with the increase in temperature and vice versa and the temperature sensed by temperature sensor on the LCD. We program the micro controller to operate the fan above 25c

Components Description

Components Description
1. Microcontroller AT89C52
The Atmel AT89C52 is an 8051-based Fully Static 24MHz CMOS controller with 32 I/O Lines, 3 Timers/Counters, 8 Interrupts/2 Priority Levels, UART, Three-Level Program Memory Lock, 8K Bytes Flash Memory, 128 Bytes On-chip RAM.
2. LM35
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 large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C range (-10° with improved accuracy). The LM35 series is available packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220 package.
 
3. ADC 0804 LCN
The ADC0801, ADC0802, ADC0803, ADC0804 and ADC0805 are CMOS 8-bit successive approximation A/D converters that use a differential potentiometric ladder-similar to the 256R products. These converters are designed to allow operation with the NSC800 and INS8080A derivative control bus with TRI-STATE output latches directly driving the data bus. These A/Ds appear like memory locations or I/O ports to the microprocessor and no interfacing logic is needed.
Differential analog voltage inputs allow increasing the common-mode rejection and offsetting the analog zero input voltage value. In addition, the voltage reference input can be adjusted to allow encoding any smaller analog voltage span to the full 8 bits of resolution.
 
4. Opt Coupler ILD 74
In electronics an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is “an electronic device designed to transfer electrical signals by utilizing light waves to provide coupling with electrical isolation between its input and output”. The main purpose of an opto-isolator is “to prevent high voltagesor rapidly changing voltages on one side of the circuit from damaging components or distorting transmissions on the other side.”Commercially available opto-isolators withstand input-to-output voltages up to 10 kV and voltage transients with speeds up to 10 kV.
 
5. Voltage Regulator L7805
Voltage Regulator L7805 (regulator), usually having three legs, converts varying input voltage and produces a constant regulated output voltage. They are available in a variety of outputs. 
 
The most common part numbers start with the numbers 78 or 79 and finish with two digits indicating the output voltage. The number 78 represents positive voltage and 79 negative one. The 78XX series of voltage regulators are designed for positive input. And the 79XX series is designed for negative input.  

Temperature Controlled Fan3

6. Crystal Oscillator 12MHz
An oscillator is something that produces an output that repeats regularly. In the electronics field this will be an electrical waveform, often but not always a sine wave.
 
The most important property of an oscillator is its frequency: the rate at which the output repeats. This is measured in Hertz (Hz for short). One Hertz is one repetition (aka cycle) per second. One Mega Hertz (MHz) is one million repetitions per second
 
One of the problems in designing a high quality oscillator is maintaining the output frequency at the value required. One method is to control it by a quartz crystal; this is cut so that it vibrates mechanically at the design frequency, and is coupled to the electronics by the piezo-electric effect.
 
A 12 MHz crystal oscillator is an electronic circuit, whose output frequency is controlled by a quartz crystal to repeat 12 million times per second.
 

Temperature Controlled Fan5

 

 

 

 

 

Project Source Code

###


                                ORG 0H

                                LJMP STRT

 

                                ORG 000BH

                                LJMP INTRR

               

                                ORG 0030H

STRT:    

                                SETB P1.5

                                MOV P0,#0FFH

PL:                          SETB P3.5

                                SETB P3.3

                                CLR P3.4

                                SETB P3.4

H9:                         JB P3.5,H9

                                CLR P3.3

                                LCALL INI

                                MOV A,#'M'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'I'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'C'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'R'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'C'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'N'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'T'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'R'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'L'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'L'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'E'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'R'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#0C4H

                                ACALL CW

                                ACALL DE

                                MOV A,#'P'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'R'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'J'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'E'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'C'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'T'

                                ACALL DWRO

                                ACALL DE

                                ACALL DELAY

                                MOV A,#01H

                                ACALL CW

                                ACALL DE

                                MOV A,#'T'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'E'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'M'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'P'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#' '

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'C'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'N'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'T'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'R'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'O'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'L'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#' '

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'F'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'A'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'N'

                                ACALL DWRO

                                ACALL DE

                                MOV A,#0C6H

                                ACALL CW

                                ACALL DE

                                MOV TMOD,#02H

                                MOV IE,#82H

                                MOV R1,P0

                                MOV A,R1

                                MOV R4,A

                                ACALL COMPAIR

                                MOV A,R4

                                LCALL CONV

                                LCALL DTA

                                ACALL DELAY

                                LJMP STRT

DELAY:                 

                                MOV R3,#0FFH

H12:       MOV R5,#0FFH

H11:       MOV 73H,#01FH

H13:       DJNZ 73H,H13

H14:       DJNZ R5,H11

                                DJNZ R3,H12

                RET

COMPAIR:

                                CLR C

                                CJNE R1,#30,A4

A4:                         JNC A3

                                CLR C

                                CJNE R1,#25,A5

A5:                         JNC A2

                                CLR TR0

                                LJMP A1                              

A3:                         ACALL GRAT

                                SJMP A1

A2:                         ACALL LOWER

A1:                         CLR C

                                RET

                               

CW:

                                MOV P2,A

                                CLR P3.1

                                CLR P3.0

                                SETB P3.2

                                ACALL DE

                                CLR P3.2

                                RET

DWRO:

                                MOV P2,A

                                SETB P3.1

                                CLR P3.0

                                SETB P3.2

                                ACALL DE

                                CLR P3.2

                                RET

DE:

                                MOV R3,#0FFH

H1:                         DJNZ R3,H1

                                RET

 

INI:         MOV A,#38H

                                ACALL CW

                                ACALL DE

                                MOV A,#0EH

                                ACALL CW

                                ACALL DE

                                MOV A,#01H

                                ACALL CW

                                ACALL DE

                                MOV A,#06H

                                ACALL CW

                                ACALL DE

                                MOV A,#081H

                                ACALL CW

                                ACALL DE

                                RET

DTA:

                                MOV A,R6

                                ACALL DWRO

                                ACALL DE

                                MOV A,R7

                                ACALL DWRO

                                ACALL DE

                                MOV A,#'C'

                                ACALL DWRO

                                ACALL DE

                                RET

 

CONV:

                                MOV B,#10

                                DIV AB

                                MOV R7,B

                                MOV B,#10

                                DIV AB

                                MOV R6,B

                                MOV A,R6

                                ADD A,#30H

                                MOV R6,A

                                MOV A,R7

                                ADD A,#30H

                                MOV R7,A

                                RET

INTRR:

                                CPL P1.5

                                CLR TR0

                                MOV 79H,R2

HE:                         DJNZ 79H,HE

                                SETB TR0

                                CPL P1.5

                                RETI      

GRAT:  

                                CLR TR0

                                MOV R2,#0AAH

                                MOV TH0,#0AFH

                                SETB TR0

                                RET

LOWER:               

                                CLR TR0

                                MOV R2,#0AAH

                                MOV TH0,#1FH

                                SETB TR0

                                RET

END

###

 


Circuit Diagrams

Temperature-Controlled-Fan2


Filed Under: Electronic Projects
Tagged With: 8051 microcontroller, ceiling fan, motor, temprature control
 

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

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!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a loop calibrator? 
  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • RCF Subwoofer Amplifier PIC16F870-I/SP please help me about hex code
  • What was before microcontrollers ?
  • file edit
  • Measure AC current accurateley (100mA to 10A)
  • 74HC595 creating Fake output

RSS Electro-Tech-Online.com Discussions

  • Control Bare LCD With ATmega328p
  • Need a ducted soldering fan for solder smoke extraction
  • Identify a circuit.
  • Sla ir li ion
  • Question about ultrasonic mist maker
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering