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.
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...
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.
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.
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 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).
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..
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.