> -----Original Message----- > From: llile@SALTONUSA.COM [SMTP:llile@SALTONUSA.COM] > Sent: Friday, November 15, 2002 8:55 PM > To: PICLIST@mitvma.mit.edu > Subject: Re: [EE]:Pressure sensor confusion > > That's one way to deal with it. > > A typical problem for me is interpolating thermistor data. The thermistor > curve comes in chart form from the manufacturer, in very un-handy > increments. It's quite a complex curve, and I think curve fitting it > would be a long involved task (unless Excel does this automatically > somehow? ) Linear curve fitting would be a cinch. The only way I know > how to curve fit a nonlinear is, guess at the type of equation to use, > plot it next to your data, sum the squares of the differences, then run a > linear regression on the results and use a Tools:GoalSeek on the results > to approach the minimum, then guess again at the type of equation to use > until you like the fit.. It is a time-consuming process, usually. > > Is there a more efficient way? > > > -- Lawrence Lile > Lawrence, Nearly every bit of PIC code I have written at my current company has included thermistor linearisation tables. The thermitsor manufacturer will (or at least should) supply either Beta values, or more desirably the Steinhart-Hart constants. From that you can create an Excel spreadsheet to get any arbitrary resistance or temperature. If you only have a fixed set of values, then use Excel's trend line. Simply right click on the trace you wish to fit a line to, and select "Add Trendline". You can then select what type of function to fit, linear, polynominal, exponential, log etc. For a thermistor, a 3rd order or better polynominal does the job very well. Under the "Options" tab of the trend line menu, check the "Display equation on chart". You can then use this equation to obtain any arbitrary value. http://www.betatherm.com/therm_theory.html has a very comprehensive set of notes on the use of thermistors and the various methods of linearistaion. Regards Mike -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads