NTC thermistor with AD converter
johnproko
Posts: 121
Hey everyone merry Christmas and happy new year.
I am trying to use a thermistor as a way to read temperature yet rctime only get the value of discharge and even though i have tried a lot of calibration, it is not linear and i never get the same value.
I want to ask how do you read temperature. I have read about the lm35 sensor which requires an ad converter. Has anyone used it with a propeller in C language?
could s/he post a wiring picture plus a simple code?
thank you very much.
I am trying to use a thermistor as a way to read temperature yet rctime only get the value of discharge and even though i have tried a lot of calibration, it is not linear and i never get the same value.
I want to ask how do you read temperature. I have read about the lm35 sensor which requires an ad converter. Has anyone used it with a propeller in C language?
could s/he post a wiring picture plus a simple code?
thank you very much.
Comments
NTC thermistors are inherently non-linear, but you should get similar readings at a fixed temperature.
A disti like Digikey shows 3,440 items under Temperature Sensors, Transducers
- cheapest are Linear ratio metric ones sub 20c/k, and there is a NXP LM75BD,112 which is i2c interface, 26c/1k
Temperature Sensors choice often comes down to package, and final use.
Erlend
I am trying to get some values yet it never gets the same number.
I have an arduino to guide me and a classic thermometer.
For the ad converter what must be done? connections and some basic principles.
Google find this :
http://www.sensorsmag.com/temperature/thermistors-accurate-temperature-sensors-part-2-application-11278
Seems you can use LTSpice to model thermistors.
That sounds a more fundamental problem.
You need to get stable readings, before you worry about curve fitting.
Exactly how much do the numbers vary, and if you swap the thermistor for the same value resistor, is it more stable ?
How someones uses thermistors without an adc?
There must be a way
I know that it can be done since the spectrometers I work on use thermistors in an rc circuit to control the temperature. One requirement is to couple the thermistor with a capacitance value that has a charge/discharge time that can be measured with some precision. What is the resistance range of your thermistor, and what is the capacitance value you are using with it?
I thought you meant a fixed thermistor at a fixed temperature, in a single test system, gave unstable readings ?
Unit to unit variation, is a different problem.
rctime is a ADC, just a very simple one.
I have working "C" code for NTC thermistors, used with the ADS1015 12-bit ADC 4 channel with programmable gain amplifier in full working order, if you are interested. Adafruit has a breakout board for this ADC, which can be found here: https://www.adafruit.com/product/1083
The working code should be found here, but if it doesn't work for you, then I have a version locally that may have some changes:
SUCCESS: Converting mbed C++ to C to Propeller GCC.... BUG-B-GONE
http://forums.parallax.com/discussion/160271/success-converting-mbed-c-to-c-to-propeller-gcc-bug-b-gone/p1
Then in addition to that, here is a discussion pertaining to getting a simulation of an NTC thermistor working with the ADS1015:
Configuring A Programmable Gain Amplifier On An ADC
http://forums.parallax.com/discussion/160328/configuring-a-programmable-gain-amplifier-on-an-adc/p1
This all applies to code written in C for SimpleIDE.
the thermistor is 10kohm and the capacitor is the brown one 0.1μF (https://www.parallax.com/product/751-00012)
The code is simple as well:
high(8);
pause(1);
int x = rctime(8, 1);
print("%f ", x);
Howdy, here you go, use an LM34 for Fahrenheit or an LM35 for Celsius, C code below.
yet I have the propeller that has no build in a/d.
Thus my question is how to connect an external, and the code needed from there onwards.
I need a C language program and the schematic of what goes where...
Up to now I have an arduino checking the thermistor and sending a message to the propeller if the temperature is in certain range.
Yet this is not efficient as I have to program 2 different MCUs and still cannot see what the temperature is.
Any ideas on how to connect the A/D and what to write to read the thermistor?
Either that or just use a cheap 1-wire or I2C sensor, no A/D required and the code is simple. I have also used the DHT22 humidity and temperature sensors, you only need a single wire.
Mostly, that is config of the Counters, and then reading at some update rate.
Counter-ADC runs continually in the background, and the Prop reads the change in counts/time elapsed.
One you have Sigma-Delta ADC, you can simply skew with your thermister.
A benefit of this is the CAP tolerance / drift/ hysteresis is removed from the mix, and you measure purely the ratio of two resistors.
eg a Feedback resistor of half the thermister will have a balance point of 75% counting.
The OP has not said why the preference for thermister over Digital sensor, but there are some special packages, or extremes in temperature, that come only in NTC. Might be one of those applications.
Lots of alternatives to a thermistor, and most of them lower in cost and complexity than adding an adc (and probably op amp) to the circuit. I know darn well that an rc circuit works with a polystyrene/polypropylene capacitor.
If it needs to be mounted away from the propeller a 555 timer will produce nice pulses that can be measured, but again, accuracy requires using poly or similar quality capacitors.
the rctime measures the resistance in a resistor. Thus the change might represent some change before it actually change the value. For example at rctime = 90 arduino is showing a range from 23.05 to 23.30 C. might not sound much yet as temperature rises the range widens and the variation increases.
I have tried different caps, changed the thermistor etc. yet the fact remains that i need some accuracy, not deviating 2 degrees at 35C.
I Have the propeller without A/D convertion, the first propeller that came out. I need a way to read the value using analog, probably, or if someone else has some equation from a previous project.
My last solution is to make the arduino the temp master and propeller the slave yet I lose all the point in multitasking.
Seriously though, I had checked the thread and there is no circuit and just an equation but the rctime function itself is not shown. I did see mention of a "brown capacitor" and a link which seems to indicate that this is a decoupling capacitor, the exact type you want to avoid. However you say the Arduino works with the same circuit? Back to the rctime function then, do you know what it is or is it a built-in function that you are using from....? There have been so many opportunities for you to provide actual real details and get some real answers, hopefully this may be realized this time.
BTW, I have no trouble getting reliable readings with an RC network on the Prop.
I will try some rc stuff with different caps and post the results. I am guessing you are using some kind of C etc but will await clarification.
Can you give the
* Thermistor Values at expected temperature span ?
* Required LSB of reading in bits or Degrees ?
* How often is an update required ?
* What is claimed tolerance of these thermistors ?
* what are the cable lengths involved ?
* how many sensors do you need to read ?
* will these be individually calibrated ?
Simplest circuits of NTC + CAP, will include CAP tolerance and drift in the error sources.
A slightly more complex bridge design of Rref+NTC+CAP is ratiometric, and will have the CAP tolerance removed.
If the cable lengths are significant, you may need to buffer the NTC and add mains filtering, as the signal is still analog.
dont care about the length, once calibrated i will just add the difference. Nevertheless the cable is 45cm long.
It is a 10k thermistor, will post the datasheet below.
I want to read 3 thermistors, 2 using 45cm wire one with a 15cm. an update every 30sec is ok more than that is problematic since im building an egg incubator the size of a box 100cmX100cmX60cm.
Another solution is to monitor with an arduino the range i need 36.1C to 38.8C, yet since im building a temperature sensor I would like to have a code ready to other to come projects.
http://cdn.sparkfun.com/datasheets/Sensors/Temp/ntcle100.pdf
Actually I came across a LMT01LPGM which is even easier with a -50 to 150'C range in a 2-pin TO92 pack that outputs nice easy pulses that can be simply counted, around 1400 pulses at 88kHz for around 33'C. They are around $1.50, I think I might even use these in my new design.
That is a nice looking device, not super-cheap, but very easy to use and quite good calibrate specs.
Could you post the 1 wire sensor and how to connect?
That's all in the data sheet Peter linked to.
In the Prop case, a NPN transistor and 2 bias resistors is a minimal circuit, but I would add a series R (~1k) to each wire leaving the board for ESD and slip protection.
In TI's circuit, a briefly shorted sensor would likely take out the transistor.
Code to count is just a counter config setup, but you will need to sense the gaps in the bursts, to know when the count is stable.
Maybe polling counter somewhere between 25us to 10ms until two-the-same are found.