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, op-

amp, 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 , (the voltage divider equation), we 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 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 op-amp 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:

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.

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 W.

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,000W. 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 using the voltage corresponding to the maximum temperature: . Then pick any resistor larger or equal to this calculated value. When the potentiometer is rotated to 10kW, 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.



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:. Also recall 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.