EE
> EE Lab Homepage > LabVIEW
LabVIEW based Temperature Control
Goal:
In this exercise, you will lear how to design a LabVIEW VI ( virtual
instrument) to control the temperature of a heating element (low value
resistor). The temperature desired is by the user. The VI will use the
DAQ board installed in the PC to :
-
measure the voltage generated by a external temperature
sensor and
-
output a voltage to control a relay to turn ON/OFF a heating
element that is attached to the temperature sensor.
Such closed loop temperature control system is similar to the one
used in heating and cooling of our homes with a thermostat. Following
figure shows different components of the temperature control system involved in
the design.
Fig 1 Temperature Control System
Principle of Operation and Design of the Control System :
External Components:
- LM34
is a precision Fahrenheit temperature sensor. This is 3-pin device that
outputs ( Refer to the arrangement above and the Fig 1 on Page 2 of the data
sheet ) a DC voltage proportional to the measured temperature. The output
of the sensor is calibrated ( 10 mV / deg F).
-
The relay
is similar to the ones you have used in EE205
Lab 11, Fig 7 . This relay will control the current (use +5 V supply)
to the resistor that is used as a heating element. The relay cannot be
connected to the output terminals of the DAQ board directly as the outputs
of the board are not capable of sourcing enough current to energize the
relay coil. A 741 op-amp used as a buffer ( voltage follower ) will
work very well in switching the relay.
-
We need approximately 2 Watts of power to be dissipated from
the heating of the resistor
. Calculate the value of the resistance from the known values of
voltage applied and the power dissipation desired (2 W).
-
Position the resistor and the temperature sensor very close
to each other. This will allow efficient thermal contact between the temperature
sensor and the resistor.
LabVIEW VI Design
First, please read and compelete the LabVIEW tutorial for data input / output
The VI you will design will be similar to the
LabVIEW exercise of measuring and generating DC voltages. Following are
few helpful hints :
-
Use a WHILE loop instead of FOR loop as the measurements
need to be taken continuously.
-
The measurements need be made every 1 second. Set the DELAY
in the loop appropriately.
-
The measured voltage from the analog channel is compared
with a SET TEMPERATURE that is entered by the user in the front panel.
The comparison will determine whether the control voltage (+5 volt) that
is generated by the analog output will turn ON or OFF the relay.
-
A BOOLEAN indicator on the front panel of the VI should
show whether the the heater is ON or OFF (relay is energized or not)
-
The temperature should be displayed in deg F
on the front panel as shown in the figure below ( Fig 2).
-
You will have to scale this voltage to display its temperature
in deg. F on the front panel.
-
Hint : Use a COMPARE function between output of the analog
in data and the SET TEMPERATURE value. The output of the COMPARE function
is a boolean value.
-
You may leave "i" terminal of the WHILE LOOP disconnected.
Below is shown a typical Front panel of the VI. Your could be
different but it should show all the scales, displays, controls with correct
color as shown below.
Design specification:
Temperature control range: 80 deg F to 95 deg F
Prelab:
You must have the circuit diagram of the temperature control
system ready when you come to the lab. The diagram should include the pin numbers
of all the components and the value of resistors. Also calculate the resistance
value of the heating element.
- Design the opamp
circuit of a unity gain buffer. This circuit is used to drive the relay.
- Draw the circuit with the relay and opamp pin numbers.
- Calculate the value of the 2W resistor. It will be powered
with a 5V supply (applied through the relay).
In-Lab assignment
Parts List
LM
34
LM741
Relay
Schematic (5 V Relay 201A0500)
One 1/2
Watt resistor ( value to be determined ).
Procedure:
1. Build and verify the circuit :
- Connect the temperature sensor Vout pin to the terminal board(AICH0)
of the DAQ card. Test at room temperature (approx 70 deg F) and connect the
DMM to make sure that the output is correct. If you touch the sensor with
your hand, you should be able to output voltage of the temperature sensor.
- Connect the buffer circuit you designed in pre-lab to the
terminal board (DAC0). The op-amp is powered by 12 volts supply ( +12 Vcc
and -12 Vcc). Do not turn on the power to the op-amp yet.
- Connect all grounds together. (power supply, op amp circuit
and DAQ board ground points)
2. Build and test the VI :
Note : Power the temperature sensor but do not POWER the
op-amp.
- Run your VI in LabVIEW.
Confirm the output voltage at the Analog voltage OUT terminals. Show the set
up of your circuit to the instructor.
-
The voltage being measured by the DAQ board should be scaled
by the VI to display correct temperature on the front panel.
- Set the temperature to be controlled at 85 deg F. The
delay in executing the loop (the rate at which the data is read) should be
set at 1000 msec.
- Run the VI and observe the control voltage at the Analog
Out. Confirm the operation of the relay. If you observe the temperature displayed
in the front panel of VI increasing, your VI is working. The plot on
the front panel will increment every second .
3. Experiment :|
Note: The resistor ( heating
element ) can become very hot. Take precautions while testing the circuit.
-
Set the temperature on the front panel to 85 deg F
and observe the measured temperature on the plot. Print the front
panel.
-
Set the temperature in the front panel to 70 deg F and
observe the cooling rate. Compare this response time with the heating rate.
-
Repeat this for temperature set at 95 deg. F.
Report :
-
Discuss the setup of your system. This should also
include the circuit diagram.
-
Include the VI front panel printouts ( for 85 deg F
and 95 deg F) and the diagram.
-
How long did it take for the heating element to heat the
resistor from room temperature to 95 deg F?
written by George Hunka
last modified by Siddharth M. Deliwala on 2/8/04
EE
> EE Lab Homepage > LabVIEW