Thermistor to Arduino...

in a digital class of mine we are working on a project of a cooling tower.... which we turn hot water into cold water.... thus comes the name colling tower... :o interesting I know....

We are trying to measure temperatures at several different points and display them to a LCD's..... and control heaters and fan speeds based upon the final temp.... :-?

We are using a 220 ohm resistor as a Voltage divder so that we have a larger range in voltage.... Our thermistor reads 2000 ohms at 4 degrees C and 60 ohms at 90 degrees C..... :-/

How should we go about writing a program that will give us the correct temp readings and make things happen at certain values.... ::slight_smile:

This is probably stating the obvious but you need to find the ratio between resistance and temperature.

I'd look up the details of that thermistor. You may need to include an additional resistor if the load is to much for it.

The maxim temperature ICs arn't expensive if it's a longer term project.

As mentioned above, why not go with the Maxim DS18S20. They are extremely accurate, easy to work with using the Arduino, and you can string up to 64 together on the same pair of wires. They are also very cheap.

They can be waterproofed by being sealed into a piece of copper tubing, if they actually have to go into the water.

Have a look at the datasheet at:

http://datasheets.maxim-ic.com/en/ds/DS18S20.pdf

If you do a search in google you`ll find a load of example arduino code for reading the temperatures from them.

If you know the extreme values of the thermistor and the thermistor resistance is proportional to current then you can use the map function to map the values to the temp values.

Mowcius

I'm not sure about all thermistors, but all the ones I've used are not proportional to the temperature. They usually come with a chart of their resistance over a range of temperatures in 5 deg increments. You could map that chart into your program, but I think it would be easier to use one of the calibrated sensors such as the Maxim mentioned before or the LM335.

If you don't need to know the exact temperature (you just need to know if it's above or below a relative threshold), then a thermistor is a cheap and easy solution when made part of a voltage divider.

Use this equation to figure out the B value of the thermistors. Controlled temperature source required.

Now consider placing this sensor into a conditioning circuit such as a wheatstone bridge. Maximize your sensitivity.

  1. Or: (Easier option)
    Buy a calibrated sensor.

I'd strongly suggest #2, but #1 says pro.

From my reading of the post, this is an assignment where the student is to solve a problem using the provided equipment. Alternative sensors are not an option.


You've apparently been given some important clues... the resistance of the thermistor, at two temperatures.

Using those two reference points, you can derive the temperature/resistance curve of the thermistor, as suggested by FusiveResonance.

In essence you plug the two data points into a polynomial, and then solve the poly, for a term called 'Beta'.


Once you have the Beta parameter, you can convert resistance into temperature, by plugging the resistance into the inverse of the original polynomial.

Is that perfectly clear?

Good.


The problem that remains is how to determine what the freakin resistance is with an Arduino.

The straightforward way is to include the thermistor in a voltage divider circuit, in series with a known constant resistance, and measure using an Analog to Digital conversion.

Apparently the range of interest is from 60 ohms (90 degC) to 2000 ohms (4 degC). This would call for a 1300 ohm series resistor. Pick a resistor that is close to 1300 ohms, which is readily available to you.

(for the purpose of this discussion, we'll pick an even 1000 ohms).

So you connect one terminal of your thermistor to the analog reference voltage. The other is connected to the ADC input. The reference 1K ohm resistor is connected between the ADC input, and ground.

Now, as the thermistor temperature rises, so does the voltage measured by the ADC.

The variable resistance (thermistor) can be derived from the voltage divider equation.

Having determined the resistance, you plug it into the thermistors Beta function to derive the temperature.

Is that perfectly clear?

Is anybody listening?

Does this microphone work (thump thump)?

Does this microphone work (thump thump)?

Nope. Not working. And, quit shouting, would ya?

Once you have the Beta parameter, you can convert resistance into temperature, by plugging the resistance into the inverse of the original polynomial.

To be honest, I read through this and thought, is he being serious?

You are supposedly talking to a beginner and you expect him to understand comments about the beta parameter and inverse polynomial...

Batter it down a bit. You're trying to be too techinical. As you'll learn, one of greatest skills is not knowing all this stuff, it is actually being able to teach others about it :slight_smile:

Mowcius

@mowcius

That's the most enlightened thing I've heard on here. It's a problem which plagues education of any sort, overcomplicating for the sake of complication.

I'm glad someone agrees.

That's the most enlightened thing I've heard on here. It's a problem which plagues education of any sort, overcomplicating for the sake of complication.

I'm glad someone agrees.

Well I know that we were all beginners at some point (some of us not too long ago *cough *cough me) and I know how annoying it can be when someone posts up something and you haven't got a clue, and then they post up explaining and you got no idea about that either. It just makes you feel more stupid! I always try to explain every single thing in my posts so that anyone can understand it!

Mowcius

overcomplicating for the sake of complication.

Being a bit harsh I think it is over complication for the sake of completeness.

The trick is knowing what bits to leave out and what to leave in. I agree that skill is to leave out as much as possible without actually being wrong. Something our National Curriculum in the U.K. fails to do. In an attempt to simplify or dumb down things they actually end up teaching things that are wrong.

For example according to the National Curriculum:- "one day is the length of time it takes the Earth to spin once on it's axis"

The trick is knowing what bits to leave out and what to leave in. I agree that skill is to leave out as much as possible without actually being wrong. Something our National Curriculum in the U.K. fails to do. In an attempt to simplify or dumb down things they actually end up teaching things that are wrong.

Haha, yes totally agree, or they teach you the complicated stuff and people get bad grades because they do not know how to KISS.

For example according to the National Curriculum:- "one day is the length of time it takes the Earth to spin once on it's axis"

Hmm, says a lot :smiley: I bet there are a lot of people who think that it is though...

Sorry I wasn't referring to the original poster, I was speaking in general. I work with a lot of highly technical people daily. Even in my last job some people just feel the need to complicate explanations when you really don't need to. I definitely believe simplifying is an art.

Another interesting perspective could be by over complicating a particular subject you may indeed, convey your own knowledge but your peer may feel they cannot ask for further explanation without humiliation.

It reminds of a meeting I had several years ago in a Microsoft conference room. We were discussing the security of a particular site, my colleague went on a huge tangent of loosely related exploits and networking terminology. He only succeeded in confusing hell out of my PM and entirely throwing me off my train of thought. [edit] In fact, I believe it just panicked the PM

.. Sorry I went on a bit of a tangent there...

I'm curious I'm not from a electronics background and I find myself perusing the web for every new term I come across – where do you guys get your information?

I'm curious I'm not from a electronics background and I find myself perusing the web for every new term I come across – where do you guys get your information?

Well I suppose I could say that I am still in my background! Prime of my youth :smiley:

I use the internet a lot for looking up terms (it annoys me when people ask me things on a forum and I know that a quick search will find them the answer). I read anything technical that is thrown my way, even if I don't understand it, it may give me an insight into something in the future.

Mowcius

lol, now I'm just curious how old you are ;).

Yeah that is a pain though I forgive somewhat here. This forum is ancient! Search function is useless and google search is somewhat obfuscated

lol, now I'm just curious how old you are

Hmm, yes :smiley:

Yeah that is a pain though I forgive somewhat here. This forum is ancient! Search function is useless and google search is somewhat obfuscated

Agreed, but often it is stuff that does just take 5 seconds and a wiki page to find out.

Mowcius

Interesting that out of 16 replies to the question, 5 addressed the question... the rest addressed my response.
Looks like I touched a few nerves here.

Tisk, Tisk. Off Topic and all.

If you have issues with the correctness of my response, then by all means you should bring it up in the thread. I freely admit my fallibility.

But if you just don't like my answer or how I frame it, then you are free to start a new thread for people to complain about me if you wish, though that still does not help the student who asked the original question.


The OP is a student.

The students teacher assigned a lesson.

The student came here for help, specifying the the hardware they have to work with.
Answers that suggest other hardware, while well meaning, are not helpful... the student has to use the given materials.

I made mention to CLUES.
The teacher gave clues. Indeed, as I tried to point out, all the clues you need.
A previous responder gave more clues.
And then I gave more clues... and a framework for research.

Given all these clues , a properly motivated student could arrive at the answer 'under their own steam' using the most simple algebra.

And having put in the effort, to research and understand the physics, and the math, they will learned something valuable, instead of just regurgitating an answer they got from... somewhere.


If you give the student the complete answer, with source code and schematics and parts lists, then, yes you have answered their question, and solved their immediate problem.

BUT YOU HAVE NOT HELPED THE STUDENT UNDERSTAND ANYTHING!

If your goal is to help others learn, then you provide guidance and references.

If your goal is only to show how smart you are, then just give the answer already so we can all get on with our business.

BUT YOU HAVE NOT HELPED THE STUDENT UNDERSTAND ANYTHING!

I disagree, while when I wanted to do something it was a personal project and not an assignment, I still learnt from the bits of code that people gave me. Links to pages on parts of the code are also infinitely helpful and help the person to understand the code in different contexts and provide further reading.

and even with that explanation, your comments would not have helped like that. Telling someone about:

Once you have the Beta parameter, you can convert resistance into temperature, by plugging the resistance into the inverse of the original polynomial.

wouldn't help them.

You need to stop using complicated sentences, saying:

Using those two reference points, you can derive the temperature/resistance curve of the thermistor, as suggested by FusiveResonance.

could be simplified into:

by using the temperatures and resistances that you have been given, you can draw a graph estimating the resistance for other temperatures.

Much simpler to understand if you are new to a topic like that.

In essence you plug the two data points into a polynomial, and then solve the poly, for a term called 'Beta'.

Completely unnecessary information becuase they are not going to learn anything from that

for the purpose of this discussion, we'll pick an even 1000 ohms

It is not now a discussion as the person you are talking to is completely confused.

Having determined the resistance, you plug it into the thermistors Beta function to derive the temperature

Beta function, beta parameter, do they even have a smidget of a clue about what this beta thingy is?

I am just suggesting that you dumb down your comments, start off with simple info to fins out what they know and then if you think they will understand freakin' beta functions then tell them in a later comment.

Is that perfectly clear?

Is anybody listening?

Listening but not understanding :o

Mowcius

Lets see if maybe we can help this person (although the OP has not replied at all)

Our thermistor reads 2000 ohms at 4 degrees C and 60 ohms at 90 degrees C.....

How should we go about writing a program that will give us the correct temp readings and make things happen at certain values

Two data points doesn't give much of a curve to apply to other readings, so we'll have to assume the resistance changes linearly with temperature. Build a voltage divider with the 220 ohm resistor to gnd and the thermistor to +5V, and the other lead of both tied to an analog pin on your Arduino. You'll get roughly (I'm estimating) 0.5V at 4 deg C and 3.33V at 90 deg C. The analog pins read 0 at 0V and 1023 at +5V, so this will show up as roughly 102 and 682. Given those two points, you can calculate the temperature reading at other resistances. Read each sensor in your code and store that info to variables. Then run your calculations.

Displaying that information is a matter of using the correct library for the LCD and sending your reading to it (I'm not experienced yet with LCDs so this is all I can say about it).

Fans can be controlled through the PWM pins and a heater can be controlled via digital pin (you could use PWM, but it's not really necessary). You will need some additional circuitry to power the fans and heaters and the Arduino will control that for you.

Doing things at certain temps is a matter of defining a variable and comparing your readings to that in an IF statement. If it matches or is beyond the value, then act upon it. You can compare the readings to each other and/or to other variables you have specified.