automatic_room_temperature_controller
automatic_room_temperature_controller
automatic_room_temperature_controller
By
Shaik. Sameena
322103210198
CSE Department
2024–2025
1
GAYATRI VIDYA PARISHAD COLLEGE OF ENGINEERING FOR WOMEN
CERTIFICATE
This is to certify that the internship project report titled Automatic room temperature controller is a
bonafide work of II B.Tech. student in the Department of Computer Science and Engineering, Gayatri
Vidya Parishad College of Engineering for Women affiliated Andhra University, Vishakhapatnam.
The Project was done during the academic year 2023-2024 (IInd Year Semester-2) and it is evaluating
in III-1 Semester of the academic year 2024 -2025
Shaik.Sameena
322103210198
2
CERTIFICATE
ACKNOWLEDGEMENT
3
The satisfaction that accompanies the successful completion of any task would be incomplete
without the mention of people who made it possible and whose constant guidance and encouragement
crown all the efforts with success.
We would like to extend our heartfelt gratitude and a sincere thanks to Prof. PS Avadhani,
Professor, Department of CSE, GVPCEW, former Director IIIT Agartala, former Principal AU College
of Engineering(A), Andhra University Visakhapatnam, Senior Professor Department of CSSE College
of Engineering(A), Andhra University , for his valuable guidance and providing necessary help
whenever needed.
We feel elated to extend our sincere gratitude to our Mentor Ms.K.V.S. Mounica, Assistant
Professor for encouragement all the way during analysis of the project. His annotations, insinuations and
criticisms are the key behind the successful completion of the thesis and for providing us all the required
facilities.
We express our deep sense of gratitude and thanks to Dr. P. V. S. Lakshmi Jagadamba,
Professor and Head of the Department of Computer Science and Engineering for her guidance and for
expressing her valuable and grateful opinions in the project for its development and for providing lab
sessions and extra hours to complete the project.
We would like to take this opportunity to express our profound sense of gratitude to Vice Principal,
Dr. G. Sudheer for allowing us to utilize the college resources thereby facilitating the successful
Completion of our project. We are also thankful to both teaching and non-teaching faculty of the
Department of Computer Science and Engineering for giving valuable suggestions for our project.
We would like to take the opportunity to express our profound sense of gratitude to the revered
Principal, Dr. R. K. Goswami for all the help and support towards the successful completion of our
project.
4
Table of Contents
1. Abstract 6
2. Introduction 7-9
2.1 Weather Changes and Adaptation 10-12
2.2 Purpose of the Project 13
3. Methodology 14
3.1Overview of Steps 14-15
3.2 Circuit Design and Components 15-16
4. Code Implementation 17
4.1 Code Explanation and Sample Code 18-21
5. Working of the System 22
5.1Initial Setup and Error Handling 22-25
5.2 Controlling Temperature Devices 26-28
6. Applications 29
6.1Industrial, Residential, and Medical Applications
7. Conclusion 30
8. References 31
5
ABSTRACT
Automatic temperature control system is an important application used in almost all modern
gadgets and smart homes. The system for controlling temperature automatically is achieved
by using Arduino Uno- based microcontroller system.Arduino Uno due to its increased
popularity finds its varied range of applications.Temperature sensor LM35 and Arduino
Uno are the hardware used interfaced with computer, and the temperature is controlled in
the room.Temperature is displayed on LCD display employing A1 pin of hardware with the
help of Analog pin utilizing pulse width modulation (PWM).We have designed temperature
control as an automatic system that has been not attempted before the way it has been
implemented. This system can be used in any firm or organization where it is very
important to maintain precise temperatures.LCD display is used to display the temperature
and when the temperature exceeds the set limit, the lamp is switched off in order to control
the temperature.The main purpose of this Digital Temperature Controller is to control the
temperature of any device like AC or any other electronic devices whose temperature keeps
fluctuating and thus requires a constant watch on the device.The use of this system
eliminates constant watching on the device by self-controlling the temperature of the
system.
6
1. INTRODUCTION
Weather changes become hard to adapt. That is, during Winter we face difficulties tolerating
the freezing cold, and that is why people often prefer wearing coats during the season. On the
other hand, the weather becomes too warm in summer. Thus, having understood the switching
operation of transistors, unidirectional current flow in diodes, the principle of operation of
motors, the resistance from resistors combined with the transformation capability of the
transducer, the temperature sensor in this case, I would like to summarize the operation of my
project as follows:
If the temperature exceeds the maximum of the aforementioned "desired" range, then
the LCD displays that the temperature is higher and informs the FAN to turn on. Then
the FAN starts its rotation/vibration, and after a while the temperature gets lowered
falling in the range, then the LCD commands the FAN to turn off.
Whenever the sensor's temperature reading goes down below the possible minimum
temperature in the range, the LCD notifies that the temperature is LOWER and tells
the heater to be turned on, and after the temperature is in the range, it displays that
temperature is OK and orders the heater to be switched off.
The last condition is whenever the temperature is within the desired range, the LCD
tells that the temperature is normal. Thus, it asks to turn off everything. This condition
can, for instance, be observed if you run the code and the slider's position remains
unchanged. That tells one that the default slider position is within the desired room
temperature range (i.e, the default is 24.78 degree C).
Microcontroller: Arduino UNO
It has a chip named as ATMEGA28P.
Arduino UNO consists of 28 pins such as:
Digital pins-
>14(0 to 13)
Analog pins->6(A0 to A5)
Power pins->4(2-GND,2-VCC)
Other pins->AREF, RESET
Crystal oscillator->2pins
(crystal oscillator generates the timing and control signals)
7
ATMEGA328P:
It is single chip microcontroller created by ATMEL in the mega AVR
family.It has a modified Harvard architecture
8bit RSC processor core.
LCD 16*2:
An LCD (Liquid Crystal Display) screen is an electronic display module and has a wide
range of applications.
A 16x2 LCD display is very basic module and is very commonly used in various devices
and circuits.
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.
The 16 x 2 intelligent alphanumeric dot matrix display is capable of displaying 224
8
different characters and symbols.
This LCD has two registers, namely, Command and Data. Command register
stores various commands given to the display. Data register stores data to be
displayed.
The process of controlling the display involves putting the data that form the image of
what you want to display into the data registers,then putting instructions in the instruction
register.
In your Arduino project Liquid Crystal Library simplifies this for you so you don't need
to know the low-level instructions.
Contrast of the display can be adjusted by adjusting the potentiometer to be connected
across VEE pin.
Potentiometer:
potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an
adjustable voltage divider.If only two terminals are used, one end and the wiper, it acts
as a variable resistor or rheostat.
It works by sliding a conductor in a graphite disk that has a stable resistance depending
on the posițion the conductor has on the disk.
Temp sensor:
The TMP36 temperature sensor is an easy way to measure temperature using an Arduino!
The sensor can measure a fairly wide range of temperature (-50°C to 125°C), is fairly precise
(0.1°C resolution), and is very low cost, making it a popular choice.
In this tutorial we will go over the basics of hooking the TMP36 up and writing
some basic code to read the Analog input it is connected to.
9
Unlike a thermistor, the TMP36 does not have a temperature sensitive resistor. Instead this
sensor uses the property of diodes; as a diode changes temperature the voltage changes with it
at a known rate.
The sensor measures the small change and outputs an Analog voltage between
0 and 1.75VDC based on it.
To get the temperature we just need to measure the output voltage and a little bit
of math!
Offset voltage-0.5V
Scale factor-10mV/C
DC motor:
A DC motor is any of a class of rotary electrical motors that converts direct current (DC)
electrical energy into mechanical energy.
The most common types rely on the forces produced by induced magnetic fields due
to flowing current in the coil.
Nearly all types of DC motors have some internal mechanism, either
electromechanical or electronic, to periodically change the direction of current in part of
the motor.
LED:
A light-emitting diode (LED) is a semiconductor device that emits light when current flows
through it.
Electrons in the semiconductor recombine with electron holes, releasing energy in
the form of photons.
The colour of the light (corresponding to the energy of the photons) is determined
by the energy required for electrons to cross the band gap of the semiconductor.
White light is obtained by using multiple semiconductors or a layer of light-
emitting phosphor on the semiconductor device.
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,
10
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.
Fixed resistors have resistances that only change slightly with temperature, time
or operating voltage.
Variable resistors can be used to adjust circuit elements (such as a volume control
or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical
activity.
NPN transistor:
The NPN transistor is made of semiconductor materials like silicon or germanium.
When a p-type semiconductor material is fused between two n-type semiconductor
materials, an NPN transistor is formed.
The NPN transistor features three terminals: emitter, base and collector.
The NPN transistor consists of two n-type semiconductors that sandwich a p-type
semiconductor. Here, electrons are the majority charge carriers, while holes are the minority
charge carriers.
Diode:
A diode is a two-terminal electronic component that conducts current primarily in one
direction (asymmetric conductance).
It has low (ideally zero) resistance in one direction, and high (ideally infinite)
resistance in the other.
A semiconductor diode, the most commonly used type today, is a crystalline piece of
semiconductor material with a p–n junction connected to two electrical terminals.[4] It has an
exponential current–voltage characteristic.
11
The most common function of a diode is to allow an electric current to pass in one
direction (called the diode's forward direction), while blocking it in the opposite direction (the
reverse direction).
Purpose:
The Automatic Room Temperature Controller aims to maintain a comfortable indoor
temperature by automatically adjusting heating or cooling devices. The system uses temperature
sensors to monitor the environment.
This system can be used in any firm or organization where it is very important to
maintain precise temperatures. LCD display is used to display the temperature and when
the temperature exceeds the set limit, the lamp is switched off in order to control the
temperature.
12
2. METHODOLOGY:
First you should open TINKER CAD free platform and login, in that got
circuits category and open a new project.
Then, select Arduino UNO MC. In the same way select 1 breadboard, 1 LCD
screen and place them on screen.
Now, to control brightness of LCD screen select 1 potentiometer and place it on
bread board correctly.
To sense the temperature select temperature sensor TMP36 and place it on
bread board correctly.
Next, find the temperature with sensor, if it is less than normal temperature then
switch on the heater by selecting LED in the place of heater. Also if temperature
is more on the fan by selecting DC motor and place them correctly.
We should not connect DC motor directly to MC so, we have to use
transistor. For this, select NPN transistor and place it on bead board.
Then, connect +5v power supply of MC to +ve track of bread board.
Connect GND pin to -ve track
Now, connect VSS GND of of LCD to -ve track of bread board.
Connect +5v VCC of LCD to +ve track .
Connect VEE (contrast control) pin to potentiometer vout.
Connect RS pin of LCD to 12 pin in Arduino MC (optional).
Connect RW pin of LCD to -ve track of bread board.
Connect E pin of LCD to 11 in MC.
DB0, DB1, DB2, DB3, pin 8 cannot be used. So, connections should be made as
follows:
DB4 pin to MC-5,
DB5 pin to MC-4,
DB6 pin to MC-3,
DB7 pin to MC-2.
Connect LCD cathode using resistor to +ve track of bread board.
Connect LCD anode pin to -ve track of bread board.
Then, connect power pin of temp sensor to +ve track, GND to -ve track, Vout
13
to A0 pin of MC.
Then, connect anode of LED to -ve track, cathode using resistor to 13 pin of
MC. //heater .
Now, connect emitter of NPN to -ve track, base to resistor, that end to 6 of MC.
Connect collector pin to one end of DC motor, to oppose reverse current
connect the diode.
Then, connect that end to another end of DC motor , connect this to +ve track.
Now circuit connection is done, then complete the coding part and execute it.
14
3.Working:
Components:-
15
Circuit:-
16
4. CODE:-
17
18
19
20
21
Schema:-
22
Output:-
Temperature desire condition:
23
Temperature higher condition:
24
Temperature lower condition:
25
Working:
TASK-2:- Try to remove the out wire of the temperature sensor which is
going to A0 (input pin) then you will observe some garbage value in the
display.
Write your program in such a way that whenever such value is received
the display will print “Temp sensor not working”.
Components:-
26
Circuit:
Schema:
27
Output:-
28
5. Applications:
1.Manufacturing and production processes
2.Building and home automation
3.Transportation systems
4.Power generation and distribution
5.Medical equipment
29
6. Conclusion:-
This project will solve the day-to-day problem.Where ACs don't start up due to low voltage,
This will start the AC,Fan,heater etc., depending upon the temperature level In a room by
sharing the load.Also this project can be extended for controlling the temperature in more
rooms in an apartment in future.Automatic room temperature device works
automatically.
It can show the temperature based on temperature it can automatically turn on fan or
turn off the fan or turn on the heater or off or off all devices.It can sense the temperature
easily.
30
7. REFERENCE
Books referral
Online referral
31