This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:learn:sensors:thermistor.html [2011/06/07 19:21] daigo |
tutorials:learn:sensors:thermistor.html [2016/01/28 18:05] (current) |
||
---|---|---|---|
Line 20: | Line 20: | ||
*They work at any voltage (digital sensors require 3 or 5V logic). | *They work at any voltage (digital sensors require 3 or 5V logic). | ||
*Compared to a thermocouple, they don't require an amplifier to read the minute voltages - you can use any microcontroller to read a thermistor. | *Compared to a thermocouple, they don't require an amplifier to read the minute voltages - you can use any microcontroller to read a thermistor. | ||
- | *They can also be incredibly accurate for the price. For example, the 10K 1% thermistor in the shop is good for measuring with ±0.1°C accuracy! (Assuming you have an accurate enough analog converter) | + | *They can also be incredibly accurate for the price. For example, the 10K 1% thermistor in the shop is good for measuring with ±0.25°C accuracy! (Assuming you have an accurate enough analog converter) |
*They are difficult to break or damage - they are much simpler and more reliable | *They are difficult to break or damage - they are much simpler and more reliable | ||
Line 35: | Line 35: | ||
<class center> | <class center> | ||
- | [[http://www.adafruit.com/products/372|You can pick up a 10K 1% waterproof thermistor in the Adafruit shop]] | + | **[[http://www.adafruit.com/products/372|You can pick up a 10K 1% waterproof thermistor in the Adafruit shop]]** |
</class> | </class> | ||
Line 42: | Line 42: | ||
[[http://www.adafruit.com/products/372|Here are technical details for the thermistor in our shop]] | [[http://www.adafruit.com/products/372|Here are technical details for the thermistor in our shop]] | ||
- | * Resistance at 25°C: 10K ±1% | + | * **Resistance at 25°C:** 10K ±1% |
- | * B25/50: 3950 ±1% | + | * **B25/50:** 3950 ±1% |
- | * Thermal time constant <= 15 seconds | + | * **Thermal time constant** <= 15 seconds |
- | * Thermistor temperature range -55°C to 125°C | + | * **Thermistor temperature range** -55°C to 125°C |
- | * Wire temperature range -55°C to 105°C | + | * **Wire temperature range** -55°C to 105°C |
- | * 28 AWG PVC Wire | + | * **28 AWG PVC Wire** |
- | * Diameter: 3.5mm/0.13in | + | * **Diameter: 3.5mm/0.13in** |
- | * Length: 18in/45cm | + | * **Length: 18in/45cm** |
- | * Resistance/Temperature table | + | * [[http://www.adafruit.com/datasheets/103_3950_lookuptable.pdf|Resistance/Temperature table]] |
Note that even though the thermistor can go up to 125°C the cable itself maxes out at 105°C so this thermistor is not good for measuring very very hot liquids | Note that even though the thermistor can go up to 125°C the cable itself maxes out at 105°C so this thermistor is not good for measuring very very hot liquids | ||
Line 84: | Line 84: | ||
Say the fixed resistor is **10K** and the variable resistor is called **R** - the voltage output (**Vo**) is: | Say the fixed resistor is **10K** and the variable resistor is called **R** - the voltage output (**Vo**) is: | ||
+ | <class center> | ||
**Vo = R / (R + 10K) * Vcc** | **Vo = R / (R + 10K) * Vcc** | ||
+ | </class> | ||
Line 93: | Line 94: | ||
Now we want to connect it up to a microcontroller. Remember that when you measure a voltage (**Vi**) into an Arduino ADC, you'll get a number. | Now we want to connect it up to a microcontroller. Remember that when you measure a voltage (**Vi**) into an Arduino ADC, you'll get a number. | ||
+ | <class center> | ||
**ADC value = Vi * 1023 / Vcc ** | **ADC value = Vi * 1023 / Vcc ** | ||
+ | </class> | ||
So now we combine the two (**Vo** = **Vi**) and get: | So now we combine the two (**Vo** = **Vi**) and get: | ||
+ | <class center> | ||
ADC value = ** R / (R + 10K) * Vcc * 1023 / Vcc** | ADC value = ** R / (R + 10K) * Vcc * 1023 / Vcc** | ||
+ | </class> | ||
What is nice is that if you notice, the Vcc value cancels out! | What is nice is that if you notice, the Vcc value cancels out! | ||
+ | <class center> | ||
ADC value = ** R / (R + 10K) * 1023** | ADC value = ** R / (R + 10K) * 1023** | ||
+ | </class> | ||
It doesn't matter what voltage you're running under. Handy! | It doesn't matter what voltage you're running under. Handy! | ||
Finally, what we really want to do is get that **R** (the unknown resistance). So we do a little math to move the **R** to one side: | Finally, what we really want to do is get that **R** (the unknown resistance). So we do a little math to move the **R** to one side: | ||
+ | <class center> | ||
**R = 10K / (1023/ADC - 1)** | **R = 10K / (1023/ADC - 1)** | ||
+ | </class> | ||
Great, lets try it out. Connect up the thermistor as shown: | Great, lets try it out. Connect up the thermistor as shown: | ||