#### Guest3123

Joined Oct 28, 2014
404
Alright, so I wanna get my hands dirty with Arduino.

I wanted to mess with Thermistor's as my first project. Just reading tempature from a Thermistor.

I have a product from Mouser Electronics, that I want to use as my thermistor.

That's this thermistor : GA50K6A1A

I even looked at, and have the Datasheet.

It's a nice one, very accurate, and not too expensive.

So, I see that it has a chart how the resistances relate to the temperatures. That's great ! Fantastic.

So.. 50,000 Ω @ 25°C

(°C x 1.8) + 32 = °F
25 x 1.8 = 45 + 32 = 77°F
Great.

Alright, here's the part where I need help.
50,000Ω = 25°C
47,724Ω = 26°C

50,000 - 47,724 = 2,276Ω Difference, when tempature rises 1°C

Again.. According to the chart.
26°C = 47,724Ω
27°C = 45,564Ω

47,724 - 45,564 = 2160 Difference.

That sure looks different than 2,276.

So what gives?

Why the heck doesn't it stay the same for each time the tempature changes 1°C ?

I looked online, and there is a formula, but it's EXTREMELY CONFUSING. Because I simply don't understand.

Also, my last question, why do I need a resistor for the thermistor, if the thermistor is already a resistor?

#### tracecom

Joined Apr 16, 2010
3,944
Thermistors are not linear devices, i.e., their resistance does not change by a constant value as the temperature changes (as you have already discovered.)

You can't measure resistance directly with a microcontroller; instead, you must measure voltage, and that is done with a voltage divider. In this case, the voltage divider consists of the thermistor connected to one side of a known voltage and the resistor connected to the other polarity of the voltage. Then, the thermistor is connected to the resistor, and the voltage at that junction will be proportional to the ratio of the resistances of the thermistor and the resistor. You connect that point to an input on your mcu, read the voltage, and convert that voltage to temperature.

Clear as mud? Right?

Last edited:
• djsfantasi

#### be80be

Joined Jul 5, 2008
2,045
Resistance changes as it get's warmer. That makes math a lot harder

#### OBW0549

Joined Mar 2, 2015
3,441
So what gives? Why the heck doesn't it stay the same for each time the tempature changes 1°C ?
Thermistors are non-linear devices. The resistance change per °C temperature change is NOT constant across temperature: it's higher at cold than it is at hot.

That's why we don't use thermistors very much for temperature measurement; although they're cheap, they can be very tricky to use.

#### shteii01

Joined Feb 19, 2010
4,644
Because the universe and everything in it is not perfect.

• Sinus23

#### be80be

Joined Jul 5, 2008
2,045
You can use a lookup table to make it easy to use one.

#### shteii01

Joined Feb 19, 2010
4,644

#### JohnInTX

Joined Jun 26, 2012
4,113
A couple of additions to the good points presented here.
Besides the resistor being necessary to form a voltage divider, it frequently is necessary to prevent thermal runaway of the thermistor. Consider the case where the thermistor is a major part of the (or the only) resistance in the circuit. It heats up a bit due to the current flowing through its resistance. The resistance drops a bit because the thermister is warmer. A lower total resistance means more current which means that the thermistor gets warmer.. and so on. Back in the day, I had one melt right off its leads... yeah, I'm kind of stupid sometimes..
The real-world not-stupid effect of this self-heating is that when you pass any current through the thermistor, it will heat and throw the readings off a tiny bit. The usual fix for this is to only apply voltage to the thermistor network when you are actually doing the ADC conversion. The conversion time is fast compared to how often you need to do it so its mostly OFF and self-heating effects are minimized.

As the others have indicated, the thermistor output is very non-linear. If you are using a microcontroller, I'd use a lookup table (there's one in your datasheet) with as many points as practicable and use linear interpolation to fill in the gaps. In my personal experience with both thermistors and RTDs, the table/interpolation approach is usually better doing the kind of math required for linearization in real-time. In the stuff I've done, we do the math with C on a PC and output the table for the uC. In your application, a fixed resistor and the thermistor form the voltage divider. The ADC will read the voltage and come up with a number. That number will follow the general curve described by the datasheet table. Some arithmetic will be necessary to convert the raw ADC number to a usable temperature.

There's no reason that it can't work. Just be glad you have a uC to do the math. There was a time when all of this was done with op-amps with non-linear elements in feedback loops *shudder* - or punting and silk-screening a non-linear setpoint scale on the panel and calling it done.

Good luck.

Last edited:

#### tracecom

Joined Apr 16, 2010
3,944
I don't know a lot about Arduinos, but I suspect there is already a "script" (probably several) on the web that will take care of the ADC and the math, and output the temperature to a display. By virtue of your questions in post 1 of this thread, I don't think you will be satisfied for very long with Arduinos because they do very little to help a hobbyist understand electronics.

