Thermistor Temperature

Hello All,

I wanted to know how to take the analog read from a thermistor and turn it into degrees Celsius.

Additional Details if interested:
I make little plastic extruders and would like to have better control of temperature.
I am using a NTC3950 Thermistor with a 1K ohm pull down resistor.
The heater is 12V 40W controlled with PWM digitalOut to a TIP120.

Currently, I measure the hot end temperature with an additional device and see what the analog read from the thermistor is when at the desired temp. I keep the temperature within a domain by reducing the heat when the analog read is larger than the domain's ceiling and switch back to high when the read is less than the domain's floor.

I was hoping there would be a way to get the Celsius value.
I am open to purchasing other thermistors if it helps.

Thanks in advance for the help!
Kind regards,

  • Jake

This looks like it might be relevant: Arduino Playground - Thermistor2

Hi,
Don't bother their not very accrate anyway!! for a small sum you can get a DS18b20 sensor almost as small in a plastic transistor case. accreate to 0.06 of a degree. Look it up on line...

Regards

Mel.

.06 degree? What are you smoking?

It is accurate to +/- 2 degrees C from -55 to +125. Since this is a plastic extruder we can assume that it is above the 85 C +/- 0.5 degree range.

It is possible that the temperature required is even above the 125 degree limit.

KeithRB:
.06 degree? What are you smoking?

It is accurate to +/- 2 degrees C from -55 to +125. Since this is a plastic extruder we can assume that it is above the 85 C +/- 0.5 degree range.

It is possible that the temperature required is even above the 125 degree limit.

The DS18b20 locks up at 125C and has to be powered off to reset.

Paul

Hi,
Welcome to the forum.

What is your application?
There are many other temperature sensors that are more accurate and easier to program and setup.

Tom... :slight_smile:

Hello All,

Sorry for being late to the party. I didn’t receive notifications that anyone was replying to my initial questions.

@MorganS - I did see the post from your link. Using their equations did not seem to give consistent results. I figured that it may be a problem with the accuracy of my thermisor or maybe how I had it wired.

@Cactusface - I am open to using another thermistor, but it has to fit in the hole of a typical extruder’s hot end and be able to measure temperatures up to 230 c. I could make my own hot end to hold a different shaped thermistor, but I want to be sure that it will give a reliable reading before I go that route.

@TomGeorge - I am making a small plastic extruder. I may be making a much larger custom extruder soon, so I am prototyping small scale first.

I am attaching a sketch of the schematic. It roughly shows how I have the thermistor wired along with the heater and stepper… I am not very experienced in electronics so please forgive if my schematic is not drawn according to conventions.

I have noticed that my thermistor’s analog reading seems to fluctuate quite a bit. I am not sure, but it seems to change based on how much power my heater is allowed to pull (PWM to TIP120). I should have sufficient amps for everything, so I don’t know why I would have a drop in the analog reading when the heater is set to HIGH.

Thanks all for the help! I will watch this forum closer and figure out how to get notifications setup properly.

Kind regards,
-Jake

SchematicSketch.pdf (89.8 KB)

Please post the code, using code tags.

Your schematic is missing a base resistor on the TIP120 (minimum 220 Ohms, suggest 1K), and does not state the value of the resistor associated with the thermistor. Normally you would use a 10K resistor with a 10K (nominal) thermistor.

I don't know why I would have a drop in the analog reading when the heater is set to HIGH

Note that there are two ways of wiring the thermistor/resistor voltage divider. The voltage divider output versus temperature and the code is different for each.

@jreminton - I did not realize I needed a resistor to the base of the TIP120. The resistor is missing in my wiring as well as the schematic. I’ll put a 1K to base. Was I basically shorting out my arduino when my output was HIGH?

I did have a 10K resistor for the thermistor before, but I changed it to a 1K resistor. When I had the 10K, the analog read would reach 1023 before my heater was hot enough for extrusion. I tried putting a 1K resistor in instead to bring my values down so I could measure higher temperature. This has not really been tested, and I may be assuming incorrectly.

I have attached the code relating to the heater control. When I was trying the temperature equation from https://playground.arduino.cc/ComponentLib/Thermistor2, I was using the 10K resistor. I couldn’t ever get the right temperature reading.

I later started just printing out the resistance value and measuring the temperature with an outside device and noting what resistance value was at the desired temp and setting these values as the Floor and Ceiling.

Kind regards,
-Jake

NoTemp.ino (1.69 KB)

WithTemp.ino (2.37 KB)

While it is probably a common method in the 3D printer world, using the TIP120 darlington transistor to control a heater is a really lousy component choice.

A proper logic level N-channel power mosfet would have lower losses and allow for a faster temperature rise and higher upper temperature limit since it would add ~10% more watts in a typical 40 watt heater - due to the lower voltage drop across the device. All for probably the same cost. As JR already mentioned, regardless of the device being used, transistor or FET, you still need a resistor in series with the Arduino PWM output. This prevents the output pin from exceeding its maximum current rating.

The diode across the collector to emitter of the heater transistor is unnecessary since heaters are considered non-inductive loads.

@arv_fred - Thank you for the advice. I was only using the TIP120 because of ease of access and available documentation. I may have seen someone using it for this kind of application, but I can't remember so I have not good excuse. Haha

Is there a N-channel power mosfet you would recommend?

Thank you for the help.

I'll take out the diode too. I put them in when I'm not sure...

The ratings are not critical. The typical things to look for:

  • Device must be “Logic Level”. These turn fully on with 2.5 volts or more on the gate
  • VDSS should >= 40 volts
  • RDS(on) should be <= 0.05 ohms
    FQP30N06L at Sparkfun for $0.95

5EA IRLZ44N on eBay for $1.57

At 230C you could well be better off with a thermocouple - shields such as the MAX6675 work well.

Allan

The NTC3950 is used for 3D printing and can tolerate 260 C. It is probably (please check) a 100K thermistor and normally would be used with a 100K pullup/pulldown (depending on the code).

For reference material see http://www.murata.com/~/media/webrenewal/support/library/catalog/products/thermistor/ntc/r44e.ashx

This site suggests using a 4.7K pullup and a beta value of 3990K.

See this handy online thermistor calibration calculator: http://www.thinksrs.com/downloads/programs/Therm%20Calc/NTCCalibrator/NTCcalculator.htm

Google for others.

jremington:
It is probably (please check) a 100K thermistor and normally would be used with a 100K pullup/pulldown (depending on the code).

Only if used near 25C.
Highest resolution of the A/D is when the fixed R is about the same as the thermistor R at the temp of interrest.
A 100k thermistor is about 10k@82C.
Leo..

Only if used near 25C.

Thermistors are usually characterized by their resistance at 25C.

I’m surprised that you felt the need to post this.

Sorry, not trying to correct you.
Just explaining in general why a much lower value fixed R is used when thermistors are used at high temps.
Leo..

Yes, the point about the associated resistor is well understood.

At the moment, we don't know what thermistor/resistor combination the OP is using, and the OP can't even measure the temperature. Let's help him/her get that fixed first.

The range freezing/room temp/boiling water is a good place to start for calibration, and for that one ideally would use an associated resistor that is about equal to the 25C resistance of the thermistor.