0% found this document useful (0 votes)
2 views9 pages

Temperature Controlling System Using Embedded Equi

The document describes a temperature controlling system utilizing a PIC 18F45K22 microcontroller and an LM35 temperature sensor to monitor and regulate temperature by controlling a cooling fan's speed through PWM. The system is designed for industrial applications, allowing for automated temperature management without operator intervention. The paper outlines the components, functionality, and advantages of the system, emphasizing its simplicity and reliability in temperature control.

Uploaded by

vedgodhani4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Temperature Controlling System Using Embedded Equi

The document describes a temperature controlling system utilizing a PIC 18F45K22 microcontroller and an LM35 temperature sensor to monitor and regulate temperature by controlling a cooling fan's speed through PWM. The system is designed for industrial applications, allowing for automated temperature management without operator intervention. The paper outlines the components, functionality, and advantages of the system, emphasizing its simplicity and reliability in temperature control.

Uploaded by

vedgodhani4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Home Search Collections Journals About Contact us My IOPscience

Temperature controlling system using embedded equipment

This content has been downloaded from IOPscience. Please scroll down to see the full text.

2017 IOP Conf. Ser.: Mater. Sci. Eng. 163 012046

([Link]

View the table of contents for this issue, or go to the journal homepage for more

Download details:

IP Address: [Link]
This content was downloaded on 12/01/2017 at 15:23

Please note that terms and conditions apply.


International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

Temperature controlling system using embedded equipment

R Rob, G O Tirian and C Panoiu


Politehnica University of Timisoara, Department of Electrical Engineering and
Industrial Informatics, 5 Revolution Street, Hunedoara, 331128, Romania

E-mail: [Link]@[Link]

Abstract. Present paper describes the functionality of a temperature controlling system using
PIC 18F45K22 microcontroller. The ambient temperature is acquired with LM35 analogue
sensor. The microcontroller program is realized with MikroC compiler and it is able to control
the speed of a cooling fan with dc motor. The speed can be increased in functioning with the
increasing of the ambient temperature.

1. Introduction
Temperature measurement in industry today includes a wide variety of needs and applications. To
meet this range of needs of the process control, the industry has developed a large number of sensors
and devices in order to accomplish this demand.
Temperature measurement is one of the most common situations.
This paper presents the achievement of a data acquisition system for monitoring and controlling
temperature inside a system developed around a core microcontroller type.

2. Theoretical considerations
As it is shown in Figure 1, the microcontroller reads the output code of the analogue to digital
converter (ADC) where the temperature sensor is connected. The input signal is controlled by a
voltage divider.
In order to control accurately the process temperature without external operator involvement, a
temperature control system is based on a controller that accepts a temperature sensor such as a
thermocouple or RTD at its input. Its purpose is to compare the current temperature with the set point
and then it provides an output to a control element. The controller is part of the whole control system
and the entire system should be considered in selecting the appropriate controller.
The following items should be considered:
-Type of sensor input (thermocouple, RTD) and temperature range
-Type of output required (electromechanical relay, SSR, analogue output)
-Algorithm which is necessary to control the application using the microcontroller
-The number and type of results (heat, cold, alarm limit) [1], [2].

3. Description of the temperature controlling system


The system is composed by PIC 18F45K22 microcontroller which is working from EasyPICv7
development board, a LM35 temperature sensor and a cooling fan with dc motor.

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

3.1. PIC 18F45K22 microcontroller


PIC18F45K22 microcontroller is a microcomputer integrated into a single chip available in 40-pin
capsule with the following features:
-Full operation 5.5V (PIC18F2XK22 / 4XK22), frequency 1.8V low-voltage operation of 3.6V
available (PIC18LF2XK22 / 4XK22), software auto-programmable power-on reset (POR), power-up
timer (PWRT) and Oscillator Start-up timer (OST) Watchdog timer type (WDT) oscillator and on-chip
software enables protection of code programmed in-circuit Serial Programming.
Analog features which must be taken into consideration are the followings:
Analog to digital conversion mode (ADC) Resolution 10 bit, 17-channel analogue input (PIC18F /
LF2XK22), 28-channel analogue input (PIC18F / LF4XK22) capacity self-acquisition, conversion is
available during Sleep mode. Type sensing voltage high / low, the unit of measure load time (CTMU)
for support mTouch: up to 28 channel button, sensor or the input cursor, the comparator analogue: two
analog comparators, comparator pins for input. They are accessible and configurable from the outside.
Peripheral Features:
Comes 24/35 I / O pins and only one input pin: The intensity of electric current 25 mA / 25 mA, the
individual Interrupt pin, three external interrupt pins, up to seven timer modules, up to four timers 16-
bit / counters with precursor. Up to three pairs 8-bit timers / counters, low-power oscillator Timer1
Module (CCP) one, two or four PWM outputs, selectable polarity, auto-shutdown and Auto-Restart
[3], [4].

3.2. EasyPICv7 development board


EasyPIC V7 (Figure 2) is a complete development system for development and testing of applications
for PIC microcontroller. This tool provides a complete development platform that supports high
quality PIC devices (P10, P12, P16 and P18).
Featuring electronic integrated circuits such as USB2.0 programmer with mikroICD support,
Touch Panel Controller, Keyboard, Port Expander, Serial COG display, support DS1820 and more.
EasyPICV7 board offers many practical features for users to develop various embedded applications
using the most popular component in electronics.

Figure 1. PIC18F45K22 Figure 2. EasyPICv7 development board


microcontroller. Pin configuration

2
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

3.3. LM35 temperature sensor


LM35 presented in Figure 3 has the following features:
-Calibration directly in degrees Celsius (°C).
-Guaranteed accuracy of 0.5°C to +25°C.
-Measurement range from -55° to 150°C.
-Suitable for remote applications.
-Supply voltage from 4V to 30V.
-Current consumption 60 saddle.
-Self-heating during operation 0.08 ° C (airborne capsule).
-Low output impedance of 0.1 Ohm 1 mA load.
The series circuits are LM35 precision temperature sensors, whose output voltage is directly
proportional to Celsius (° C) temperature.
LM35 thus has an advantage over linear temperature sensors calibrated in degrees Kelvin (K),
because the user is forced to use those to get a scaling constant in degrees Celsius convenient
calibration requires no external. LM35 to provide accurate ± 0.25 ° C at 25 ° C and ± 0.75 °C over the
range of temperature.
The output impedance low linear output and internal calibration make LM35 circuit easily
interfaced with other circuits reading or checking It can be powered from sources Half-wave (+ V,
0V), or sources double-alternation (+ V, 0V ,-V). Very low power consumption of LM35 is 60 saddle
triggers a self-heating of less than 0.1 ° C in the air.

3.4. DC motor controlling


The cooling fan will be controlled by the microcontroller using PWM technique.
Varying motor speed is accomplished by increasing or decreasing the period in which the control
signal is 1 logical. Therefore, at a 100% duty cycle, the motor has a maximum speed. At a duty cycle
of 50%, the dc motor speed is half of the nominal speed (Figure 4).

Figure 3. LM35 temperature sensor

3
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

Duty cycle 0% - 0

Duty cycle 25% - 64

Duty cycle 50% - 127

Duty cycle 75% - 191

Duty cycle 100% - 255

Figure 4. Motor speed

In order to supply the whole electric, a dc motor driver L293d is used (Figure 5).
L293D integrated circuit can control dc motors powered by 35V and 600 mA max. Each of the two
bridges H has two input terminals (input) and a terminal activation (Enable). When EN terminal is
connected to 5V, H bridge is active. If input IN1 is logical 1 (5V) and IN2 input is logic 0 (0V), the
motor rotates; if the states of the two inputs are reversed, the motor will rotate in the opposite
direction. When both inputs are logical 0, the dc motor stops and if both are logical 1, the motor shaft
is braked.
The advantages for PWM technique are the following:
- Power dissipation per power electronic devices working in switching is much smaller than the
power dissipated on regulatory elements series;

Figure 5. L293d motor driver

4
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

- Power consumption is even lower as the working electronic device power switching performance
approaching an ideal electrical switch;
- As a consequence of the above, we have high energy efficiency, low volume, possibility of
incorporating light into automation schemes, which is an important requirement of power electronic
circuits;
- Through duty cycle control, PWM control circuitry can provide output voltages from a wide range;
- Stabilized output voltages are isolated from the input voltage.
The algorithm implemented for the temperature controlling is presented in Figure 6 [5], [6]. Figure
7 presents the simulation bloc scheme using Proteus which is a simulation environment. The Proteus
scheme for this application is presented in Figure 8. In the followings, the source code of the
application is presented.

Figure 6. The application algorithm

Figure 7. Simulation block scheme

5
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

Source code of the application:


char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at LATB0_bit;
sbit GLCD_CS2 at LATB1_bit;
sbit GLCD_RS at LATB2_bit;
sbit GLCD_RW at LATB3_bit;
sbit GLCD_EN at LATB4_bit;
sbit GLCD_RST at LATB5_bit;
sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction at TRISB2_bit;
sbit GLCD_RW_Direction at TRISB3_bit;
sbit GLCD_EN_Direction at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;
unsigned long current_duty;
unsigned long temp;
unsigned long frecv;
unsigned short factor[4] ;
void main() {
ANSELA = 0; // Configure AN pins as digital
ANSELB = 0;
ANSELC = 0;
ANSELD = 0;
ANSELE = 0x04; // RE2 as analog
TRISE = 0x04; // RE2 as input
LATA = 0xA0;
TRISA = 0x0F; // configure PORTA pins as input
LATB = 0; // set PORTB to 0
TRISB = 0; // designate PORTB pins as output
LATC = 0; // set PORTC to 0
TRISC = 0; // PORTC as output
PWM1_Init(500); // Initialize PWM1 module at 500kHz
current_duty = 0; // initial value for current_duty
frecv = 5000;
Glcd_Init();
Glcd_Fill(0x00);
Glcd_Set_Font(Font_Glcd_System5x7,5,7,32);
Glcd_Write_Text("Temperatura", 0, 2, 1);
Glcd_Write_Text("Factor de umplere", 0, 3, 1);
PWM1_Start(); // start PWM1
PWM1_Set_Duty(current_duty); // Set current duty for PWM1
do
{
current_duty = ADC_Read(7); // Acquire analogical signal using ADC
// current_duty=current_duty*5000/1023; // Conversion analogical signal in mV
// current_duty=current_duty*255/5; // Conversion analogical signal in mV
temp = 256*current_duty/600;
ByteToStr(temp, factor);
Glcd_Write_Text(factor, 105, 2, 1);
current_duty = (current_duty-48)*12;
PWM1_Set_Duty(current_duty); // Set current duty for PWM1

6
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

ByteToStr(current_duty, factor);
Glcd_Write_Text(factor, 105, 3, 1);
} while(1);
}

LM35 sensor used in this application is powered by a 5V voltage source. It output pin is connected
to an analogue input pin (RE2) of the microcontroller. This is to take the analogue signal coming from
the temperature sensor and to generate the PWM control signal of the cooling fan motor.
When the temperature sensed by the sensor reaches a threshold value which can be set by the user
through the program, it actuates a cooling fan. The system works as shown below in Figure 8:
PWM signal generated by the microcontroller will have 5V amplitude and duty cycle will be
controlled by the acquired temperature. Thus, on reaching the required temperature, parameter Duty
cycle will increase from 0% threshold at 100% to a value above the threshold, also chosen by the user.
Increasing the duty cycle of the PWM signal, the system will increase the speed of the cooling fan.

Figure 8. Simulation scheme using Proteus

Figure 9. L293d pin configuration

7
International Conference on Applied Sciences (ICAS2016) IOP Publishing
IOP Conf. Series: Materials Science and Engineering 163 (2017) 012046 doi:10.1088/1757-899X/163/1/012046

Power driver L293D is supplied at terminal 16 (Vcc1) with voltage of 5V and at pin 8 with voltage
of 5-36 V. The pins 12 and 13 are connected to ground. The enable pin is 8 (at '0' logic, the cooling fan
does not work). The PWM command is connected to pin 15 and the dc motor supply is achieved
between terminal 14 and ground.

4. Conclusions
This paper proposes a very simple, accessible and reliable method for temperature controlling. PIC
microcontrollers permit a very wide range of applications and together with an appropriate
development board is able to reduce the hardware circuits. Using development boards in applications,
the improvement of the software application can be very accessible.

Acknowledgement
This work was supported by a grant of the Romanian National Authority for Scientific Research and
Innovation, CNCS – UEFISCDI, project number PN-II-RU-TE-2014-4-1788.

References
[1] Mitescu M and Susnea I 2005 Microcontrollers in practice, Springer, Berlin Heidelberg New
York
[2] Popa M 2008 Sisteme cu microcontrolere orientate pe aplicaţii, Orizonturi Universitare,
Timişoara, Romania
[3] Calcutt D, Cowan F and Parchizadeh H 2004 8051 Microcontrollers: An Applications Based
Introduction, Newnes Elsevier
[4] Rusu-Anghel S, Lihaciu I C and Rusu-Anghel N 2015 State feedback control of a robotic arm,
Annals of the Faculty of Engineering Hunedoara 13(1) 75-82
[5] Iordan A E and Panoiu M 2014 A new approach in the design of an interactive environment for
teaching Hamiltonian digraphs, IOP Conf. Ser.: Mater. Sci. Eng. 57 012012
[6] Muscalagiu I, Vidal J, Cretu V, Popa H E and Panoiu M 2007 The Efects of Agent
Synchronization in Asynchronous Search Algorithms, Lecture Notes in Artificial Intelligence
4496 53-62

You might also like