31-37 Automatic Fan Design Based On Microcontroller With Combination of DHT11 Sensor and Motion Sensor
31-37 Automatic Fan Design Based On Microcontroller With Combination of DHT11 Sensor and Motion Sensor
ARTICLE INFORMATION A B S T R A C T
The development of a more sophisticated fan is a necessity. One way to improve fan
Received: August 12, 2024
performance is to add temperature and humidity sensors, so that the fan can rotate
Revised: August 18, 2024
automatically according to the desired temperature and humidity. By using the
Available Online: August 21, 2024
Arduino Nano microcontroller, DHT11 sensor and Motion PIR sensor, the fan can
be controlled automatically and can rotate at a speed set according to the temperature
KEYWORDS and humidity measured by the DHT11 sensor, and can detect whether there are
people inside by using the Motion PIR sensor. That way, the fan can work more
Microcontroller effectively and efficiently in maintaining coolness and air quality in the room. In
Arduino Nano addition, the use of microcontrollers, DHT11 sensors, and PIR motion sensors also
makes it easier for users to manage fans and maintain temperature and humidity in
Arduino IDE
the room more easily. Therefore, by utilizing the DHT11 sensor and PIR sensor and
Motion Sensor
controlled by the Arduino Nano microcontroller. The test results obtained are the fan
DHT11 Sensor will turn on in a temperature condition of 30oc or there are people in the room and
the fan will turn off if it does not meet these conditions. With a system like this it
CORRESPONDENCE (*) will extend the life of the fan and make it practical in turning on and off the fan.
INTRODUCTION
Indonesia has a tropical climate, where Indonesia has two seasons, namely the rainy season and the dry season. If the
conditions are summer, then the weather around becomes hot, besides global warming is another factor that affects the
weather to be uncertain [1,2,3]. With that, many people are looking for solutions to cool the temperature by using Air
Conditioner (AC), fans and soaking, or also taking a shower. Temperature can greatly affect activity and concentration in
learning. Doing activities with hot room temperatures can reduce the body's physical abilities, concentration, fatigue and
sometimes cause changes in mood, namely emotions [4,5,6].
Fans are the most widely owned electronic devices by Indonesian people because they are affordable and have benefits
that are very much needed in Indonesia's tropical climate. However, people often forget to turn off fans when they are not
in use, which results in excessive and wasted electricity usage. And often similar things happen, resulting in easy damage
to the fan, which makes the fan's lifespan short [7,8,9].
Therefore, the use of a more sophisticated fan becomes a necessity, one way to improve fan performance is to add a
temperature and humidity sensor, so that the fan can rotate automatically according to the desired temperature and
humidity needs and also by adding a sensor that can measure infrared rays emitted by objects such as humans [10,11,12].
By using the Arduino Nano microcontroller, DHT11 sensor and motion sensor, the fan can be controlled automatically
and can rotate at a speed that is set according to the temperature and humidity measured by the DHT11 sensor, and can
detect movement measured by infrared rays emitted by objects such as humans [13,14].
That way the fan can work more effectively and efficiently in maintaining the coolness and quality of indoor air. In
addition, the use of a microcontroller, DHT11 sensor, and Motion sensor also makes it easier for users to control the fan
and maintain the temperature and humidity in the room more easily. Therefore, by utilizing the DHT11 sensor and Pir
Motion Sensor and controlled by the Arduino Nano Microcontroller. Based on the description above, this design carries
out "Automatic Fan Design Based on Microcontroller with a Combination of DHT11 and Motion Sensor".
Temperature and humidity are two measurement objects that are often found in data acquisition systems. There are many
sensor devices that function to measure these two objects and accuracy is one of the parameters that can be used to select
them. DHT11 and DHT22 are DHT series sensors from Aosong Electronics that can measure temperature and humidity
simultaneously with digital output. Information about accuracy is available in the data sheets of both. However, this
information does not describe the actual conditions when operated at a particular location or platform. The purpose of
this study is to compare the accuracy of DHT11 and DHT22 in measuring temperature and humidity when operated
indoors and outdoors, using the ATMEL AVR and Arduino platforms.
METHOD
Microcontroller
A microcontroller is a chip in the form of an IC (integrated circuit) that can receive input signals, process them, and
provide output signals according to the program loaded into it. It is designed to perform certain tasks or operations.
Basically, a microcontroller IC consists of one or more processor cores (CPU), memory (RAM and ROM), and
programmable input and output devices. In its application, Micro Controller, called Microcontroller in English, is used in
products or equipment that are automatically controlled such as car engine control systems, medical equipment, remote
controls, machines, electrical equipment, toys, and equipment that uses other embedded systems [3,4,5].
Temperature Sensor
A temperature sensor is a measure of the heat or coldness of an object. A more precise definition is a measure of the speed
of motion of particles in an object or the average kinetic measure of particles in an object. To measure temperature in
everyday life, people tend to use their sense of touch. However, in today's modern world, measuring temperature can be
done easily, namely by using a sensor. One of the temperature sensors that is often used is the DHT11 [15,16,17].
DHT11
The advantages of this sensor module compared to other sensor modules are in terms of the quality of reading sensing
data which is more responsive and has speed in reading temperature and humidity objects, and the data read is not easily
interfered with. The DHT11 sensor generally has a calibration feature for temperature and humidity reading values that
are quite accurate. The storage of the calibration data is in the OTP program memory which is also called the calibration
coefficient. This sensor has 4 pin legs, and there is also a DHT11 sensor with a PCB breakout which only has 3 legs
[10,11,12].
ICLM35
To detect temperature, a temperature sensor LM 35 is used which can be calibrated directly. The LM 35 functions as:
The LM35 sensor has 3 pins, each of which, if seen from the front, has a function, namely pin 1 functions as a source of
working voltage from the LM35 sensor, pin 2 or the middle is used as an output voltage or Vout and pin 3 functions as
ground. Vout on the LM35 sensor has an output voltage that is linearly scaled to the measured temperature, which is
10mV per 10C. So, if Vout = 530mV, then the measured temperature is 530C [1,2,3].
Pir Sensor
(Lukman et al., 2018) The PIR (Passive Infra Red) sensor module is a sensor that functions as a motion detector that
works by detecting differences or changes in current and previous temperatures. Motion sensors using a PIR module are
very simple and easy to apply because the PIR module only requires a DC 5V input voltage which is effective enough to
detect movement up to a distance of 5 meters. When it does not detect movement, the module output is LOW [7,8,9].
Arduino Uno
Arduino Uno is a microcontroller board based on ATmega328 (datasheet). It has 14 input pins from digital output where
6 input pins can be used as PWM output and 6 analog input pins, 16 MHz crystal oscillator, USB connection, power jack,
ICSP header, and reset button. To support the microcontroller to be used, simply connect the Arduino Uno Board to the
computer using a USB cable or power with an AC-to-DC adapter or battery to run it. Each of the 14 digital pins on the
Arduino Uno can be used as input and output, using the pinMode(), digitalwrite(), and digitalRead() functions. These
functions operate at 5 volts, Each pin can provide or receive a maximum current of 40 mA and has a pull-up resistor
(disconnected by default) of 20-50 kOhm [6,7,8].
The system device starts from the installation of DHT11 which is connected to Arduino Nano which is used for reading
room temperature and humidity and motion sensor pir motion detector. Next, the installation of the relay as a switch to
turn the fan on and off automatically, then the installation of the LCD as a provider of information on what has been read
by DHT11 and the motion sensor will turn on our fan if movement is detected [6,7,8].
In the design of the Microcontroller-Based Automatic Fan with a Combination of DHT11 Sensors and Motion Sensors,
testing is carried out after the circuit is assembled as a whole. This test is carried out to prove that the designed and
manufactured tool can work according to its function.
Trial Steps
In the Microcontroller-Based Automatic Fan Circuit with a Combination of DHT11 Sensors and Motion Sensors, the trial
steps are carried out to determine the results of the hardware and software implementation whether it can run as expected
or otherwise. There are three stages of trials that are carried out, namely trials on temperature and humidity to determine
the level of accuracy, trials on human motion sensors in the room, and trials on system performance, in order to determine
whether the system can work as expected or otherwise, the stages of the trials carried out are, the first is trying to produce
room temperature and humidity as determined, and temperature and humidity data. To produce the desired temperature
and humidity, a soldering iron and a lighter are used to generate hot air, so that the temperature can be adjusted up and
down, and there is an object where the object will activate the motion sensor.
Manipulating temperature and humidity aims to facilitate the process of testing and observing the performance of sensors
from automatic fans based on microcontrollers with a combination of DHT11 sensors and motion sensors.
Sensor Test
The sensor testing phase aims to ensure that the sensor that has been made can be as expected, by observing the output
produced from the DHT11 sensor which can be observed by utilizing the tools available on the Arduino IDE, the
observations that will be made are as shown in Figure 6.
From Figure 6 above we can observe the output generated from the DHT11 sensor carried out on the Arduino IDE, where
temperature and humidity are detected, and if the temperature is more than 30'C the fan will turn on automatically. The
observation data used for observation can be seen in Table 1 below.
From the results of the trials that have been carried out, the aim is to test the temperature sensor and motion sensor that
have been made on the Automatic Fan Based on Microcontrollers with a Combination of DHT11 Sensors and Motion
Sensors, and data analysis has been carried out, the results obtained Motion sensor is 87% accuracy and DHT11 sensor
that is made is able to work with 85% accuracy, while the problems that occur during the experiment such as lack of
accuracy in running the temperature sensor provided are constraints of the hardware components. The constraints of
regulating or manipulating temperature and humidity to produce the expected temperature and humidity, with the existing
equipment is quite difficult, and has many shortcomings, including the temperature and humidity detected by the DHT11
sensor, tend to be unstable due to changes in temperature and humidity that change very quickly so that the automatic fan
based on the Arduino Uno microcontroller and DHT11 sensor tends to be unstable.
System Testing
This automatic fan system trial was conducted to ensure that the hardware components that have been assembled can run
and work well on the prototype of the microcontroller-based automatic fan with a combination of DHT11 sensors and
Motion sensors and to ensure that the temperature sensor that has been created can work as expected.
The testing method is to observe the temperature and humidity readings from the DHT11 sensor and the motion reader
that will be detected by the motion sensor so that it can be processed by the Arduino and provide a signal to the relay to
turn on the fan according to the temperature and humidity that have been determined. Where the test was carried out in
the boarding room for three days.
This tool is used as evidence that the tool is in accordance with the design that has been made which is shown in figure 7
above. This system uses a 9 V USB type C cable for the voltage supply to the Arduino and a 220 V supply for the voltage
to turn on the fan with a dht11 sensor and motion sensor.
Trial Results
From the results of the trial conducted for 3 days, several data were taken, where from the table it can be seen that the
results are all in accordance, from the results obtained there are several factors that make the performance of the automatic
fan based on a microcontroller with a combination of DHT11 sensors and Motion sensors can work optimally, which
among them are the temperature and humidity factors for 3 days which tend to be stable between temperatures of 27˚C -
33˚C and humidity of 68% - 81% so that the fan moves automatically to the on position.
CONCLUSION
Based on the descriptions that have been explained in the previous chapters, the following conclusions can be drawn: The
fan operates automatically based on temperature and the presence of people, turning on at a temperature of 30°C or if
there are people in the room, and turning off if these conditions are not met. Energy use becomes more efficient, and the
life of the fan can be extended because it only operates when needed. This system makes it easy for users to adjust the
fan without having to do it manually, providing comfort and ease of operation. The result of the combination of the
DHT11 sensor with the motion sensor is that it can measure temperature and humidity simultaneously with digital output.
REFERENCES