10K Community College of Allegheny County Unit 9 Page #1 Thermocouples +12V Thermocouple Junction Vin Copper Wire Constantan Wire + - 3 2 741 7 4 1 5-12V 6 V Vout R1 = 1K Rf = 100K Engineers are not expected to know everything at all times. The job requires them to learn over time, and to revise each effort repeatedly in a never-ending effort to learn and adapt to changing requirements. When you accept this, you will no longer fear the unknown. Instead, you will have confidence to identify & understand what you do not know, while never assuming that everything is fine, easy or perfect. Revised: Dan Wolf, 5/6/2018
Community College of Allegheny County Unit 9 Page #2 OBJECTIVES: Understanding Thermocouples Using the Arduino for Thermocouple temperature measurement. DELIVERABLES THAT YOU MUST SUBMIT 1. Tables 1, 2 (plus equations and comments) 2. Experiment #3 Schematic and summary 3. Practice Problems On-Line Reading Material for Thermocouples: Required: a) http://www.analog.com/en/analog-dialogue/articles/measuringtemp-using-thermocouples.html b) http://www.electronics-tutorials.ws/io/io_3.html c) http://www.eurotherm.net.au/control/product/appl/tc_colour_ha0 27723_1.pdf Optional: a) http://www.thermocoupleinfo.com/ b) Thermocouple Tables: https://srdata.nist.gov/its90/menu/menu.html c) http://www.allaboutcircuits.com/textbook/direct-current/chpt- 9/thermocouples/ INTRODUCTION TO THERMOCOUPLES: When two different metallic materials are in contact, a voltage will be generated that depends on the temperature difference between the junction and the rest of the conductors. Typically, induced voltages will be between 1 and 70 µv/ C for standard metal combinations. This effect is known as the Seebeck effect in honor of the Estonian physicist, Thomas Seebeck.
Community College of Allegheny County Unit 9 Page #3 A thermocouple consists of two wires of dissimilar metals joined together at one end, called the measurement ("hot") junction. The other end, where the wires are not joined, is connected to the signal conditioning circuitry traces, typically made of copper. This junction between the thermocouple metals and the copper traces is called the reference ("cold") junction. Note that the reference junction temperature must be known to get an accurate absolute temperature reading (reference junction compensation). Thermocouple types include Types R, S, K, E, T, and J with each type made from two different metals providing each with a unique temperature range, Coefficient (uv/ C), and Sensitivity. We will work with the Type K (Chromel/Alumel) thermocouple which is the most common, providing the widest temperature range (-200 to 1300 C) with an accuracy of ± 2.2 C% or ±.75%. EQUIPMENT REQUIRED: 1. Type K Thermocouple 2. Arduino Uno, power supply, cable, and USB Hub. 3. AdaFruit AD8495 Shield for the Arduino 4. 741 Op-Amp IC 5. 1KΩ resister 6. 100KΩ resister 7. 10KΩ, 10-turn potentiometer 8. Digital Voltmeter 9. Oscilloscope 10. Thermometer, ice and water
Community College of Allegheny County Unit 9 Page #4 Experiment #1 Thermocouple Demonstration: 1. Figure #1 shows a Type K thermocouple that is connected to an oscilloscope or voltmeter. Construct the circuit, test the circuit at room temperature and record the result in Table #1. It will not be easy to see a steady output because the very low-level output will be overshadowed by electrical noise. 2. Insert the thermocouple in an ice bath and record the result. 3. Note that the thermocouple generates a very small voltage but you should be able to see a noticeable increase between the ice bath and your hand temperature. Apply moderate heat and capture the result. Then heat it a little more to finish Table #1. 4. Submit Table #1 as your documentation for this experiment. Thermocouple Only Ice Bath 32 F Room Temperature The palm of your hand (fist) Warm tap water Table #1 Actual Temperature Expected mv Output (from T/C tables) Actual mv Output Experiment #2 Temperature Measurement with the Arduino: 1. Figure #2 shows a Type K thermocouple connected to an Arduino microcontroller. The Arduino is using an AdaFruit AD8495 shield which performs the amplification and linearization necessary to for the Arduino to properly collect the temperature.
Community College of Allegheny County Unit 9 Page #5 The Adafruit AD8495 shield amplifies the small thermocouple signal and feeds the larger signal to the Arduino A0 analog input. The Arduino software reads the RAW A-D value representing the amplified thermocouple voltage. Because there are low level noise and offset errors, the signal has a small amount of instability causing the temperature to appear to shift up and down by a degree or two. So, the Arduino software reads ten samples every second. It then discards the two highest and two lowest values and averages the eight values in the middle to produce a filtered result. Finally, the filtered result is converted to voltage, Centigrade and Fahrenheit and sent to the Serial Monitor for display. Knowing that the A-D converter is 10-bits (2 10 = 1024) with a 5V reference voltage, the formula to convert the RAW A-D count to voltage is: Vout = RAW A-D Value * 5.0V 1024 The formula to convert the amplified T/C voltage to C is: C = Vout 1.25 0.488mV 2. Construct the circuit and upload the Arduino with the program named: Arduino_Thermocouple.ino 3. Start the Arduino Serial Monitor: Tools Serial Monitor so that you can monitor the Arduino temperatures. 4. Complete the tests listed in Table #2. The Arduino AD8495 shield amplifies and filters the signal so it will be much easier to read. The shield also adds a 1.25 volt offset to the signal so don t forget to subtract 1.25 volts from the Arduino reported voltage. There will also be an ADC offset error due to the Arduino. 5. Note that the Arduino temperatures are very responsive and easy to use. It is possible to perform the amplification with a basic Op-Amp but that would require a circuit design and construction and would not provide any type of linearization, filtering, or display. Today s technology allows us to purchase off-the-shelf components like the Arduino that, with a little bit of software, can greatly expand the usefulness for much less development costs.
Community College of Allegheny County Unit 9 Page #6 6. Submit Table #2 as your documentation for this experiment. Table #2 Expected mv Actual Actual Output Arduino mv Temperature (from T/C Temperature Output tables) Arduino Thermocouple Ice Bath 32 F Room Temperature The palm of your hand (fist) Warm tap water Experiment #3: 1. Build and test the circuit on the cover page of this lab. You should observe that this circuit is better than Experiment #1 (which measures a very small signal) but not as good as Experiment #2 (which includes both amplification and filtering). 2. Submit a schematic and summary of the results with comments contrasting this solution to those in Experiments 1 and 2. Optional Experiment #1: 1. Place the thermocouple in an ice bath and observe whether you get a 0 C reading. If it is not zero, adjust the offset value that is in the software (1.25 volt) so that you get 0 C when the T/C is in the ice bath. Due to the Arduino scaling, every 4.88mV (0.00488) that you add or subtract will affect the temperature offset by 1 C. 2. Examine the Arduino software. The A-D value is read by the call to analogread(a0) which puts the value into the raw variable. Change the software by removing the filter so that the Serial Monitor displays each temperature value in
Community College of Allegheny County Unit 9 Page #7 real-time (ask the instructor for help if you are not familiar with software). Observe the amount of instability. 3. Summarize your comments and provide a copy of the modified Arduino software. Figure #1 Thermocouple Demonstration
Community College of Allegheny County Unit 9 Page #8 Figure #2 Arduino Thermocouple Circuit Type K Thermocouple Junction Copper Wire Constantan Wire Adafruit AD8495 Shield Analog K-Type Thermocouple Amplifier 2.7 to 18Vdc T=(Vo-1.25)/5mV Vo=T*5mV+1.25V Temp is in C Computer USB Arduino Uno External Power Supply
Community College of Allegheny County Unit 9 Page #9 Figure #3 Type K Temperature Table Type K Thermocouple - Thermoelectric Voltage in mv DegC 0 1 2 3 4 5 6 7 8 9 10 0 0 0.039 0.079 0.119 0.158 0.198 0.238 0.277 0.317 0.357 0.397 10 0.397 0.437 0.477 0.517 0.557 0.597 0.637 0.677 0.718 0.758 0.798 20 0.798 0.838 0.879 0.919 0.96 1 1.041 1.081 1.122 1.163 1.203 30 1.203 1.244 1.285 1.326 1.366 1.407 1.448 1.489 1.53 1.571 1.612 40 1.612 1.653 1.694 1.735 1.776 1.817 1.858 1.899 1.941 1.982 2.023 50 2.023 2.064 2.106 2.147 2.188 2.23 2.271 2.312 2.354 2.395 2.436 60 2.436 2.478 2.519 2.561 2.602 2.644 2.685 2.727 2.768 2.81 2.851 70 2.851 2.893 2.934 2.976 3.017 3.059 3.1 3.142 3.184 3.225 3.267 80 3.267 3.308 3.35 3.391 3.433 3.474 3.516 3.557 3.599 3.64 3.682 90 3.682 3.723 3.765 3.806 3.848 3.889 3.931 3.972 4.013 4.055 4.096 100 4.096 4.138 4.179 4.22 4.262 4.303 4.344 4.385 4.427 4.468 4.509 110 4.509 4.55 4.591 4.633 4.674 4.715 4.756 4.797 4.838 4.879 4.92 120 4.92 4.961 5.002 5.043 5.084 5.124 5.165 5.206 5.247 5.288 5.328 130 5.328 5.369 5.41 5.45 5.491 5.532 5.572 5.613 5.653 5.694 5.735 140 5.735 5.775 5.815 5.856 5.896 5.937 5.977 6.017 6.058 6.098 6.138 150 6.138 6.179 6.219 6.259 6.299 6.339 6.38 6.42 6.46 6.5 6.54
Community College of Allegheny County Unit 9 Page #10 Figure #4 Arduino_Thermocouple.ino - Arduino Software // // Every second, this collects 10 temperature samples, // discards the 2 lowest and the 2 highest then averages the 6 in the middle. // Written: 12/23/2016, djw // This uses the AdaFruit AD8495 shield via the Arduino Analog 0 input // Accurate to about 1degC or about 2degF // #include <SPI.h> const int OUTPUT_PIN_LOW = 4; //this output will go high when the temperature exceeds the lower threshold const int OUTPUT_PIN_HIGH = 5; //this output will go high when the temperature exceeds the upper threshold const float OUTPUT_PIN_LOW_THRESHOLD = 5.0; //this is the low threshold in degf const float OUTPUT_PIN_HIGH_THRESHOLD = 15.0; //this is the high threshold in degf void setup() { Serial.begin(9600); Serial.print("Thermocouple Program Starting vapr_20_2017...\n"); Serial.print("This uses the AdaFruit AD8495 shield via the Arduino Analog 0 input.\n"); Serial.print("This filters via 10 samples, discarding the two upper and lower.\n"); pinmode(output_pin_low, OUTPUT); //LED for low status pinmode(output_pin_high, OUTPUT); //LED for high status void loop() { int ix; char buf[200]; char stemp_float[10]; float ftemperature_degf; char stemperature_degf[10]; float ftemperature_degc; char stemperature_degc[10]; int sortvalues[13]; int raw; float Vout; for (ix = 0; ix < 10; ix++) { //collect 10 samples sortvalues[ix] = analogread(a0); delay(100); sort(sortvalues, 10); // sort and then discard the two upper and lower values raw = (sortvalues[2] + sortvalues[3] + sortvalues[4] + sortvalues[5] + sortvalues[6] + sortvalues[7] ) / 6; Vout = raw * (5.0 / 1023.0); // Temperature = (Vout - 1.25) / 0.005 V. For example, if the voltage is 1.5VDC, the temperature is (1.5-1.25) / 0.005 = 50 C ftemperature_degc = (Vout - 1.25) / 0.00488; // normally subtract 1.25 but adjust for zero-offset calibration compensation ftemperature_degf = (ftemperature_degc * 9) / 5 + 32; //convert to degf dtostrf(ftemperature_degf, 3, 1, stemperature_degf); // 3 is mininum width, 1 is precision; dtostrf(ftemperature_degc, 3, 1, stemperature_degc); // 3 is mininum width, 1 is precision; dtostrf(vout, 4, 3, stemp_float); // 4 is mininum width, 3 is precision; sprintf(buf, " RawAD Value= %u Voltage= %s Volt Temperature= %s degc or %s degf \n", raw, stemp_float, stemperature_degc, stemperature_degf); Serial.print(buf); if (ftemperature_degf > OUTPUT_PIN_LOW_THRESHOLD) { digitalwrite(output_pin_low, HIGH); //indicate temperature is higher then the low limit else { digitalwrite(output_pin_low, LOW); //indicate temperature is lower then the low limit if (ftemperature_degf > OUTPUT_PIN_HIGH_THRESHOLD) { digitalwrite(output_pin_high, HIGH); //indicate temperature is higher then the high limit else { digitalwrite(output_pin_high, LOW); //indicate temperature is lower then the high limit // ===================================================================================================== void sort(int a[], int size) { int x; int y; int z; for (x = 0; x < (size - 1); x++) { for (y = 0; y < (size - (x + 1)); y++) { if (a[y] > a[y + 1]) { z = a[y]; a[y] = a[y + 1]; a[y + 1] = z;
Community College of Allegheny County Unit 9 Page #11 PRACTICE PROBLEMS: 1. 277 on the Kelvin scale is equal to: C = F = 2. Temperature sensing can be achieved by the use of: a) RTDs b) thermocouples c) thermistors d) all of the above 3. What is the definition of Negative Temperature Coefficient? 4. Identify the accuracy of each of the following: a. Type-K Thermocouple: b. Thermistor: c. Platinum RTD: 5. What voltage would we expect from a type-j thermocouple at 100 C?