Presentation is loading. Please wait.

Presentation is loading. Please wait.

Before we get started... Please  sign the sign up sheet at

Similar presentations


Presentation on theme: "Before we get started... Please  sign the sign up sheet at"— Presentation transcript:

1 Before we get started... Please  sign the sign up sheet at If you are going to Tweet, please use the #hicap hashtag

2 HI Capacity http://hicapacity.org October 11th, 2011 Jeremy Chan
Arduino Night IV HI Capacity October 11th, 2011 Jeremy Chan

3 Tonight Temperature Sensors Reading Sensors Intro to Processing
Sensor Visualization Tonight What will we do? Arduino (C/C++) rocessing (Java) RS232/USB (Async Serial)

4 Temperature Sensor Applications
Cooking (Hot Plate and Oven Control) Soldering (Soldering Irons, Reflow Ovens) Thermal Management (Servers, HVAC) Environmental Monitoring Thermal Safety (Motors, Boilers, Batteries) Food Safety (Refrigeration/Freezing) Characterization (Thermal Conductivity)

5 Temperature Sensors Overview on: Thermistors
Resistive Temperature Detectors (RTD) 3. Non-Contact IR Sensor (TI TMP006) 4. Thermocouples (Wide Range) 5. Semiconductor Band-Gap (Easy Interface)

6 1. Thermistors Resistors Made of NTC or PTC materials
NTC: Negative Temperature Coefficient, R falls as T rises PTC: Positive Temperature Coefficient, R rises as T rises Typical Values from 2.2kΩ to 25C Pros/Cons: Cheap / Non-Linear (Variable Sensitivity) Products Available for -80°C to 150°C (-110°F to 302°F) Non-Linear Temperature/Resistance Curves Omega Thermistor Products More Info:

7 Thermistor Temperature[C] vs R[Ω]
Datasheet / Calibration Constants: a,b,c,d,… Example: Vishay 10k NTC Thermistor Assembly Curve 0C to 100C 27.35kΩ to 0.974kΩ Temperature [°C] R[kΩ] Vishay Calculator: Vishay Thermistor:

8 2. Resistive Temperature Detectors
Precision PTC Resistors Made of Platinum PTC: Positive Temperature Coefficient, R rises as T rises Typical Values from 100Ω 25C Pros/Cons: Accurate, Linear / Expensive, Low Level Signals Products Available for -200°C to 500°C (-328°F to 932°F) Near Linear Temperature/Resistance Curves ~ Ω/°C (3 Standard Classes for Different Temp Ranges Available) US Sensor RTD Products More Info:

9 RTD Temperature[C] vs R[Ω]
All excitations induce some self-heating Less power = Less self-heating = Less error = Less signal Excitation can be disabled, but be aware of fluctuations in temperature due to transient self-heating Example Pt100 RTD Temperature [°C] R[Ω] Thermistor: Steinhart-Hart Equation - Datasheet / Calibration Constants: a,b,c Curve Fit Error [°C] RTD, R to Temperature - Datasheet/Calibration Constants: a,b,c R[Ω]

10 3. Non-Contact IR Temperature
Infrared Thermopile Sensor: TMP006 Tiny chip-scale package IR sensor (1.6mm x 1.6mm) Pros: extremely small, non-contact measurement, serial output Cons: extremely small, IR emissivity cal. reqd., requires well-laid PCB TMP006 Measures for -40°C to 125°C (-40°F to 257°F) Texas Instruments TMP006 More Info:

11 4. Thermocouples (TC) Any two dissimilar joined metals form TC’s
Seebeck effect voltage developed over entire length of wire Several standard thermocouple types available Pros/Cons: TRange / tiny signal (uV), relative temperature only Products Available for -200°C to 1800°C (-328°F to 3272°F) Non-Linear Temperature/Resistance Curves Up to 10 curve correction terms necessary for extremes Omega Thermistor Products More Info:

12 Approximate Type E TC Voltage Outputs
Hot Gradient No Gradient Cold Gradient -

13 Type E TC Voltage vs ΔTemperature
+/- 1.1C Approx, 0-94C +/- 20.5C Approx 0-1024C

14 Ice Bath Cold Junction Compensation
Provides absolute temperature measurement vs 0C Impractical for many applications to have an ice bath

15 Software Cold Junction Compensation
Remote Thermocouple Analog to Digital Converter Local Temp Sensor Cold Jct T/V Known 1. Measure (TC Voltage) and (Cold Junction Temperature) 2. Use (Cold Jct. Temperature) to calculate (Compensation Voltage) - Use TC curve to calculate cold junction voltage 3. Add (Compensation Voltage) and (TC Voltage) 4. Use TC Curve to calculate temperature at remote TC junction More Info:

16 Integrated Thermocouple Interface
Adafruit Breakout Board for MAX6675 Type K Thermocouple Range: 0 to 1024C, Resolution: 0.25°C SPI Serial Interface Many other ‘simple’ thermocouple interface products available More Info: Example Code:

17 5. Semiconductor Band-Gap
Band-Gap Reference Based Sensor Precision current forced through diode Diode forward voltage based on temperature Voltage measured, amplified Multiple output options: Alarm Logic, Analog, Serial Pros/Cons: Small, Cheap, Easy / T Range, Remote Fragility Products Available for -55°C to 150°C (-67°F to 302°F) Linear Temperature Curves w/ Error Bounds Example SOT-23-6 Microchip Tech. MCP9701A TO-92 Package Microchip Tech. TC1047A SOT23 Package Maxim Integrated Products MAX6626 SOT23-6 Package