• panic mode

#### panic mode

Joined Oct 10, 2011
1,836
so true... but hope he does not give up on a nice little curve....

• Guest3123

#### dannyf

Joined Sep 13, 2015
2,197
if the thermistor is already a resistor?
Yeah. But how do you measure its resistance conveniently?

#### panic mode

Joined Oct 10, 2011
1,836

#### dannyf

Joined Sep 13, 2015
2,197
without heating it
it is a 50K resistor.

How much voltage do you have to apply to it to get a meaningful temperature rise out of it?

#### Guest3123

Joined Oct 28, 2014
404
I don't know a lot about Arduinos, but I suspect there is already a "script" (probably several) on the web that will take care of the ADC and the math, and output the temperature to a display. By virtue of your questions in post 1 of this thread, I don't think you will be satisfied for very long with Arduinos because they do very little to help a hobbyist understand electronics.
I found this video.. Could you help? It has nothing to do with Arduino.

Looking online is kinda cheating, and I honestly wouldn't know what I was looking at, because I honestly don't understand.

So I want to learn it from scratch.

My main goal is to understand Electronics. My goal "right now" has nothing to do with Arduino. I'm requesting help with electronics please.
I know a little bit about electronics, and try everyday to learn a little more about the subject.

I think I understand a little bit about it.

Thermistor is 50,000Ω (Rt)
(Vdd) is 5vdc.

First Equation. Solve Vt.

Alright, so the first equation is

Vt = R / (R + Rt) * Vdd

Here it goes.

50,000R + 50,000Rt = 100,000 * 5Vdd = 500,000
500,000 / 50,000 = 10, Vt = 10

********************************************************

* Solve Rt *
Rt = R * ((Vdd - Vt) / Vt)

5vdd - 10Vt = 5
5 / 5Vt = 1
50,000 * 1 = 50,000, Rt = 50,000

Good so far?

I messed up, sorry, I fixed it.

Last edited:

#### shteii01

Joined Feb 19, 2010
4,644
Thermistor is 50,000Ω (Rt)
(Vdd) is 5vdc.

First Equation. Solve Vt.

Alright, so the first equation is

Vt = R / (R + Rt) * Vdd

Here it goes.

50,000R + 50,000Rt = 100,000 * 5Vdd = 500,000
500,000 / 50,000 = 10, Vt = 10

********************************************************

* Solve Rt *
Rt = R * ((Vdd - Vt) / Vt)

5vdd - 10Vt = 5
5 / 5Vt = 1
50,000 * 1 = 50,000, Rt = 50,000

Good so far?

I messed up, sorry, I fixed it.
What is 50,000R?
What is 50,000Rt?
What is the value of R?

I have never encountered a unit of measurement that is represented by R.

#### Sensacell

Joined Jun 19, 2012
2,568
Let's look at the overall problem-

1) You need to convert a resistance to a voltage.
The ADC cannot measure resistance directly.

2) You need to remove the offset voltage.
The ADC has a limited range, you want the voltage changes due to temperature to make use of the ADC's input range as much as possible.
You don't want the basic resistance of the device creating an offset voltage that is bigger than the changes due to temperature.

3) You need to scale the voltage.
Ok, so we removed the offset, now we need to amplify the voltage to cover the ADC input range 0-5 or 0-3.3V etc.

4) Now you have a voltage change that is proportional to the temperature, but now you need to linearize and calibrate it.

As you can see, you have picked a deceptively complicated "simple" project. This is why those digital temperature sensing chips are so popular, they eliminate all the analog headaches of dealing with a thermistor, thermocouple or RTD.

#### Guest3123

Joined Oct 28, 2014
404
resistance to a voltage
Let's look at the overall problem-

1) You need to convert a resistance to a voltage.
The ADC cannot measure resistance directly.

2) You need to remove the offset voltage.
The ADC has a limited range, you want the voltage changes due to temperature to make use of the ADC's input range as much as possible.
You don't want the basic resistance of the device creating an offset voltage that is bigger than the changes due to temperature.

3) You need to scale the voltage.
Ok, so we removed the offset, now we need to amplify the voltage to cover the ADC input range 0-5 or 0-3.3V etc.

4) Now you have a voltage change that is proportional to the temperature, but now you need to linearize and calibrate it.

As you can see, you have picked a deceptively complicated "simple" project. This is why those digital temperature sensing chips are so popular, they eliminate all the analog headaches of dealing with a thermistor, thermocouple or RTD.

Alright, so what electronic component should I use, instead of a thermistor?

#### shteii01

Joined Feb 19, 2010
4,644
Alright, so what electronic component should I use, instead of a thermistor?
See post #7.

#### tracecom

Joined Apr 16, 2010
3,944
Have a look at DS18B20 and LM34. LM34 is very easy to understand and to use.

• Guest3123