2
\$\begingroup\$

I just recently purchased a KY028 Temperature Sensor located HERE. I was having trouble hooking this sensor up so I snipped off the thermistor and shoved it in a breadboard. I know it sounds tacky but here is the picture of my circuit I have going now.

IMAGE1 IMAGE3

I have the +5V pin on my arduino connected to the thermistor then the 10K resistor connected to the negative side of the thermistor then going to ground.

I have researched several sites on how to convert the reading i'm getting into kelvins and/or C and/or F but i'm not getting a correct value as a final result.

This website HERE. It's providing me with an equation to solve for the thermistors resistance which is as follows....

IMAGE3

It then tells me to plug this value into Steinhart HART equation as follows....

IMAGE4

The problem is i'm getting a negative value for the first equation. My Vout is at 4.983 Volts. When I plugged this into the first equation to find the thermistor resistance I get a negative value which is -5.950435k ohms.

I can't plugged this value into Steinharts equation because i can't take the natural log of a negative number. So this is the first problem i'm having. Plus A, B and C are constants which i'm unsure if I should use the standard values they have on that link I attached or find them for my specific thermistor. However, i don't know how to do that so i'm using the values they provide.

Next problem is I don't see where I'm suppose to use the reading i'm getting from the analog input pin i have connected to my thermistor which happens to read a value of 512. I'm not using this value anywhere in these above equations so as a result i'm completely lost at what to do.

I have found several sites containing programs already made like this one HERE. HOWEVER, i'm not interested in copying their code as I would have no idea what's happening. I tried to understand their code for the conversion part but it's not the same as the equations i provided above. The person even says he used that same link to do the conversions but he must of manipulated the equations to do the conversion because i'm not following his code. What I would like is an explanation of how I can go about converting this value without using huge lookup tables as a cheat or copying code. I'm wanting to replicate my own result but i just can't understand what I need to do. Can someone put me back on track here.

\$\endgroup\$
2
  • \$\begingroup\$ my resistor value isn't quite 10k ohms. I measured it and it reads 9.94k ohms \$\endgroup\$
    – Shane Yost
    Mar 18, 2014 at 23:29
  • 2
    \$\begingroup\$ That equation looks like it's for the provided circuit that uses a 2.5V reference to power the thermistor. But you might be better replacing the photos with a circuit and include the code you're using, if you get a stable value of 512 it sounds a little suspicious and you may have a software problem. \$\endgroup\$
    – PeterJ
    Mar 18, 2014 at 23:39

2 Answers 2

2
\$\begingroup\$

I believe your problem is that you changed the circuit from the one provided with the thermistor but did not alter the equation. The circuit on the website shows that the thermistor is driven from a 2000 mv (2 volts) source that is adjusted by a pot on the board. That accounts for the 2V factor in the equation relating output voltage to thermistor resistance. You are now driving the thermistor with 5 volts so the equation must be modified to change the 2V to 5V. You cannot get a Vout of more then 2 volts from the original board. That is why you are calculating a negative resistance.

\$\endgroup\$
2
\$\begingroup\$

The website you refer to, uses the value of 2v because it feeds the divider with 2v

enter image description here

You are feeding 5v to the divider so the equation should be

$$ R=10k \times (\frac{5v}{V_{out}}-1) $$

I assume that you are using a Vref of 5v in Arduino so you can replace the 5v with 1023 and then divide with the ADC result in the equation

$$ R=10k \times (\frac{1023}{ADC}-1) $$

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.