Is getting a steady result from Analogin possible?
I decided to try a different route with the temperature sensor and test the resistance between both leads of the sensor using the ANALOGIN command. If there is a better approach to reading the resistance, please let me know! Right now, I cannot get a steady reading and I am wondering what I can do to stabilize it. Currently, the readings are jumping between 57 and 61 within 1 second. At 70°, the resistance of the sensor is roughly 20K. For hotter temps, the resistance goes up. I am wanting to take that value and convert the ANALOGIN results to display the temperature on 3 7 segment displays. I have RC.0 and RC.1 wired like the ANALOGIN example but I changed the 10k to a 100k which seemed to give a wider range and the cap is a .001uf.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
www.iElectronicDesigns.com
·
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
www.iElectronicDesigns.com
·
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
www.iElectronicDesigns.com
·
here is my code :
Why not just use a digital temperature sensor ? Like the DS1620, these return the temperature directly in digital format.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
www.iElectronicDesigns.com
·
Post Edit -- A current regulator/source, which can be made from·components·available from RS (a resistor and an LM317 or a 7805, or a transistor and a couple of resistors), would be beneficial but not essential.· Noise, poor regulation, questionable construction and so on·will result in shakey readings [noparse][[/noparse]G-I-G-O].·
Post Edited (PJ Allen) : 12/21/2008 6:49:12 PM GMT
This may be time consuming but I got around a similar situation by building a cross-reference table. I compared what my test thermometer said to what a lab thermometer said and entered the readings in a table. When reading the temp. it would get the info. from the table and display it. If you gather readings in cold temp, warm temp. and· hot temp. Enter the lab Thermometers reading in a table. When you see how the curve behaves it is fairly easy to fill in the gaps in the missing areas. When it was done it was very reliable. There are mathematical formulas that you can use but this way it is customized to you particular part. Also, I'm not a good programmer to work the formula into a routine. A cross-reference table is the way that worked best for me.
Hope this helps,
Jim W.
For instance http://www.ecircuitcenter.com/Circuits/therm_ckt1/therm_ckt1.htm is a good starting point.
There is also an article here:
http://www.science-logic.net/renneberg-lehmann-ecctd07.pdf
Massimo
--- assuming the reading is returned in a byte, add them up to a word value
>> mov loop_value 256
>> get_reading
>> add your_answer to low_byte
>> if no carry, skip the next line
>> inc high_byte
>> dec loop_value and if not zero jump back up to get_reading
your high_byte is now the average of 256 readings.· no actual division is required.· the low_byte is ignored. your answer will still not be rock-steady: ·my thermometer changes every thirty seconds or so, but never jumps two degrees.· your·display will be very much closer to what you were expecting.
tommy
·