Sie sind auf Seite 1von 14

Automatic Room Temperature Controlled Fan Using

Arduino Uno Microcontroller

Md Al Emran, Fahima Akter, Fahim Shahriar Akash , Hasnat Azam, Tahmin


Aysha Murshed

School of Engineering & Computer Science,


Department of Computer Science and Engineering,
BRAC University, 66 ,Mohakhali , Dhaka, Bangladesh.

(imraan.parvez15@gmail.com,fahimasummer2014@gmail.com
,afahimshahriar@gmail.com,ha.pallab@gmail.com,tahminmn@gmail.com )

Abstract: This paper presents the designs and the simulation of a DC fan control
system based on room temperature using pulse width modulation technique,
humidity and temperature sensor namely DHT11 with Arduino Uno
Microcontroller. The fan will be used to reduce temperature of a room at certain
level. To build the fan, we will use DTH11 Humidity Sensor. The sensor will
measure the temperature continuously. When the temperature gets higher from a
specific temperature, the fan will be on “On” mode. The speed of the fan will be
determined by pwm using pulse-width modulation. The temperature along with the
speed of the fan will be displayed through LCD monitor.

1. Introduction

With the advancement of technology, intelligent system is introduced every day.


Everything is getting sophisticated day by day. There is an increase demand of
technology and smart electronic system. Electric fan is one of the most popular
electronic device due to its cost effectiveness and low power consumption advantages.
It is one of the most sensible to offer a comfortable and energy efficient. The fan has
been long used and still available in the market.
Demand for the accurate temperature control has conquered many of industrial
domains. Automatic temperature control is important in order to maintain a comfortable
environment. Automation System aims to further the cause of automation so as to
achieve the goal of simplicity. Primitive sense of using a fan by button the switch and
by controlling the speed controller. In this method there is no chance that the
temperature can change the speed of fan except changing the speed of fan by manually.
So, it is needed to create an automatic temperature control system for fan of which the
speed will changed by measuring temperature.
Automatic temperature controlled fan leverages the power of Arduino to provide an
automation control system of fan which speed is controlled by measuring temperature
by itself. Using Arduino, motor, wires, sensors and other hardware the fan measure the
surrounding temperature and on depending that control the speed of fan automatically.
It is one practical use is to integrate a microcontroller in a temperature control system
that can be used for automatically controlling a room temperature by controlling the
fan’s speed automatically.

2. Equipment

o Arduino UNO
o DHT11 Sensor
o DC Fan
o 2n2222 Transistor
o Battery(9v)
o Resistor(1k)
o Wires
o Breadboard
o LCD Display

2.1 Arduino Uno:


Arduino Uno is a microcontroller board based on the ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the microcontroller.
We need to connect it to a computer with a USB cable or power it with a Ac-to-DC
adapter or battery to get started.
Basically, the Arduino software (IDE) includes a serial monitor which allows
simple textual data to be sent sequentially from one board to another. The instructions
are transmitted through the Bluetooth port which is matched against the various
combinations of predefined texts to switch the appliances to on/off. If the matching
instruction is detected the correspondent pin number gives a high signal to switch, that
shows on. On the other hand, while the correspondent pin number gives low output
signal to the switch, that shows it off.

Figure: Arduino Uno

2.2 DHT11 Sensor:


The DHT11 sensor is a sensor for measuring temperature and humidity. It
works in three lines: GND, +5V and a single data line. The values are clocked out
over the single digital line. [2] It uses a capacity humidity sensor and a thermistor to
measure the surrounding air and gives out a digital signal on the data pin. This sensor
is so simple to use. The only downside of this sensor is, we can get new data from the
sensor once every 2 seconds. So, the sensor reading can be up to 2 seconds old.
Figure: DHT11 Sensor

2.3 DC Fan:
Direct current fan is used for this project. The Dc motor starts up when a
small electric current is passed through a magnetic field coil. this magnetic force
produces the torque which turns the motor continuously. Further, DC fans consume
up to 70% less energy and run almost silently.

Figure: DC Fan

2.4 2n2222 Transistor:


It is an NPN silicon bipolar junction transistor. It helps our total project by
being used to drive large loads as well as drive large loads or amplifying or switching
applications.
Figure: 2N2222 Transistor

