The Temperature Controlled Window Matt Aldeman and Chase Brill ME 224 June 2003
Design Objectives The purpose of our device is to control a window based on the temperature of a specified area. The goal is to allow a user to input the temperature at which they would like the window to open and close. The window will then open once the temperature of the area reaches this specified temperature. Then, as the area cools, the window will close once this specified temperature is again reached. To achieve this goal, we will use a thermistor, an operational amplifier, two relays, a DC motor, five volt, twelve volt, and negative twelve volt power sources, a digital acquisition card, and a Labview program. Circuitry The first step we took was to simplify the project. We wanted to simulate the actual opening and closing of a window, but we did not have access to a portable window such that we could bring it into class to demonstrate, and the equipment required for such a task would be rather bulky and expensive. To simplify, we decided to scale everything down. Our motor is a small high-rpm DC motor with a set of reduction gears. This motor is suitable to attach a spool to the output shaft and wrap string around the spool. We could then attach a small weight weighing a few ounces to simulate the window. This project assumes that the window is on a frictionless windowsill such that the window will return to the closed position when no force is applied to keep it open, i.e. closing the window does not require a downward force; it must simply be let go. To obtain the ambient temperature, a thermistor is used. Five volts is sent through the thermistor, and the varying voltage from the thermistor is then sent through a difference operational amplifier with a DC offset to obtain a range large enough to work with in LabView (see section below on our operational amplifier). After the signal is amplified to a range of approximately -5 to 5 volts, which is sufficient for our purposes, the signal is input into LabView through the ADC card. The signal is input into LabView (see section below on our LabView program) and LabView converts the voltage into a temperature using calibration data that we obtained. The purpose of the LabView program is to send a current to one of our DAC s if the temperature is above the pre-set activation temperature and the window is currently closed. Conversely, the program should send a current to our second DAC if the temperature is below the activation temperature and the window is currently open. The current from the DAC s then passes through a set of relay switches. The DAC card does not supply an adequate current to power our motor, so we had to use two relay switches. When current passes through the relay, it triggers a switch completing the circuit between the connected power source (either +12V or -12V) and our motor. The LabView program only sends current through the DAC for a time period sufficient to close or open the window. This time period is easily adjustable in LabView so it could be used for a variety of windows. A circuitry diagram is included with this report in Appendix A.
The Operational Amplifier The operational amplifier is an integrated circuit used for signal conditioning. It is a high performance linear amplifier. We used a difference operational amplifier to amplify the voltage coming out of the thermistor. Originally, this voltage ranged from about 4.51 to about 4.81 volts for a temperature range from 25 ûc to 50 ûc (77 ûf to 122 ûf). A chart containing voltage vs. temperature follows: Temperature [ C] Voltage [V] 25 4.81 30 4.75 35 4.72 40 4.65 45 4.56 50 4.51 The governing equation for a difference operational amplifier is: V out =R 2 /R 1 (V 1 -V 2 ) In this equation, V 2 is the DC offset, which is equal to V ave. V ave =(V max +V min )/2=(4.81+4.51)/2=4.66 R 2 /R 1 is the gain, n, of the operational amplifier. n=10v/ V V=(V max -V min )/2=(4.81-4.51)/2=.14 Thus, the gain, n, is equal to 71 and R 2 must be 71 times R 1. To ensure that we do not get a voltage above 10 volts or below -10 volts, we will use a slightly lower gain in our circuit. Thus, we will not use quite the entire range of -10 to 10 volts through which the operational amplifier can work. We choose our R2 resistance to be 56KΩ and our R1 resistance to be 1KΩ. With these values in place, we have created an operational amplifier that will amplify the range of voltages from the thermistor from the previous values ranging from 4.51 to 4.81 volts to the amplified values ranging from -5 to 5 volts.
The Temperature Voltage Formula In order to convert from a voltage to a temperature in Labview to allow the user to input a desired transition temperature, is is necessary to develop an equation for temperature as a function of voltage. To do this, we took a series of reading for various temperatures and recorded it in a graph. Then, we found the equation for the regression line through these points. The data, graph and equation follow: Voltage [V] Temperature [C] -4.62 23-0.47 30 0.15 35 0.8 40 1.33 45 2.21 50 2.72 55 3.34 60 3.64 65 4.17 70 Temperature [C] Voltage vs. Temperature 80 70 60 50 40 30 20 10 0 y = 5.5912x + 39.88-6 -4-2 0 2 4 6 Voltage [V] This is the equation used in the formula node in the Labview program discussed in detail in the next section.
The Labview Program The Labview program used for our design is attached. Follow along with it as I explain the steps used in our program: 1) The user inputs the desired window transition temperature on the front panel and indicates whether the window is currently up or currently down. If the window is up, the light should be on and if the window is down it should be off. This boolean actually controls a local variable in the program. 2) In the first frame of the large sequence structure, the voltage from the operational amplifier is input to the program with an analog-to-digital controller. This voltage is converted to a temperature using a pre-determined formula (explained above) in a formula node. 3) This temperature is compared to the desired transition temperature. Then, one of three options occurs: (a) If the window is closed and the current thermistor temperature is greater than the desired transition temperature, then the bottom case structure is run. Inside this case structure is a sequence structure that first uses a digital-to-analog controller to supply 5 volts to a relay and changes the value of the local variable to true, indicating that the window is now up. Then it waits for two seconds, and finally, uses another digital-to-analog controller to stop the voltage to the relay. (b) If the window is open and the current thermistor temperature is less than the desired transition temperature, then the top case structure is run. Inside this case structure is a sequence structure that first uses a digital-toanalog controller to supply 5 volts to the other relay and changes the value of the local variable to false, indicating that the window is down. Then it waits for two seconds, and finally, uses another digital-to-analog controller to stop the voltage to this relay. (c) If neither of the above conditions is true, no action is taken. 4) After one of these three actions is taken, the second frame of the sequence structure runs, which contains a wait command that is set to one second, causing the voltage from the operational amplifier to be taken once every second.
Relay Switches The relay switches are used to supply power to the DC motor used to operate the window. Because our motor needs to operate in the forward as well as reverse directions ( opening and closing the window), the polarity of the power source needs to be switched whenever we need to switch the operation of the motor. To accomplish this, two relay switches are used to supply power. A diagram of our relay setup can be found in Appendix A, and a diagram of the operation of a relay can be found in Appendix B. A relay operates using a coil and an actuator arm. When a current is passed through the coil, a magnetic field is developed, which pushes the actuator arm to complete a circuit. For our setup, we needed both of our relays to be in the normally open mode. The relays should close the circuit between the power source and the motor only when current is being sent from the DAC. Our LabView program ensures that only one relay switch will be receiving current from the DAC at any given time: both relay switches will never be receiving current at the same time. When current is being sent from our first DAC to the first relay switch, the relay connects the positive power source to the positive terminal of the motor and the negative power source to the negative motor terminal. However, when the second DAC is turned on and the second relay switch is active, the situation is reversed. The negative power source is connected to the positive motor terminal, and the positive power source is connected to the negative motor terminal. In this way we were able to control the motor in both forward and reverse directions.