Automatic Fan Controland Intensity Control by Using Microcontroller
Automatic Fan Controland Intensity Control by Using Microcontroller
Submitted by
ROHINI.P (960618105015)
SARITHA.T (960618105016)
BACHELOR OF ENGINEERING
in
ELECTRICAL AND ELECTRONICS ENGINEERING
AUGEST 2021
AUTOMATIC FAN CONTROL AND
INTENSITY CONTROL BY USING
MICROCONTROLLER
Submitted by
ROHINI.P (960618105015)
SARITHA.T (960618105016)
BACHELOR OF ENGINEERING
in
AUGEST 2021
ANNA UNIVERSITY : CHENNAI 600 025
BONAFIDE CERTIFICATE
Certified that this mini project report “Automatic Fan Control and
Intensity Control By Using Microcontroller” Is the bonafide work of
Abisha Rengitham. R (960618105001), Rohini. P (960618105015) and
Saritha .T(960618105016) carried out the mini project work under my
supervision.
SIGNATURE SIGNATURE
We thank our family members and friends for their honourable support.
iii
ABSTRACT
iv
TABLE OF CONTENTS
ABSTRACT iv
ACKNOWLEDGEMENT iii
LIST OF ABBREVIATIONS ix
1 INTRODUCTION 1
1.4 Objective 4
2 LITERATURE SURVEY 4
3 SYSTEM ANALYSIS 13
3.1.1 Disadvantages 14
3.2.1 Advantages 14
v
3.3 Description 14
4 SYSTEM IMPLEMENTATION 16
4.3 Application 19
4.4.4 Specifications 29
4.4.7 Communications 31
4.5.1 Operation 33
vi
4.5.4 Placement 35
4.5.6 DC motor 36
5 Software Implementation 38
5.1 Algorithm 38
5.2 Software 41
5.2.2 Libraries 44
5.2.3 Embedded C 45
7 Conclusion 48
References 49
vii
LIST OF FIGURES
4.7 DC motor 40
viii
LIST OF ABBREVIATION
BI BUSINESS INTELLIGENCE
ix
CHAPTER 1
INTRODUCTION
1
1.1 OVERVIEW OF THE PROJECT
With the advancement in technology, intelligent systems are introduced every day.
Everything is getting more sophisticated and intelligible. There is an increase in the
demand of cutting-edge technology and smart electronic systems. Microcontrollers play a
very important role in the development of the smart systems as brain is given to the system.
Microcontrollers have become the heart of the new technologies that are being introduced
daily. A microcontroller is mainly a single chip microprocessor suited for control and
automation of machines and processes. Today, microcontrollers are used in many
disciplines of life for carrying out automated tasks in a more accurate manner. Almost
every modern day device including air conditioners, power tools, toys, office machines
employ microcontrollers for their operation. Microcontroller essentially consists of Central
Processing Unit (CPU), timers and counters, interrupts, memory, input/output ports, analog
to digital converters (ADC) on a single chip. With this single chip integrated circuit design
of the microcontroller the size of control board is reduced and power consumption is low.
This project presents the design and simulation of the fan speed control system using PWM
technique based on the room temperature. A temperature sensor has been used to measure
the temperature of the room and the speed of the fan is varied according to the room
temperature using PWM technique. The duty cycle is varied from 0 to 100 to control the
fan speed depending upon the room temperature, which is displayed on Liquid Crystal
Display.
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital
means. Digital control is used to create a square wave, a signal switched between on and
off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts)
by changing the portion of the time the signal spends on versus the time that the signal
spends off. The duration of "on time" is called the pulse width.
2
To get varying analog values, we change, or modulate, that pulse width. If we repeat this
on-off pattern fast enough with an LED for example, the result is as if the signal is a steady
voltage between 0 and 5v controlling the brightness of the LED.
One disadvantage of this approach, however, is that it can make the fan noisy
because of the pulsed nature of the signal. The PWM waveform’s sharp edges cause the
fan’s mechanical structure to move (like a badly-designed loudspeaker), which can easily
be audible.
This project is a standalone automatic fan speed controller that controls the speed of
an electric fan according to the requirement. Use of embedded technology makes this
closed-loop feedback-control system efficient and reliable. The microcontroller
(MCU) ATMega8/168/328 allows dynamic and faster control and the LCD makes the
system user-friendly. Sensed temperature and fan speed levels are simultaneously displayed
on the LCD panel.
The project is very compact and uses a few components only. It can be implemented
for several applications including air-conditioners, water-heaters, snow-melters, ovens,
heat-exchangers, mixers, furnaces, incubators, thermal baths and veterinary operating
tables. The project will help save energy/electricity.
3
1.3 PROBLEM STATEMENT
Most human feels the badly designed about changing the fan rate level physically
when the room temperature changes. Along these lines, the programmed fan framework
that consequently changes the velocity level as indicated by temperature changes is
prescribed to be fabricated for tackling this issue.
1.4 OBJECTIVE
To develop a low cost, user friendly automated temperature-controlled fan regulator
which reduces power consumption and also assist people who are unable to control the
speed of fan from their locations.
4
CHAPTER 2
LITERATURE SURVEY
5
M. Charishma and D.S.K. Chandrasekar (2018) discovered Comparison of PI,
Fuzzy and Sliding Mode Control Techniques in Speed Control of BLDC Motor
explains the concept of Developments made in the fields of control system engineering is
responsible for paradigm shift in technology and industries. The paper constitutes of BLDC
motor load fed from Luo converter. A Luo converter is special DC-DC converter with a
single switch. The negative output elementary Luo converter is employed for conversion of
voltages. The input for BLDC motor load is fed from a three phase VSI with 120⸰
conduction mode. In this paper speed control of BLDC motor is done by employing various
controllers like PI, fuzzy logic and SMC controllers. The converter system used here is Luo
converter for DC-DC conversion followed by three phase inverter circuit for DC-AC
conversion to energise BLDC. The input DC power is generated by photovoltaic systems.
For obtaining maximum power from PV system, MPPT algorithm also used. The circuit is
simulated in MATLAB Simulink. The step responses of three controllers compared from
the obtained results. The optimum speed control is seen in SMC controller when compared
to fuzzy and PI.
Jival Angeti, Adamu S. Kadala and Gadada (2019) discovered Speed Control of
BLDC Motor using Fuzzy: Tuned PID Controller explains the concept of Brushless DC
(BLDCM) Motor is becoming more prominent and more attractive as the demand for
efficiency, reliability, torque control, precise speed and ruggedness increases. BLDC Motor
as the name implies they have neither brushes nor commutators, the commutation of BLDC
Motor is performed with the help of Electronic circuit, and these Motors have several
advantages over Brushed DC Motor which include: better torque versus speed
characteristic, higher efficiency, better dynamic response due to low rotor inertia, higher
speed range etc. This paper presents the execution of PID controller and Fuzzy Tuned PID
controller utilizing Simulink display. Tuning the PID gains and processing utilizing
conventional PID controller is troublesome and poor vigorous, it doesn't give fulfilled
6
control characteristic when compare with Fuzzy Tuned PID controller. From the simulation
results it is clearly demonstrated that Fuzzy Tuned PID controller gives better control
execution when compared with conventional PID controller. MATLAB/SIMULINK
environment is utilized to do the examination above
Alsayid, basim, salah, wael a and alawneh, yazeed (2019) discovered Modelling
Of Sensored Speed Control Of BLDC Motor explains the concept of recent
developments in the field of magnetic materials and power electronics, along with the
availability of cheap powerful processors, have increased the adoption of brushless
direct current (bldc) motors for various applications, such as in home appliances as
well as in automotive, aerospace, and medical industries. The wide adoption of this
motor is due to its many advantages over other types of motors, such as high efficiency,
high dynamic response, long operating life, relatively quiet operation, and higher speed
ranges. This paper presents a simulation of digital sensor control of permanent magnet
bldc motor speed using the matlab/simulink environment. A closed loop speed control
was developed, and different tests were conducted to evaluate the validity of the
control algorithms. Results confirm the satisfactory operation of the proposed control
algorithms
A. Darcy gnana jegha, m.s.p. Subathra, nallapaneni manoj kumar and aritra
ghosh (2020) discovered optimally tuned interleaved luo converter for pv array fed
bldc motor driven centrifugal pumps using whale optimization algorithm—a resilient
solution for powering agricultural loads explains the concept of the use of brushless
direct current (bldc) motors are gaining much prominence in water pumping systems (wps),
especially for agricultural purposes.
In most cases, the bldc based wps is powered using electricity from the grid, which is
vulnerable to disruptive events causing a resilience problem. However, to avoid the
7
resilience issue, grid-interactive solar photovoltaics (pv) are being used, and this is due
to the increased penetration of distributed generation sources into the grid. In these
systems, based on the inherent nature of solar pv, power converters are preferred, and
as a result, problems like switching losses and maintaining steady-state voltages are
commonly seen. In this paper, a framework of pv powered wps with scope for
optimizing controller parameters is proposed to avoid the above-raised issues. Based
on the proposed framework, the overall structure of the pv powered wps is modeled,
designed, and analyzed. In the proposed system, the power output from solar pv is fed
to the bldc motor and the grid. If any problem arises in obtaining the power from solar
pv, grid-interaction helps to run the motor at required speeds making the wps resilient
to unexpected disruptions and vice versa. F or retrieving the generated power from pv
array, a positive interleaved luo converter (i-luo) is used, which boosts the output with
minimum switching losses. To maintain the steady-state voltage at the output of the i-
luo converter, a proportional-integral (pi) controller whose parameters are tuned by
whale optimization algorithm (woa) is used. This voltage is fetched to the bldc motor
via a 3-phase (3-ф) inverter and then to the grid via a single-phase (1-ф) inverter. The
overall system is simulated and experimentally validated, with a detailed analysis of
the observed results. The results include the various performance characteristics of the
solar pv, converter, and bldc motor. Besides, by using the field-programmable gate
array (fpga) based spartan6e controller, the performance of the i-luo is examined
experimentally
Huang Jigang, Fang Hui & Wang Jie (2019) discovered A PI controller
optimized with modified differential evolution algorithm for speed control of BLDC
motor explains the concept of a proportional integral (PI) controller that optimized with the
modified different evolutional (DE) algorithm is proposed for speed control of brushless
direct-current (BLDC) motor. The parameters of PI controller are tuned by the modified DE
8
algorithm which based on adaptive mutation factor, multivariable fitness function and the
starting rule for the modified algorithm. The performances of proposed controller, the
conventional PI controller and the PI controller optimized with standard DE controller (PI-
SDE controller) are investigated and compared in simulation. Also, the proposed controller
is compared with other optimization controller in this study. The simulation results and the
experimental verification show that the proposed controller leads to the smaller overshoot,
less setting time and rising time compared to other controllers in this study. The results also
show that the proposed controller can accelerate the response speed of BLDC motor,
strengthen the robustness and guarantee motor runs smoothly as well as precisely. This
work indicates the distinguished performance of proposed controller for the speed control
of BLDC motor
9
experimented for IAE and ISE error criteria. The suggested controller GA_PID is planned,
modeled and simulated by MATLAB/ software program. A comparison output system
performance monitored for every controller schemes. The results display that the time
characteristics performance of GA-PID controller based on ISE objective function has the
optimal performance (rise time, settling time, percentage overshoot) with other
techniques.In order to overcome this effect, the additional filter elements are added in the
luo-converter to eliminate the output ripples and effectively enhance the output voltage
level. the output stage of the luo converter is comprised of an inductor and capacitor so it
naturally acts as filter. the output stage stores and delivers energy to the load and smoothens
the output voltage to produce a constant output voltage. the luo converter acts as both buck
and boost converter by varying the duty cycle. thus this luo converter is used for the
proposed bldc motor drive. the sliding mode controller is used to make the speed of the
system constant in a small amount of time.
10
loop speed response of PID controller is experimented for IAE and ISE error criteria. The
suggested controller GA_PID is planned, modeled and simulated by MATLAB/ software
program. A comparison output system performance monitored for every controller schemes.
The results display that the time characteristics performance of GA-PID controller based on
ISE objective function has the optimal performance (rise time, settling time, percentage
overshoot) with other techniques
Zhi qi, qian shi and hui zhang (2019) discovered tuning of digital pid controllers
using particle swarm optimization algorithm for a can-based dc motor subject to
stochastic delays explains the concept of the tuning problem of digital proportional-
integral-derivative (pid) parameters for a dc motor controlled via the controller area
network (can). First, the model of the dc motor is presented with its parameters being
identified with experimental data. By studying the can network characteristics, we obtain
the can-induced delays related to the load rate and the priorities. Then, considering the
system model, the network properties, and the digital pid controller, the tuning problem of
pid parameters for the can-based dc motor is transformed into a design problem of a static-
output-feedback controller for a time-delayed system. To solve this problem, particle
swarm optimization algorithm and linear-quadratic-regulator method are adopted by
incorporating the sufficient condition of time-varying delay system. Finally, the
effectiveness of the proposed pid tuning strategy is validated by experimental results.
Bonzou adolphe kouassi; yiming zhang; sie ouattara; mesmin j. Mbyamm kiki (2019)
discovered PID tuning of chopper fed speed control of dc motor based on ant colony
optimization algorithm explains the concept of problems of optimization are very important
for both the worlds of sciences and industry. Owing to their practicality such as tiny
dimensions, velocity, lower building costs, safety operations, dc motor has been used as a
key aspect of industrial applications.
However, it is hard to acquire the correct controlling parameter values. The most
common control is the pid (proportional-integrated-derivative) controller due to its
efficiency and simple operation. this paper provides an approach of determining the
optimum control parameters of pid for the chopper fed speed motor control using the
ant colony optimization (aco). The efficiency and validity of the design method based
on aco are shown in the simulation outcomes.
13
CHAPTER 3
SYSTEM ANALYSIS
Facing the control difficulties caused by high order dynamics, nonlinearity and
multi-source disturbances, the traditional cascade PI control strategy for SST cannot ensure
the satisfactory control performance, especially under the condition of the wide-range load
regulation. Many improved and advanced control strategies have been developed to handle
the aforementioned difficulties. Some improved control strategies based on cascade PI
control strategy have been proposed, such as neuro PID and also developed to enhance the
control performance. Even though the control effect was demonstrated in numerical
simulations, these control strategies were rarely used in practical units due to the following
reasons:
(1) These control strategies have a large computation complexity and thus makes them
difficult to be implemented in the platform of the distributed control system (DCS).
(2) Some control strategies have a strong dependence on the accurate mathematical model
of SST while the accurate SST model is very hard to obtain and it changes with the
working condition
3.1.1 DISADVANTAGES
· Arduino uno is the heart of the circuit. If controller is damaged the whole system will
be interrupt
14
3.2 PROPOSED SYSTEM
3.2.1 ADVANTAGES
3.3 DESCRIPTION
The outcome obtained from the operation is given through the o/p port of an
Arduino board to the LCD display of related data. The generated pulses from
15
the board which is further fed to the driver circuit to get the preferred output
to the fan.
16
CHAPTER 4
SYSTEM IMPLEMNENTATION
LCD Display
(Temperature
sensor)
PIR SENSOR
Arduino
Board FAN
The above figure represents the block diagram representation of the proposed
concept. The temperature sensor DHT11 is interfaced with Arduino to fetch the data of
temperature in the room. The data is processed if the temperature is high fan speed is more
relatively if the temperature is low fan speed is low. Moreover, if the temperature is below
the threshold set then fan will be in off condition. The data related to temperature, fan speed
17
is displayed on the LCD for user interaction. The fan speed is controlled relatively with the
temperature using PWM pins available on the Arduino. As duty cycle of PWM signal
increases the fan speed increases and the same is true conversely.
Description:
I used an LCD shield to display the current temperature and speed of the fan, but
you can use the circuit without the LCD display. You also need to select the
transistor by the type offan that you use. In my case I used the well-known BD139
transistor and a 9V battery to provide power to the fan and transistor. The LM35
temperature sensor and red led are powered with 5V from the Arduino board.
18
As you can see in the sketch on the first line I included the Liquid Crystal library
(header) that includes useful functions to use when an LCD is connected to the
Arduino board. Then I setthe pins for the sensor, led and fan.
The most important part is to set the variables temp Min andtemp Max with
your desired values. Temp Min is the temperature at which the fan starts to spin
andtemp Max is the temperature when the red led lights warning you that the
maximum temp was reached. For example if you set tempMin at 30 and tempMax
at 35 thenthefanwillstartspinningat30°Candreachitsmaximum speed at 35°C.
We store the temperature value in the temp variable and then use some if()
functions to check if temp is lower than temp Min and if so let the fan OFF
(LOW). The next if() is to check if temperature is higher than the min Temp and
lower than the temp Max and if so then use the map() function to re-map the temp
value from one value to another. In our case fan Speed will havea value of 32 at
temp Min and 255 at tempMax. These values are used to control the speed of the
fan using PWM and the analog Write().
The fan LCD re-maps the temp to allow the display of fanSpeed ina 0 to 100%
range so you can say that the speed of the fan is directly dependent of the LM35’s
temperature. When the temperature reaches the value set in tempMax the fan will
be at its maximum spinning velocity and the LCD will display FANS:100%
even though the temperature might increase above tempMax.
19
The rest of the explanation can be read in the comments area of the Arduino
sketch. In the next project I will make a temperature protection circuitthat will turn
off the power of equipment when its temperature has reached a certain value.
4.3 APPLICATION:
1. Temperature based fan speed controller is useful for cooling the processor in
the laptops and personal computers “more efficiently”. Generally, fan in laptop
comes with only two or three possible speeds. So, it results in more power
consumption.
2. The fan designed in this project, has different values of speed according to
temperature change. This can be also used in small scale industries for cooling the
electrical/mechanical equipment. The whole circuit except motor and fan can be
manufactured on a single PCB, and it can be used for temperature-based control
operations.
ADVANTAGES:
DISADVANTAGES:
1. It can only be maintained by technical person. Thus, itbecomes difficult to
20
be maintained.
+10mv/° C
FEATURES:
Calibrated directly in degree Celsius (centigrade)
Linear +10.0 mV/ degree Celsius
21
0.5 degree Celsius accuracy (at +25degree Celsius)
Rated for full -55-to-+150-degree Celsius range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts
The LCD is a dot matrix liquid crystal display that displays alphanumeric
characters and symbols. 16X2 LCD digital display has been used in the system
to show the room temperature. Liquid Crystal Display screen is an electronic
display module and find a wide range of applications. A 16x2 LCD display is very
basic module and is very commonly used in various devices and circuits. These
modules are preferred over sevensegments and other multi segment LEDs. The
reasons being: LCDs are economical; easily programmable; have no limitation
of displaying special & evencustom characters (unlike in seven segments),
animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data.The command register stores the
command instructions given to the LCD. A command is an instruction given to
LCD to doa predefined task like initializing it, clearing its screen, setting the cursor
22
position, controlling display etc. The data register stores the data to be displayed on
the LCD. The data is the ASCII value of the character to be displayed on the LCD.
PIN DESCRIPTION:
24
Arduino programming language (based on Wiring), and the Arduino Software (IDE), based
on Processing.
Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers -
students, hobbyists, artists, programmers, and professionals - has gathered around
this open-source platform, their contributions have added up to an incredible
amount of accessible knowledge that can be of great help to novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and programming.
As soon as it reached a wider community, the Arduino board started changing to
adaptto new needs and challenges, differentiating its offer from simple 8-bit boards
to products for IoT applications, wearable,3D printing, and embedded environments.
All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs. The
software, too, is open-source, and it is growing through the contributions of users
worldwide its simple and accessible user experience, Arduino has been used in
thousands of different projects and applications. The Arduino software is easy-to-use
for beginners, yet flexible enough for advanced users. It runs on Mac, Windows, and
Linux. Teachers and students use it to build low- c o s t scientific instruments,
to prove chemistry and physics principles, or to get started with programming and
robotics. Designers and architects build interactive prototypes, musicians and artists
use it for installations and to experiment with new musical instruments. Makers, of
course, use it to build many of the projects exhibited at the Maker Faire, for
example. Arduino is a key tool to learn new things. Anyone - children, hobbyists,
artists, programmers - can start tinkering just following the step- b y - s t e p
25
instructions of a kit, or sharing ideas online with other members of the Arduino
community.
Arduino also simplifies the process of working with microcontrollers, but it offers some
advantage for teachers, students, and interested amateurs over other systems:
26
5.Open source and extensible hardware - The plans of the Arduino boards are
published under a Creative Commonslicense, so experienced circuit designers can
make theirown version of the module, extending it and improving it. Even relatively
inexperienced users can build the breadboard version of the module in order to
understand how it works and save money.
27
Fig.4.5 Arduino UNO
28
inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP
header, and a reset
button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter
or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-
to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter. Revision 2 of the Uno
board has a resistor pulling the 8U2 HWB line to ground, making it easier to put
into DFU mode. Revision of the board has the following new features:
• 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields
to adapt to the voltage provided from the board. In future, shields will be
compatible with both the board that uses the AVR, which operates with 5V and
with the Arduino Due that operates with 3.3V. The second one is a not
connected pin that is reserved for future purposes.
4.4.4 SPECIFICATIONS
Microcontroller : ATmega328
Operating Voltage
(recommended)
(limits)
Voltage
Input
6-20V
: 5V : : 7-12V
29
: Bootloader
SRAM :2 KB
EEPROM :1 KB
1.LED: There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
2.VIN: The input voltage to the Arduino/Genuino board when it's
using an external power source (as opposed to 5 volts from the USB
connection or other regulated power source). You can supply voltage
through this pin, or, if supplying voltage via the power jack, access it
through this pin.
3.5V: This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power jack (7 -
20V), the USB connector (5V), or the VIN pin of the board (7-20V).
Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and
can damage the board.
4.3V3: A 3.3-volt supply generated by the on-board regulator. Maximum
current draw is 50 mA.
5.GND: Ground pins.
6.IOREF: This pin on the Arduino/Genuino board provides the voltage
reference with which the microcontroller operates. A properly
configured shield can read the IOREF pin voltage and select the
appropriate power source or enable voltage translators on the outputs to
work with the 5V or 3.3V.
7.Reset: Typically used to add a reset button to shieldswhich block
the one on the board.
30
4.4.6 SPECIAL PIN FUNCTIONS
Each of the 14 digital pins and 6 Analog pins on the Uno can be
used as an input or output, using pinMode(),digitalWrite(), and
digitalRead() functions. They operate at 5 volts. Each pin can provide
or receive 20 mA as recommended operating condition and has an
internal pull-up resistor (disconnected by default) of 20-50k ohm. A
maximum of 40mA is the value that must not be exceeded on any I/O
pin to avoid permanent damage to the microcontroller.The Uno has 6
analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure
from ground to 5 volts, though is it possible to change the upper end
of their range using the AREF pin and the analogReference() function.
1.Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX)
TTL serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip.
2.External Interrupts: pins 2 and 3. These pins can be configured to
trigger an interrupt on a low value, a rising or falling edge, or a change in
value.
3.PWM(Pulse Width Modulation) 3, 5, 6, 9, 10, and 11 Can provide 8-bit
PWM output with the analogWrite() function.
4.SPI(Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12
(MISO), 13 (SCK). These pins support SPI communication using
the SPI library.
31
5.TWI(Two Wire Interface): A4 or SDA pin and A5 or SCL pin. Support
TWI communication using the Wire library.
AREF(Analog REFerence: Reference voltage for the analog
inputs.
4.4.7 COMMUNICATION:
32
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via
a 100 nanofarad capacitor. When this line is asserted (taken low), the
reset line drops long enough to reset the chip.
This setup has other implications. When the Uno is connected to either
a computer running Mac OS X or Linux, it resets each time a
connection is made to it from software (via USB). For the following
half-second or so, the bootloader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload
of new code), it will intercept the first few bytes of data sent to the
board after a connection is opened.
PIR sensors are commonly called simply "PIR", or sometimes "PID", for
"passive infrared detector". The term passive refers to the fact that PIR devices
do not radiate energy for detection purposes. They work entirely by
detecting infrared radiation (radiant heat) emitted by or reflected from objects.
33
wavelengths, but it can be detected by electronic devices designed for such a
purpose.
4.5.1 OPERATION
PIRs come in many configurations for a wide variety of applications. The most
common models have numerous Fresnel lenses or mirror segments, an effective
range of about 10 meters (30 feet), and a field of view less than 180. Models
with wider fields of view, including 360°, are available, typically designed to
mount on a ceiling. Some larger PIRs are made with single segment mirrors and
can sense changes in infrared energy over 30 meters (100 feet) from the PIR.
There are also PIRs designed with reversible orientation mirrors which allow
either broad coverage (110° wide) or very narrow "curtain" coverage, or with
individually selectable segments to "shape" the coverage.
34
The housing will usually have a plastic "window" through which the
infrared energy can enter. Despite often being only translucent to visible light,
infrared energy is able to reach the sensor through the window because the
plastic used is transparent to infrared radiation. The plastic window reduces the
chance of foreign objects (dust, insects, etc.) from obscuring the sensor's field of
view, damaging the mechanism, and/or causing false alarms. The window may
be used as a filter, to limit the wavelengths to 8-14 micrometres, which is
closest to the infrared radiation emitted by humans. It may also serve as a
focusing mechanism;
When used as part of a lighting system, the electronics in the PIR typically
control an integral relay capable of switching mains voltage. This means the
PIR can be set up to turn on lights that are connected to the PIR when
movement is detected. This is most commonly used in outdoor scenarios either
to deter criminals (security lighting) or for practical uses like the front door light
turning on so you can find your keys in the dark.
35
4.5.4 PLACEMENT
They suggest mounting the PIRs in such a way that the PIR cannot "see" out of
a window. Although the wavelength of infrared radiation to which the chips are
sensitive does not penetrate glass very well, a strong infrared source (such as
from a vehicle headlight or sunlight) can overload the sensor and cause a false
alarm. A person moving on the other side of the glass would not be "seen" by
the PID. That may be good for a window facing a public sidewalk, or bad for a
window in an interior partition.
It is also recommended that the PIR not be placed in such a position that
an HVAC vent would blow hot or cold air onto the surface of the plastic which
covers the housing's window. Although air has very low emissivity (emits very
small amounts of infrared energy), the air blowing on the plastic window cover
could change the plastic's temperature enough to trigger a false alarm.
Sensors are also often designed to "ignore" domestic pets, such as dogs or cats,
by setting a higher sensitivity threshold, or by ensuring that the floor of the
room remains out of focus.
Since PIR sensors have ranges of up to 10 meters (30 feet), a single detector
placed near the entrance is typically all that is necessary for rooms with only a
single entrance. PIR-based security systems are also viable in outdoor security
and motion-sensitive lighting; one advantage is their low power draw, which
allows them to be solar-powered
4.5.6 DC MOTOR
37
electronics has made replacement of DC motors with AC motors possible in
many applications.
38
Some power supplies have other types of inputs and outputs as well, for
functions such as external monitoring and control.
CHAPTER 5
SOFTWARE IMPLEMENTATION
5.1 ALGORITHM:
39
If temperature sensor value is greater than 29°C motor will be in the ON state
and will be rotating at 100% of its maximum speed.
Monitor the temperature continuously and take the necessary action
depending upon the value of sensor.
CODE
#include <LiquidCrystal.h>
LiquidCrystallcd(7,6,5,4,3,2);
int temp;
intf
anS
pe
ed; i
ntfa
nL
CD;
void setup() {
pinMode(fan,
40
OUTPUT);
pinMode(led,
OUTPUT);
pinMode(tempPin,
INPUT);
lcd.begin(16,2);
void loop() {
41
} else { // else turn
of leddigitalWrite(led, LOW);
lcd.print("TEMP: ");
del
ay(
200)
; lc
d.cl
ear()
;
temp =
analogRead(tempPin);
return temp *
0.48828125;
42
5.2 SOFTWARE
1.ARDUINO IDE
2.LIBRARIES
3.EMBEDDED C
· Arduino boards are able to read analog or digital input signals from
different sensors and turn it into an output such as activating a motor, turning
LED on/off, connect to the cloud and many other actions.
43
· Unlike most previous programmable circuit boards, Arduino does not
need an extra piece of hardware (called a programmer) in order to load a new
code onto the board. You can simply use a USB cable.
5.2.2 LIBRARIES
· Wi-Fi - for connecting to the internet using the Arduino Wi-Fi shield.
5.2.3 EMBEDDED C
45
Embedded C is a set of language extensions for the C programming
language by the C Standards Committee to address commonality issues that
exist between C extensions for different embedded systems. Historically,
embedded C programming requires nonstandard extensions to the C language in
order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations.
EMBEDDED PROGRAMMING
46
CHAPTER 6
47
Fig. 6.2 Temperature Vs Speed of Fan
HARDWARE SETUP
48
CHAPTER 7
CONCLUSION
49
REFERENCES
50
Applications." Int. J. Appl. Res. Sci. Eng. ISSN (Online Biomed. Med.
Sci. (2017): 57-61.
• Khan, Asim Ali, and Nushkam Rapal. "Fuzzy PID controller: design,
tuning and comparison with conventional PID controller." 2006 IEEE
International Conference on Engineering of Intelligent Systems. IEEE,
2006.
• Hashim, Aamir. "Optimal speed control for direct current motors using
linear quadratic regulator." Journal of Engineering and Computer Science
(JECS) 14.2 (2019): 48-56.
• Hasan, Md Asif, Raj Kumar Mishra, and Srishti Singh. "Speed Control of
DC Motor Using Adaptive Neuro Fuzzy Inference System Based PID
Controller." 2019 2nd International Conference on Power Energy,
Environment and Intelligent Control (PEEIC). IEEE, 2019.
51
• Agnihotri, Akshay, Rahul Sharma, and Harjit Pal Singh. "Performance
Analysis of DC motor using PID controller tuned by Metaheuristic
Techniques."
• Hasan, Fadhil A., and Lina J. Rashad. "Fractional-order PID controller for
permanent magnet DC motor based on PSO algorithm." International
Journal of Power Electronics and Drive Systems 10.4 (2019): 1724.
• Alkhafaji, Falih SM, et al. "A response time reduction for DC motor
controller using SISO technique." Indonesian Journal of Electrical
Engineering and Computer Science 17.2 (2020): 895-906.
52