Download Thermistor/Relay Lab

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Ground loop (electricity) wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Mercury-arc valve wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Stepper motor wikipedia , lookup

Thermal runaway wikipedia , lookup

Power inverter wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Three-phase electric power wikipedia , lookup

Islanding wikipedia , lookup

History of electric power transmission wikipedia , lookup

Electrical substation wikipedia , lookup

Potentiometer wikipedia , lookup

TRIAC wikipedia , lookup

Distribution management system wikipedia , lookup

Electrical ballast wikipedia , lookup

Diode wikipedia , lookup

Power electronics wikipedia , lookup

Transistor wikipedia , lookup

Ohm's law wikipedia , lookup

Rectifier wikipedia , lookup

Triode wikipedia , lookup

Metadyne wikipedia , lookup

P–n diode wikipedia , lookup

Schmitt trigger wikipedia , lookup

Power MOSFET wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Surge protector wikipedia , lookup

Current source wikipedia , lookup

Voltage regulator wikipedia , lookup

Alternating current wikipedia , lookup

Stray voltage wikipedia , lookup

Buck converter wikipedia , lookup

Voltage optimisation wikipedia , lookup

Current mirror wikipedia , lookup

Opto-isolator wikipedia , lookup

Mains electricity wikipedia , lookup

Transcript
Thermistor/Relay Lab
10/26/05 MPM
Objectives:
--To build a simple controller that will maintain a steady temperature in a given device
(to be chosen by instructor).
--To gain understanding of the workings of a thermistor, Zener diode, LED, relay, opamp, and some transistor basics.
--To know voltage dividers better through practice.
Part A:
Consider the following schematic:
We will observe several things before we construct this circuit. The thermistor,
, is
an element with resistance highly and reliably dependant on temperature. As its
temperature increases, its resistance decreases. In the above circuit, we are using it in a
voltage divider. Since Vout 
10k
Vin , (the voltage divider equation), we
RT  10k
see that for a higher temperature, RT is reduced and Vout increases.
Likewise, for a lower temperature, RT is increased and Vout decreases. Next
we observe the op-amp. Here the 741 is specified, though the 355 will
work just as well. The pin-outs for both are the same. For the purposes of
this circuit, we are not using the op-amp to amplify, but to compare
whether the voltage supplied by the thermistor voltage divider is less than
or greater than the voltage supplied by the 10k potentiometer. Which is to
say, how does the sensed temperature compare to our set point? If every measured
temperature creates a different voltage by means of the thermistor, than the potentiometer
(operating in conjunction with the op-amp) will let us set a temperature (via a voltage) we
wish our circuit to maintain. The property of the op-amp we use here is its "railing
effect". When input difference V3 - V2 = 1V, say, the op-amp might try to deliver 1 MV
on pin 6. BUT! We are only supplying the op-amp with 9V on pin 7, so that is the most
it can deliver. For our purposes, only a power supply (battery) creates voltage, not an IC
chip. Suppose the difference V3 - V2 = -1V. Again, despite what it wishes, the lowest
voltage the chip can give us is 0V, due to the connection to ground on pin 4. It can't
create negative voltage either. (As seen in your previous lab, the op-amp cannot actually
only get to within approx.  .5V of its power supplies). This is the railing effect: without
1
control circuitry, the op-amp will go to its positive supply voltage if V3 > V2 by even a
mV, and to its negative supply voltage if V2 > V3, again by even a very small amount. .
Concerning the LED, the arrow points in the direction of conventional current, positive to
negative. The LED is a diode, a device that has a "set" voltage drop across it, in this case
~1.6V. If you supply less voltage across it than this, no current flows through it (and
hence no light emitted). On the other hand, if you try to supply a larger voltage drop
across it, the LED tries to draw enough current to cause the voltage supply to sag to 1.6V.
The diode will always attempt to maintain a voltage drop of 1.6V across it. This number
depends on the physical constitution of the diode and nothing else.
So, putting this altogether, when the temperature sensed by the thermistor is less than the
set point (controlled by the potentiometer), pin 6 of the op-amp is near ground and the
LED can light. When the temperature is higher than the set point, the output is close to
9V—the LED does not have 1.6V across it and therefore cannot light. To reverse this
behavior, we could switch the inputs to pins 2 and 3 of the op-amp.
1) Build above circuit on breadboard. Ensure the LED is oriented properly. The longer
lead should go to the positive voltage.
2) Rotate potentiometer until LED just goes on.
3) Warm thermistor with hand just until LED goes off.
4) Wait till thermistor cools and LED goes on again.
5) Try reversing inputs to op-amp and verify the operating cycle is also reversed.
6) Place a voltage meter across pins 2 and 3 of the op-amp and verify that the LED goes
on and off as this reading changes sign. (It may not exactly, due to the fact that the 741
op-amp needs to be "trimmed"—by utilizing the unused pins—to rid it of Input Offset
Voltage, but you should at least see it oscillating around some fixed voltage. The 355 opamp has a much smaller input offset voltage.)
Part B (Transistor and relay as switches)
We wish to use the thermistor to control a
"real" light bulb, not just an LED, or
perhaps a heating element in a small
furnace. To control a high voltage
element by a low voltage element, we
need an isolated switch, in this case a
relay. This is shown at the right of the
schematic. The low voltage flowing
through the solenoid pulls the contacts of
the relay together (through a magnetic
field). These contacts form the switch that
controls the 120V appliance. The relay
has two high side (120V) connections, one normally open and one normally closed. We
will use the normally open connection for this lab (the insides of the aluminum box are
already wired in this manner). Another new circuit element, also used here as a switch—
though it has many other uses—is the Bi-Polar transistor:
2
Though a simplification, we can say that a current incident at B will allow a current to
flow from C to E. Likewise, no current at B, to current through E! This will reverse the
effect of our last circuit, where a +V signal from the op-amp shut things down (turned off
LED). Here it will allow things to get current (operate relay). The arrow in the transistor
pictogram does indeed represent a diode. A transistor is made of two diodes. With the
arrow pointing this way we call it an NPN transistor. If the arrow pointed the other way,
it would be a PNP transistor. The relay needs 9V to run, so we will need to increase the
circuit supply from 9V to 10V. Why? Recall the op-amp can only output its supply
voltage - .5V. Also, we have the ~.5V drop across the diode in the transistor. This
means the emitter voltage will be the op-amp supply voltage – 1V.
1) Build above circuit, using transistor 2N2222. Find a datasheet for the pin-out.
2) Test in the same manner as Part A, warming and cooling around the set point
(determined by potentiometer) to hear relay clicking on and off.
Question: Is relay opened or closed when measured temperature is above set point?
Answer: if we use the normally open connection, it should be open.
3) To verify this, observe the LED in parallel with relay. The LED should light when the
relay is closed, signifying we are trying to run our heater.
4) Again, verify operation with voltmeter (across inputs of op-amp).
You should notice that the relay buzzes sometimes as it turns on and off. (This was
easiest for the writer of this lab to notice when the set point was around room
temperature). This means it is turning on and off very quickly, probably not good for our
heating element. We shall remedy this in Part D.
Part C (Transistor as current source, Zener Diode)
Recall that power dissipated (heat) in a resistive element is P = I2 R = I V. So consider
our thermistor. It is a resistor and current flows through it, so this will cause heating. As
it heats, its reading will change. The voltage divider we have so far used it in draws
different current through it at different temperatures (since the voltage across the
thermistor changes and I = V / R). This will cause non-linearities over time, which we
wish to remove. We would like to send a small, controlled current through the
thermistor, which will minimize self-heating and help promote linearity. A high voltage
power supply and large resistor can create an adequate current supply, but that is
unreasonable here. We shall use another transistor. Recall that a transistor is similar to
two diodes, and that diodes have fixed voltage drops. Well, set up properly we can use
this knowledge to our advantage to create a fixed voltage between the emitter (E) of the
transistor and ground. By choosing a resistor to place here we can fix a current (I = V /
R), and the transistor will do its best (within technical limits) to draw this current between
the supply and collector (C). See the diagram below.
3
The diode between B and E has a drop of ~.6V. So, VE = VB -.6V.
Say VB = 5.6V, then VE = 5V. Current I through C and E is then
fixed by I = VE / R2. The technical limit: as long as transistor is not
"saturated", meaning VC > VE + .2V, the transistor can supply I.
Otherwise, the current will sag. The high side of the load is at 10V;
the only thing that can bring VC down is if the load has a large
enough resistance. On the other hand, since V= I R, we would get
less of a voltage drop across the load if we decreased I, here
meaning to increase R2.
Consider the circuit to the lower left. We see another new element,
the Zener Diode,
. This is surely a diode, but isn't it in the circuit
backwards!? No, it is not. Recall our prior discussion on diodes. When
we were below their rated voltage, no current flowed, and when we were
above it, they maintained a constant voltage drop across themselves. The
key here is the "constant". The drop really does depend on applied voltage
to a small degree. On a graph, this appears as a curve where we would
want a vertical line. A zener can be used in the same manner and we still
get the same curve. BUT, if you reverse bias it--apply voltage in a reversed manner--it
develops a "breakdown" voltage. This is very similar to the voltage associated with a
normal diode, except the curve is much more linear. Reverse biased, a 5.6V Zener diode
will closely maintain the 5.6V drop no matter how the applied voltages changes, as long
as it exceeds 5.6V. So, Zeners make good voltage regulators of a sort. In our schematic
we see we have biased the transistor just as we supposed in our prior talk, with VB =
5.6V.
1) Build the circuit above. The A in the circle stands for an ammeter, which must be put
in series. Let R2 = 10k.
2) Leave out R1 and record the current.
3) Check with your instructor for what range of temperatures your thermistor should
measure, and check with the chart (on the last page) to convert these to a range of
resistances. For demonstration through the rest of this lab, we will assume 10-60 C,
(with target temperature 60 C), corresponding to 20k to 2.5k .
4
4) Substitute various resistors near both ends of this range for R1 and make a table
showing measured current. You should see the current sag considerably for the larger
resistors. This is because VC !> VE + .2V (where ! means NOT).
5) Use these same resistors for R1 again, but this time try R2 = 15k and 20k The current
generated, checked by using no load, should of course decrease with increase of R2.
6) We will say the 20k resistor works good enough—current doesn’t sag too much (if at
all). Make a note of Vout for the edges of our range, R1 = 20k and 2.5k. Again we see
voltage goes in the same direction as temperature.
Part D (final circuit)
This is the complete circuit (below), except for what you will hook up to the
relay-controlled switch. Also, you need to determine a value for R3. In the
picture to the left, the potentiometer is really used just as a variable resistor.
This will create the voltage at the op-amp that we use for our set-point. If
every measured temperature creates a different voltage by means of the
thermistor, than this voltage divider will let us set a temperature (via a
voltage) we wish our circuit to maintain, operating in conjunction with the
op-amp. We want the bottom half of this voltage divider to remain constant for reasons
you will see later. The 10k potentiometer on your board is really capable of the range
100 – 10,000. Since from step 6 above we know the range of voltages going to pin two
of the op-amp, we should be able to figure out R3. For ease, solve the following equation
R3
10V .
using the voltage corresponding to the maximum temperature: Vout 
100  R3
Then pick any resistor larger or equal to this calculated value. When the potentiometer is
rotated to 10k, we should certainly be able to bring Vout down to the lower value of our
range.
1) Build circuit as below.
2) Verify its operation, again just heating the thermistor with your body heat.
5
If you haven’t heard the relay “buzz” yet, just know it is a serious defect that occurs
sometimes. Here is what happens: the thermistor does not heat and cool perfectly,
neither does the environment it is in. Therefore
it will float around the set point and cause the
relay to cycle quickly. If the relay is controlling
a resistive filament, this will greatly shorten the
filament’s lifetime. Wouldn’t it be great if we
had two set points? Where temperature had to
fall below Vb to turn on heater and rise above Va
to turn off heater? So in the lower left, the
heater turns off at point A, but does NOT turn
back on at B. It turns on at C and off again at D.
How do we accomplish this in our circuit?
Many ways, but we will use positive feedback
on the op-amp (meaning some of the output is
fed back to the non-inverting input). Recall that
two resistors in parallel have an equivalent
resistance given by: Req 
R1 R2
. Also recall
R1  R2
that when V2 > V3 on the op-amp, pin 6
becomes a ground (or close to it). When V3 >
V2, pin 6 is near 9V. So, if we placed a resistor
(Rschmitt) between pin 6 and pin 3 (positive feedback), it would have a different effect
depending on the output of the op-amp. With pin 6 low, it would act as if in parallel with
R3, thus bring down the voltage at pin 3. This will correspond to Vb in the diagram
above. If pin 6 is high, the voltage drop across the resistor is hopefully small, and thus
can be ignored (measure). This will correspond to Va in the diagram above. Anyway, we
will assume we can ignore this voltage drop to get a rough value for Rschmitt (This will be
completely true if our set-point exactly corresponds to the op-amp output). Setting two
levels for measuring signals is accomplished in real life by an IC called a Schmitt trigger.
We will still call our approximation here a Schmitt trigger.
Steps:
a) Looking at the thermistor chart, for the temperature T you wish to maintain
(60 C), figure the change in resistance for a -1 C change in temperature.
b) Calculate voltage V generated by the thermistor at T, knowing I from current
source (measured) and R from chart.
c) Calculate V, knowing R from chart and I from current source. (V should
be negative). Measure Vin if it is not exactly 10V.
R3
V for RPOT
d) Solve: V 
R POT  R3 in
Req
V for Req.
e) Solve: V   V 
R POT  Req in
f) Solve: Req 
R3 Rschmitt
for Rschmitt.
R3  Rschmitt
6
Note: steps d) and f) show why we elected to use the potentiometer the way we did.
Otherwise, R3 would be replaced with RPOT—a slight complication.
3) Add Schmitt trigger to schematic and verify it provides a separate on and off voltage,
using a voltmeter at pins 2 and 3 of op-amp.
4) Use a DVM to assure the set point voltage corresponds to the correct temperature.
4) Tie heating element to relay and place thermistor in heating chamber. Using a
mercury thermometer, verify the temperature kept is within reason, and that it is kept
constant (within a degree or so).
**We will use a hotplate to heat oil to 60 C. Let the hotplate run on high heat to
approach 60 C, but when you are near this temperature, turn the hotplate down to its
lowest setting. This will avoid overshooting the desired temperature by a large amount.
Extra
We may wish to chart the operation of our apparatus. There should be an X-Y recorder
available in the lab for such purposes. We wish it to record what we have been looking at
with our meters the whole time, the voltage between pins 2 and 3 of the op-amp. Why
not hook the recorder right to here? First, we may wish to scale the signal. Secondly, if
the recorder draws any current, if will interfere with our setpoint. Below is a differential
R2
(V  V1 ) . The two op-amps on
amplifier, which will let us scale the signal. Vout 
R1 2
each input that employ negative feedback are called buffers. They insure no current is
drawn. Make sure both R1’s and both R2’s are very closely matched in value.
7
T
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
R (kOhm)
32.77
31.14
29.59
28.14
26.76
25.46
24.22
23.06
21.96
20.92
19.93
19.00
18.11
17.27
16.48
15.73
15.01
14.33
13.69
13.08
12.50
11.95
11.42
10.92
10.45
10.00
9.57
9.16
8.78
8.41
8.05
8
T
R (kOhm)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
7.72
7.40
7.10
6.81
6.53
6.26
6.01
5.77
5.54
5.32
5.11
4.91
4.72
4.54
4.37
4.20
4.04
3.89
3.74
3.60
3.46
3.34
3.21
3.10
2.98
2.88
2.77
2.67
2.58
2.49