I need to "reverse" a formula for a temperature sensor that involves an exponential:
R = 1000 x EXP(3800/T)-(3800/298)
R is in ohms, T is in kelvin
as taken from the chart of calculated resistances for each temperature. Now I'm not brilliant at maths but first i have to invert the formula so that I know T from R and before that deduce the resistance from the voltage provide by a voltage divider consisting of the sensor resistance (variable) and a fixed resistor. Can the arduino libraries do exponents and the inverse of exponents ?
On the other hand what sort of function is that that comes from the voltage divider of one fixed value and one variable value ? could that invert the exponential nicely to make the scale linear ?
No idea where the 3800 comes from. It's a fixed value in a box on the spreadsheet that is called into the formula.
I'm looking at the effects of a resistor in series and can I "linearize" the response making life much simpler, ultimately perfectly liner is not a problem providing i tie the start and end points down as I'm only operating over a 20C range in this case.
I have found that a 2.8K resistor in series with the sensor will practically linearize the scale but the only problem is that the range for the ADC is now 0.2V so I'll have to see if I can set custom references in the program (UNO platform) to expand it a bit although that is still 58 digits over 20C so enough resolution
The problem there is that I'm working from 4.4 to 4.6V so it is out of range for a 1.1V range with reference to 0V. If I can custom set the Vreff.- and Vreff.+ reference points i can expand my scale and make it more immune to noise (*goes to check libraries)
You can only set Vreff.+ on the UNO but i have another idea, If I swap the sensor and fixed resistor I'll get closer to 0V , the readings may not be what I want but doing 5-Vs I'd get back to where I'd been otherwise. I can also use the external reff then and get a full scale
Theres more to this game than software, appropriate use of the component blocks can work wonders