2.5 Battery (9v):


In this project, we have used 9-volt lithium battery as a source of energy.

Figure: Battery

2.6 Resistors:
A resistor is a passive two-terminal electrical component that
implements electrical resistance as a circuit element. In electronic circuits, resistors
are used to reduce current flow, adjust signal levels, to divide voltages, bias active
elements, and terminate transmission lines, among other uses. High-power resistors
that can dissipate many watts of electrical power as heat may be used as part of motor
controls, in power distribution systems, or as test loads for generators.
Figure: Resistors

2.7 Wires:

A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire,
or DuPont cable – named for one manufacturer of them) is an electrical wire or group
of them in a cable with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of
a breadboard or other prototype or test circuit, internally or with other equipment or
components, without soldering.

Figure: Wires

2.8 Breadboard:

A breadboard is a construction base for prototyping of electronics. Originally it


was literally a bread board, a polished piece of wood used for slicing bread.
Figure: Breadboard

2.9 LCD Display:


A liquid-crystal display (LCD) is a flat-panel display or other electronic
visual display that uses the light-modulating properties of liquid crystals. Liquid
crystals do not emit light directly. LCDs are available to display arbitrary images (as in
a general-purpose computer display) or fixed images with low information content,
which can be displayed or hidden, such as preset words, digits, and 7-segment displays,
as in a digital clock. They use the same basic technology, except that arbitrary images
are made up of a large number of small pixels, while other displays have larger elements

Figure: LCD Display

3. Experimentation

This project consists of three sections. One senses the temperature by using
humidity and temperature sensor namely DHT11. Second section reads the dht11
sensor module’s output and extracts temperature value into a suitable number in Celsius
scale and control the fan speed by using PWM. And last part of system shows humidity
and temperature on LCD and Fan driver.

Figure: Circuit Design

We attached the Arduino Uno board, DHT11 Humidity sensor, LCD, DC Fan, 9-volt
Battery and we used jumper wires (male–male, male-female) for connecting the
equipment. We coded in Arduino IDE 1.6.12 for Setting up the DHT11 sensor and we
used Liquid Crystal & DHT sensor library for controlling the temperature and Arduino.
Then We used our own code to control the fan using these libraries.
Figure: Hardware Model
Figure: Project Model

For the test runs, at first we start the Arduino and read the temperature and the fan
speed. At that moment the temperature was 30 Degree and the fan speed was 66%.
Then we put a sticking tape on the DHT11 sensor to decrease the temperature. After
some time, the temperature was decreased to 27 Degree and the fan speed 40%. After
reading this temperature and fan speed we ensured that our project worked successfully.
Figure: Experimentation

Figure: Flowchart of Temperature reading & Implementation


4. Code of Automatic Room Temperature Controlled Fan

For coding we have used the built-in Dht.h, LiquidCrystal.cpp &


LiquidCrystal.h Library and at last we have used our own code for controlling the
temperature.

Temperature Controlling Code:


#include<dht.h> // Including library for dht
#include<LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#define dht_dpin 12
dht DHT;
#define pwm 9
byte degree[8] =
{
0b00011,
0b00011,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
void setup()
{
lcd.begin(16, 2);
lcd.createChar(1, degree);
lcd.clear();
lcd.print(" Fan Speed ");
lcd.setCursor(0,1);
lcd.print(" Controlling ");
delay(2000);
analogWrite(pwm, 255);
lcd.clear();
lcd.print("Circuit Digest ");
delay(2000);
}
void loop()
{
DHT.read11(dht_dpin);
int temp=DHT.temperature;
lcd.setCursor(0,0);
lcd.print("Temperature:");
lcd.print(temp); // Printing temperature on LCD
lcd.write(1);
lcd.print("C");
lcd.setCursor(0,1);
if(temp <26 )
{
analogWrite(9,0);
lcd.print("Fan OFF ");
delay(100);
}

else if(temp==26)
{
analogWrite(pwm, 51);
lcd.print("Fan Speed: 20% ");
delay(100);
}

else if(temp==27)
{
analogWrite(pwm, 102);
lcd.print("Fan Speed: 40% ");
delay(100);
}

else if(temp==28)
{
analogWrite(pwm, 153);
lcd.print("Fan Speed: 60% ");
delay(100);
}

else if(temp==29)
{
analogWrite(pwm, 204);
lcd.print("Fan Speed: 80% ");
delay(100);
}
else if(temp>29)
{
analogWrite(pwm, 255);
lcd.print("Fan Speed: 100% ");
delay(100);
}
delay(3000);
}

5. Results

From the project we done, we observed that among the 10 times of test run, our project
worked very fast for 8 times. When the temperature was increased like 33 degrees the
fan speed increased to 90% very fast and when the temperature decreased to 25 degrees
the fan speed also decreased to 35%. But sometimes it works slow to decrease the fan
speed. So by experimenting 10 test run we can say that our success rate in the
experimental test run was 80%.
6. Evaluation

We have used DHT11 sensor for temperature readings. But there us another sensor
which is DHT22 sensor because DHT11 sensor is more cheap than DHT11 and
comparatively accurate like DHT22 sensor.

Here we compared DHT11 and DHT22 sensor.

DHT11 Sensor DHT11 Sensor

Ultra Low cost. Low cost.

3 to 5V power and I/O. 3 to 5V power and I/O.

4 pins with 0.1” spacing. 4 pins with 0.01” spacing.

Good for 20-80% humidity readings Good for 0-100% humidity readings
with 5% accuracy. With 2-5% accuracy.

No more than 1Hz sampling rate. No more than 0.5 Hz sampling rate.

Compared to the sensors our DHT11 sensor gave us mostly accurate values of
temperature readings.

In comparison with the model of the Arduino we used, here is the comparison of
Arduino Uno with another Arduino Model Mega.

Arduino Uno Arduino Mega


Has an EPROM of 1 KB Has an EPROM of 4 KB

Has an SRAM of 2 KB Has an SRAM of 8 KB

Has an Flash memory of 32 KB Has an Flash memory of 256 KB

Has 1 UART (Universal Asynchronous Has 4 UART (Universal Asynchronous


Receiver and Transmitter) Receiver and Transmitter)

For our project we use Arduino Uno which is compatible with the
project with enough functionality. For that reason, we didn’t use the High
functional Arduino Mega model.

7. Conclusion

In this paper, we proposed a model of automatic room temperature controlled


fan using Arduino Uno which will detect the temperature of room by DHT11 sensor
and control the fan speed. After the experimentations we performed, studying the
results, we came to the conclusion that our proposed model will produce satisfactory
outcome if used in our house.

References
1. Sushma Verma, Arpita Das, Subham Dey, Parijat Chowdhury, Automatic
Temperature Controlled Fan Using Thermistor,ISSN:2321-1156
International Journal of Innovative Research in Technology &
Science(IJIRTS)
http://ijirts.org/volume4issue4/IJIRTSV4I4002.pdf

2. Mustafa Saad, Hossam Abdoalgader, and Muammer Mohamed ,


Automatic Fan Speed Control System Using Microcontroller, 6th Int'l
Conference on Electrical, Electronics & Civil Engineering
(ICEECE'2014) Nov. 27-28, 2014 Cape Town (South Africa) ,
http://psrcentre.org/images/extraimages/16%201114052.pdf

3. Vaibhav Bhatia, Gavish Bhatia, Room Temperature based Fan Speed


Control System using Pulse Width Modulation Technique, International
Journal of Computer Applications (0975 – 8887) Volume 81 – No5,
November2013,
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.402.4748&rep
=rep1&type=pdf

4. Zairi Ismael Rizman, Kim Ho Yeap, Nuraiza Ismail, Design an Automatic


Temperature Control System for Smart Electric Fan Using PIC,
International Journal of Science and Research (IJSR), India Online ISSN:
2319-7064 , https://www.ijsr.net/archive/v2i9/MjEwODEzMDE=.pdf

5. Vikas Vats and Upendra Kumar, Speed control of fan Based on room
temperature by using programmable logic controller , International
Journal of Recent Scientific Research Vol. 6, Issue, 4, pp.3537-3539,
April, 2015, http://www.recentscientific.com/sites/default/files/2270.pdf

Das könnte Ihnen auch gefallen