Thursday, 5 October 2017

Temperature Controlled DC Fan using Microcontroller



A Temperature Controlled DC Fan is a system which automatically turns on a DC Fan when the ambient temperature increases above a certain limit.
Generally, electronic devices produce more heat. So this heat should be reduced in order to protect the device. There are many ways to reduce this heat. One way is to switch on the fan spontaneously.
This article describes two such circuits that automatically, switches the fan when it detects the temperature inside the device greater than its threshold value. 

Circuit 1 Temperature Controlled DC Fan using 8051

Circuit Diagram





Principle

The project works on the principle of Analog to Digital Conversion. The Analog data from the LM35 temperature sensor is given to the analog to digital converter ADC0804.
The analog output of the temperature sensor will vary at 10mV per degree Celsius.
ADC0804 is an 8-bit ADC. For a reference voltage of 5V, we’ll get a resolution of 5V/28 = 20mV. Which means, this is the minimum change in the analog value from the sensor which is recognisable by the ADC IC.
As per the changes in the temperature, the output of the ADC is generated. The digital output of the ADC is given to Microcontroller to calculate the temperature and control the fan accordingly.

Components

Microcontroller Section
  • AT89C51 Microcontroller
  • AT89C51 Programmer Board
  • 11.0592 MHz Quartz Crystal
  • 33pF Ceramic Capacitor
  • 2 x 10KΩ Resistor
  • 10µF Electrolytic Capacitor
  • Push Button
  • 16 X 2 LCD Display
  • 10KΩ POT
Temperature Sensor Section
  • LM35
  • ADC0804
  • 10KΩ Resistor
  • 150pF Ceramic Capacitor
  • 1KΩ x 8 Resistor Pack
Load Section
  • 2N2222 NPN Transistor
  • 1N4007 Diode
  • 12V Relay
  • 1KΩ Resistor
  • Fan

Configuring ADC0804 for this Project

The configuration of the ADC0804 is explained here. First, we need to connect the 5V regulated power supply to the Vcc pin (Pin 20). Then, connect the analog and digital ground pins (Pins 8 and 10) to the GND.
In order to use the internal clock, we need to connect a 10KΩ resistor between CLK IN (Pin 4 and CLK R (Pin 19) and then, connect a 150pF cap between pins 4 and GND to complete the oscillator circuit.
The CS pin (Pin 1) is connected to GND to enable the ADC.
In order to read the data from the ADC continuously by the microcontroller, we need to connect the RD pin (Pin 2) to the GND.
For the ADC to continuously read the analog data from the sensor, we need to short the Write pin (Pin 3) with the Interrupt pin (Pin 5).
The analog output of the sensor (LM35) is connected to the Vin+ (Pin 6) of the ADC. The negative analog input pin i.e. Vin- of the ADC is connected to the GND.
The converted digital data which is an 8-bit data will be available at DB0 to DB7 (Pins 18 to 11).

Circuit Design

The main components of the project are 8051 Microcontroller, 16×2 LCD Display, LM35 Temperature Sensor, ADC0804, Relay and Fan.
The basic connections with respect to microcontroller include clock, reset and EA. Clock consists of an 11.0592 MHz crystal and two 33pF capacitors. The reset circuit consists of a 10µF capacitor, 10KΩ resistor and a push button. The EA pin is pulled high with a 10KΩ resistor.
Now we’ll see the connections with respect to other components.
For the LCD display, a 10KΩ pot is connected to contrast adjust pin. The three control pins of the LCD are connected to the pins P3.6, GND and P3.7.
The 8 data pins of the LCD are connected to PORT1 of the microcontroller.
The basic connections with respect to ADC are explained in its configuration. The 8 digital outputs of the ADC must be connected to PORT 2 of the microcontroller.
The next component we are going to connect is LM35. Connect the data pin of the LM35 to the analog input pin i.e. Pin 6 of ADC.
Finally, we need to connect the Relay circuit consisting of resistor, transistor and relay to the PORT0 of the microcontroller with PORT 0 pulled-up externally.
Connect the input of relay i.e. base of the transistor to P0.0 pin of the microcontroller.

Working

The aim of this project is to design a temperature controlled fan using 8051 microcontroller, in which the fan is automatically turned ON or OFF according to the temperature. The working of the project is explained here.
In this circuit, the LM35 temperature sensor will give continuous analog output corresponding to the temperature sensed by it. This analog signal is given to the ADC, which converts the analog values to digital values.
The digital output of the ADC is equivalent to sensed analog voltage.
In order to get the temperature from the sensed analog voltage, we need to perform some calculations in the programming for the microcontroller.
Once the calculations are done by the microcontroller according to the logic, the temperature is displayed on the LCD. Like this, the microcontroller will continuously monitor the temperature.
If the temperature exceeds more than 50 deg Celsius (as per the code), the microcontroller will turn on the relay to start the fan. If the temperature drops below 40 deg Celsius (as per the 

No comments:

Post a Comment