Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1.1 INTRODUCTION
Because of the global warming the climate of the world is changing day by day.Due to
which it is too hot in summer and too cold in winter.People use various apparatus like
table fan,ceiling fan,water circulated cooling system etc when temperature is
hot.Similarly people use apparatus like heater when it is too cold.These apparatus are
manual in nature.A person should constantly monitor the system and manually turn on or
turnoff the device.These cooling and heating devices comes as different systems.Also
there may be considerable wastage of power in manual operation of these devices.
Therefore , an automatic air conditioning system is required to perform the function of
both the cooling devices and heating devices.
Air conditioning system is the system which monitors the room temperature and controls
the circulation of the fresh air inside the room.If the temperature of the room goes high
sufficient enough to make one feel hot then the air conditioning system should be able to
circulate cool air inside the room.Similarly if the temperature of the room falls sufficient
enough to make one feel cold then the air conditioning system should circulate warm air
inside the room.If the room temperature is neither hot nor cold then the system should
stay in low power mode to prevent from the considerable loss of the power.
1
• PCB layout.
• Device test.
• Verification of the software on the target system.
1.3 OBJECTIVES
The main objective of this project is to devise a Temperature Controlled Automatic
Air conditioning System.
1.3.1 GENERAL OBJECTIVES
Following are the general objectives of this project:
i. To measure the temperature of the room.
ii. To display the temperature in LCD.
iii. To maintain or condition the temperature of the room.
iv. To monitor temperature of the room e.t.c
2
CHAPTER 2
We can construct automatic air conditioning system in a variety of way.We may use
microprocessor/microcontroller based system or other custom designed circuits for the
task.Infact,a wide variety of system with different architecture and price exist in the
market.As an end user what matters most is the performance of the system.But as the
designer we have to consider the key aspects of design philosophy.The key aspect is that
a designer should be able to design a system in an economical and efficient way.Also we
must include a time factor involved in the design. Infact , the designers are always
constrained with time,efficiency and economy as the key aspects of the design.Such is the
case with this project.
2.2 HISTORY
There has been a lot of work in this field i.e.in the design of automatic air conditioning
system.A lots of commercial products are readily available in the market. The
discovery of the the air conditioning system came in practice after engineer Willis
Haviland Carrier discovered one in 1902 A.D. Since then there has been numerous
types of air conditioning system developed by different peoples.Since works done by
those peoples is too numerous to mention, we just want to remark their work at this
point.
3
2.3 HARDWARES USED
2.3.1 Microcontroller AT89S52
2.3.1.1 DESCRIPTION
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the indus-
try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-
grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications. The
AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-
vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and
clock circuitry. In addition, the AT89S52 is designed with static logic for operation down
to zero frequency and supports two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt
system to continue functioning. The Power-down mode saves the RAM con-tents but
freezes the oscillator, disabling all other chip functions until the next interrupt or
hardware reset.
2.3.1.2 FEATURES
• compatible with MCS-51TM products.
• 8Kbytes of in-system reprogrammable flash memory.
• Endurance:1,000 write /erase cycles.
• Fully static operation:0 Hz to 24 MHz.
• Three level program memory lock.
• 128*8 bit internal RAM.
• 32 programmable I/O lines.
• Two 16-bit Timer/counters
4
• Six interrupt sources.
•Low power idle and power down modes.
5
2.3.1.4 PIN CONFIGURATION
GND
Ground
Port 0
6
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-
impedance inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data memory. In this mode, P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming and
outputs the code bytes dur-ing program verification. External pull-ups are required
during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in
the follow-ing table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high
7
by the inter-nal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups. Port
2 emits the high-order address byte during fetches from external program memory and
dur-ing accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In
this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents
of the P2 Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash program-ming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high
by the inter-nal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL) because of the pull-ups. Port 3
receives some control signals for Flash programming and verification. Port 3 also serves
the functions of various special features of the AT89S52, as shown in the fol-lowing
table.
8
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods after the Watchdog times
out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In
the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG)
during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6
the oscillator frequency and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped dur-ing each access to external data memory. If
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in
external execution mode.
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When the
AT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
exter-nal data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives the
12-volt programming enable voltage (VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
9
XTAL2
Output from the inverting oscillator amplifier.
10
2.3.2 Liquid Crystal Display
In recent years the LCD is finding widespread use replacing LEDs(seven-segment LEDs
or other multisegment LEDs).This is due to the following reasons:
In our project we have used LM016l(JHD 162A) LCD.The external connection and
pin description of the LCD is as follows:
11
PIN Symbol Name
1 VSS Ground
2 VCC Positive Supply
3 VEE Contrast
4 RS Register Select
5 R/W Read/write
6 EN Enable
7 D0 Data bit 0
8 D1 Data bit 1
9 D2 Data bit 2
10 D3 Data bit 3
11 D4 Data bit 4
12 D5 Data bit 5
13 D6 Data bit 6
14 D7 Data bit 7
15 Led+ Led + supply
16 Led- Led - supply
In this LCD,pin 1 is for ground,pin 2 is for positive supply,pin 3 is for variable voltage
source which controls contrast of the display.Pin 4,5 and 6 are the control pins of
LCD.Pin D0 through D7 are for data. Pin 15 and 16 are not shown in the diagram but in
most of the LCD to give illumination to text in display,these pins are present as terminals
to display LED.
12
2.3.3 ADC 0804
DESCRIPTION
The ADC 0804 is a CMOS 8-bit successive approximation A/D converter using a
resistive ladder and capacitive array together with an auto-zero comparator.These
converters are designed to operate with microprocessor –controlled buses using a
minimum of external circuitry.The 3-state output data lines can be connected directly to
the data bus.The differential analog voltage input allows for increased common mode
rejection and provides a means to adjust the zero-scale offset.Additionally,the voltage
reference input provides a means of encoding small analog voltages to the full 8 bits of
resolution.
FEATURES
• Compatible with most microprocessors
• Differential inputs
• 3-State outputs
• Logic levels TTL and MOS compatible
• Can be used with internal or external clock
• Analog input range 0 V to VCC
• Single 5 V supply
• Guaranteed specification with 1 MHz clock
13
PIN DIAGRAM
APPLICATIONS
• Transducer-to-microprocessor interface
• Digital thermometer
• Digitally-controlled thermostat
• Microprocessor-based monitoring and control systems
2.3.4 LM 35
General Description
The LM35 series are precision integrated-circuit temperature sensors,with an output
voltage linearly proportional to the centigrade temperature.Thus the LM35 has an
advantage over linear temperature sensor caliberated in ° Kelvin,as the user is not
required to subtract a large constant voltage from the output to obtain the convenient
centigrade scaling.The LM35 does not require any external calibration or trimming to
14
3
provide typical accuracies of ± ℃ over a full -55℃ to 155℃ temperature range.Low
4
cost is assured by trimming and calibration at the wafer level.The low output impedance
,linear output,and precise inherent calibration of the LM35 make interfacing to read out
or control circuitry especially easy.This device is used with the single power supplies ,or
with the plus and minus supplies.As the LM 35 draws only 60 µA from the supply,it has a
very low self-heating of less than 0.1 ℃ in the still air.The LM 35 is rated to operate
over a -55℃ to +150℃ .While the LM 35C is rated for a -40℃ to +110℃ range(-10 with
the improved accuracy).The LM 35 series is available packaged in the hermetic TO
transistor packages,while the LM35 C,LM35 A and LM 35D are also available in the
plastic TO-92 transistor package.The LM 35D is also available in an 8-lead surface-
mount small-outline package and a plastic TO-220 package.
LM35 Features
15
PIN CONFIGURATION
PIN DESCRIPTION
Pin 1 is for positive supply,pin 2 is the ouput voltage which is proportional to the room
temperature.
16
FEATURES
• Isolation test voltage 5000 VRMS.
• Interfaces with common logic families.
• Input-output coupling capacitance < 0.5 pF.
• Industry standard dual-in-line 6 pin package.
PIN CONFIGURATION
APPLICATIONS
• AC mains detection
• Reed relay driving
• Switch mode power supply feedback
• Telephone ring detection
• Logic ground isolation
• Logic coupling with high frequency noise rejection
17
Figure 2.8: Darlington Pair Transistor
PIN CONFIGURATION
18
PIN DESCRIPTION
PIN 1 is for the supply voltage,pin 2 is the circuit ground, and pin 3 is for 5V output.
2.3.8 DC FAN
In this project we have used a 12V DC fan which was extracted from SMPS of desktop
computer.
19
CHAPTER 3
3.1 METHODOLOGY
This project entitled “TEMPERATURE CONTROLLED AUTOMATIC AIR
CONDITIONING SYSTEM” is essentially a project based on the applications of
embedded system.In this project we have used various hardware elements like
microcontroller,sensor,LCD,etc and various other circuit elements.In the design of the
system using above hardware elements we have been supplemented by various software
packages for coding,debugging, and simulating the design.The various processes
involved in the design is explained below:
3.1.1 Selection of Processor
There are numbers of processors available in the market.These processors are of different
capacity and are used for different purposes.If the application involves large data
processing task the general purpose microprocessor is preferred.While if the application
is control oriented and require very few data processing then microcontroller is used.Also
both microprocessor and microcontroller of different capacity(i.e.speed,storage,data
width etc) are readily available.We have to select the processor as per our
requirement.For example:If we can accomplish our task using 8- bit microcontroller then
we won’t need a 32-bit microcontroller.Using a 32-bit microcontroller for 8-bit
applications is just a wastage of money and storage capacity.
Since our project is based on embedded system design philosophy,we have used
ATMEL AT89S52,which is an 8-bit microcontroller.
3.1.2 Coding
One of the important task in the embedded system design is using the appropriate
programming language to program the microcontroller.We had many choices to do
so.We might have used assembly language and high level programming languages like
C,C++,Java,C# etc.Programming in assembly is tedious and time consuming.But the
code generated by assembler is fast to execute.On the other hand programming in high
level language is easy but code generated by high level language is slower to execute.In
20
our project we have chosen C programming language for our target system.Here,we
traded speed for ease.
Coding is one part.But to store the program on ROM or to execute the program on
microcontroller we require machine code.Therefore it is necessary to convert program
written in C to machine code(or HEX code).In our project we have used Keil Microvision
software to accomplish this task.
3.1.4 Simulation
Design of embedded system is a very complicated job.A successful operation of the
designed system at a very first time is often rare.Also if the designed system malfunction
then there might be loss of money.Thus before actually designing the system in the real
time have used various simulation tools to check the validity of our design.For this we
have used various simulation softwares(or simulators).Various simulators available in
market are Proteus,Multisim,Electronics Workbench,MPLAB,Matlab,ORCAD,
etc.Regarding our project we have mostly used Proteus software.
21
3.1.5 PCB Layout Design
After successfully simulating the designed system we have to bring it in the real time so
as to perform the required function.Designing pcb layout manually is time consuming.So
we have used software to convert the required schematic layout to PCB layout.In our
project we have used Livewire PCB Wizard.After successfully etching the required
layout we placed the components in their respective position and soldered their
pins.Finally our project was be ready.
22
3.2 Hardware Algorithm(Flowchart)
Start
Read temperature
from ADC
No Yes
Is
Tempr.>25
Normal condition
HTR off
23
3.3 BLOCK DIAGRAM OF DESIGNED SYSTEM
Heater
Temperature Analog To Digital 1
Microcontroller
Sensor Converter(ADC)
Heater
2
OPTOCOUPLER
DC FAN
24
3.3.1 Working Description
Above figure shows the block diagram of the system that we have designed.Basically, it
consists of microcontroller as a central processor of the entire control operation. The
temperature sensor gives the analog output voltage based on the temperature of the
room.This analog voltage is fed to the A/D converter.The A/D converter then converts
the analog input voltage from the temperature sensor into equivalent binary bits.The
converted binary data from the A/D converter is applied to microcontroller.The
microcontroller reads binary data from A/D converter,convert it to suitable form and
performs different operations based on the value of temperature read from A/D converter.
The LCD is used to display the data given by microcontroller.Microcontroller can turn on
dc fan through the optocoupler if required.We have used led as prototype model for
heater.If appropriate condition is met microcontroller can turn on heater(i.e. LED).
In this system,if the temperature read is in between 20-25 degree celcius,it is considered
normal state.In this condition both fan and heater are off but the temperature and status is
displayed in LCD.If the temperature of the room is greater that 25 degree celcius it is
considered to be a situation to turn on fan and turn off heater. If the temperature of the
room is in between 25-30 degree celcius it is considered as a situation to turn on fan with
speed of level one.In this level,appropriate temperature and status is displayed on the
LCD. If the temperature of the room is in between 30-35 degree celcius it is considered
as a situation to turn on fan with speed of level two.In this level,appropriate temperature
and status is displayed on the LCD. If the temperature of the room is greater than 35
degree celcius it is considered as a situation to turn on fan with speed of level three.In this
level,appropriate temperature and status is displayed on the LCD. If the temperature of
the room is less that 20 degree celcius it is considered to be a situation to turn on Heater
and turn off fan. If the temperature of the room is in between 10-20 it is considered as a
situation to turn one heater on with heat of level one.In this level,appropriate temperature
and status is displayed on the LCD. If the temperature of the room is in between 0-10 it is
considered as a situation to turn two heater on with heat of level two.In this
level,appropriate temperature and status is displayed on the LCD.
25
3.4 CIRCUIT DIAGRAM
26
3.5 PCB LAYOUT
27
CHAPTER 4
4.1 Applications:
There are many applications of the automatic air conditioning system.Followings are the
different sectors where the automatic air conditioning systems are used:
i. Home
ii. Banks
iii. Departmental stores
iv. Hotels
v. Offices
vi. Laboratory etc
The second problem was due to the noise glitches from the power supply of LM 7805.
The third problem was because of the lack of proper electrical isolation between motor
control circuit and microcontroller circuit.
28
Above problems were solved as follows:
i. Careful redesign and fabrication of PCB solved this problem.
ii. Incorporation of decoupling capacitor between output pin and ground pin of
voltage regulator IC solved this problem.
iii. Using optocoupler to electrically isolate two parts of the circuit solved the
problem.
4.3 Limitations
All projects have their own limitations.We have tried our best to achieve the goal but our
project also has some limitations which are as follows:
i. It cannot read negative temperature.
ii. It cannot be use for large hall.
29
4.5 Conclusion
Here by we come to the end of our minor project “TEMPERATURE CONTROLLED
AUTOMATIC AIR CONDITIONING SYSTEM”.This paper has presented a means
of controlling temperature of a room(or any other system).This system helps to maintain
the temperature within a limit.This system is very marketable because of its
simplicity,low cost,low power consumption and small size.It can also be used in various
industrial applications such as to control the temperature in boilers,refrigerator,AC
computers and Laboratories.
30
BIBLIOGRAPHY
-Mazidi, M.A&Mazidi, J.G&McKinlay, R.D.The 8051 Microcontroller and Embedded
Systems.India: Prentice Hall, 2011
-Gaonkar, R.S. Microprocessor Architecture, Programming and Applications with the
8085.India: Penram Publishing House, 2009
- http://www.atmel.com/images/doc1919.pdf
- http://measure.feld.cvut.cz/groups/edu/osv/4N35.pdf
- http://www.fairchildsemi.com/ds/LM/LM7805.pdf
- http://www.robot-italy.net/downloads/lm35.pdf
31