18 Tonight’s Sensors MCP9701A TC1047A
Output: 0.4V mV/C Range: -40C to 125C Accuracy: +/- 2C (0-70C) Supply: 6uA Output: 0.4V mV/C Range: -40C to 125C Accuracy: +/- 0.5C (0-70C) Supply: 60uA

19 ADC High Level Concept Analog Domain ADC Digital Domain Input Voltage
Compare Output Count Software Vin = count*(5/1023) Vin = 2.498V

20 How are we going to read the sensors?
To read voltages, use an analog to digital converter! Converts voltage into a numerical ‘count’ Arduino ADC 10 bits of counting (a.k.a. 10 bit resolution/quantization) How many levels? 2^10 = 1024 Highest count? 1023, because 0 takes up one of them! Single-Ended (input is always referenced to Arduino GND) By default: VREF+ = 5V, VREF- = 0V (single ended) VREF- is the voltage at the 0 count VREF+ is the voltage at the full-scale 1023 count All counts 0 and 1023 are essentially equal increments 1023 counts amongst 5V is 5/1023 ~= V/count

21 Let The Hands-On Activities Begin!
Arduino Processing Step 0: Installation / Orientation Step 1: Connecting MCP9701A Step 2: Reading Analog to Serial (Code) Step 3: Converting Analog to Voltage and Temperature (Code) If we have time Step 4 Extra: Formatting Standard String (Code) Step 0: Installation / Orientation Step 1: Drawing Boxes Step 2: Serial Input and Events (String Example) Step 3: Parsing Serial Strings Step 4: Real-Time Bar Graph Step 5: Real-Time Chart Step 6: Logging CSV Files If we have time Step 7 Extra: User Input, Events, and Screenshots Step 8 Extra: Exporting Applications

22 Arduino Orientation 1. Software Installation
2. Essential Hardware Features for Tonight 3. Examples Library Run-Thru 4. Disconnect Arduino for Wiring Step

23 Step 1: Sensor Wiring MCP9701A TC1047A Red = 5V Red = 5V Blue = GND
White = Vout -> Analog A0 Red = 5V Black = GND Blue = Vout -> Analog A0

24 Step 2 Code Reading the Analog to Digital Converter
void setup() { // Setup Serial Port, 9600bps // Implied: 8-N-1: 8 Bit Transfers, No Parity, 1 Stop Bit Serial.begin(9600); } void loop() { // Read Analog Channel 0 int analogValue = analogRead(0); // Print Line via Serial Port Serial.println(analogValue); Initialize Variables and Peripherals Main Loop

25 Step 3 Code Calculating Voltage and Temperature
void loop() { // Read Analog Channel 0 int analogValue = analogRead(0); // Calculating Voltage, VREF=5V,0V; float voltage = analogValue * 5 / ; // Calculating Degrees C = (Volts-0.400) / 19.5mV float deg_C = (voltage ) / ; // Calculating Fahrenheit = 9/5 C + 32 // Note: A common mistake is to use 9/5. 9/5 = 1 (Integer Math) // Use 9.0/5.0 to ensure floating point math ( = 1.8) float deg_F = (9.0/5.0)*deg_C + 32; // Print out voltage, degrees C, and degrees F Serial.print(analogValue); Serial.print (" "); Serial.print (voltage); Serial.print (deg_C); Serial.print (deg_F); Serial.print (" "); // Extra space for easy parsing Serial.print ("\n"); // Send Line Feed (New Line) // Delay 66ms, slowing to rate of about 15Hz updates delay(66); } Main Loop Modification MCP9701A Only For TC1047, use: (voltage-0.5)/0.01;

26 Processing Visualizations
“Just Landed” 3D Visualization of Twittering Travelers

27 Processing Orientation
1. Software Installation 2. Examples Library Run-Thru 3. Arduino Night IV Code!

28 Processing Code Step 1: Drawing Boxes
Step 2: Serial Input and Events (String Example) Step 3: Parsing Serial Strings Step 4: Real-Time Bar Graph Step 5: Real-Time Chart Step 6: Logging CSV Files

29 Questions about the Arduino?

30 Special thanks to Ian Kitajima and Oceanit!

31 Backup Slides

32 Measuring Resistive Sensors
Resistance of Thermistors & RTD’s Ohm’s Law! V=IR -> R=V/I (Resistance = Voltage / Current) Provide V or I excitation to find resistance ? ?

33 Measuring Resistive Sensors
Method 1: Excite with current, measure voltage Difficulty: Precision low-current source required Limited IC’s available (100uA, 200uA are common) Not simple to build precision low-current sources Question: Why not a high current source? ?

34 Measuring Resistive Sensors
Method 2: Excite with voltage, measure current Difficulty: Precision measurements of current required Precision Current Sense Resistor (Rs) Required Low Temperature Coefficient Ideal Smaller current sense resistors are better for linearity ? ? ?

35 Measuring Resistive Sensors
Method 3: Excite with significant voltage divider Difficulty: Measurements of R are very non-linear Precision Voltage Divider Resistor Required Allows biasing of nominal temperature voltage (e.g. 25C) ? ? ?

36 Measuring Resistive Sensors
All excitations induce some self-heating Trade between error and magnitude of signal Low enough excitations induce no noticeable error Excitation can be pulsed on/off to minimize self-heating Leads to transient increase in temp, so keep pulses short Much less predictable offsets than constant excitation Current running through remote measurement leads can drop voltage, resulting in measurement errors Look for 3 wire and 4 wire configurations for more accuracy Look-up tables can be used to speed up calculations Linear approximations between points on an exponential curve Trade between accuracy and computation time


Download ppt "Before we get started... Please  sign the sign up sheet at"

Similar presentations


Ads by Google