But can math actually help in the real world?

 

My home AC has been operating (fitfully) under the control of my system for a few weeks now.  While doing so it has also been logging various parameters at one second intervals.  I thought it would be interesting to look at the data.  The first question was: what is maximum attic temperature.  Since all of the data is in a Postgres database, that’s a very easy question to answer:

bbb_hvac=> select max(attic_temp) as temp_f from data.home_data;
temp_f
--------
110.96
(1 row)

That seems awfully low. The outdoor temperature down here gets .. toasty.

bbb_hvac=> select max(outdoor_temp) as temp_f from data.home_data ;
 temp_f  
---------
 96.3316
(1 row)

My first thought is that I screwed something up.  Perhaps the opamp gain is too high and it’s saturating the ADC input.  Thus we need to verify the maximum input temperature that the system can (theoretically) measure and prove to our selves whether \(\approx110F\) is close to that limit.

The ICTD input opamp is in a non-inverting configuration with R2 = 8.2K Ohms and R1 = 910 Ohms resulting in a gain of 10.0110.  The ADC Vref is 5.0 volts thus the ADC input will become saturated if the input to the opamp is greater than 0.4995 volts (\(5 / 10.0110=0.4995\) ). So what temperature does 0.4995 volts equate to?

The venerable AD590 that is used in majority (all?) ICTD probe produces 1 µA/K.  In order to do something meaningful with the current i.e. to turn it into a voltage that we can measure, there must be a load in the circuit.   In this case the load is a 1K Ohm resistor.  Given Ohms law we know that \(V=IR\).  In this case R = 1000 (\(10^3\)) as that’s the value of the resistor at which the probe terminates.  I is in amps so the output of the ICTD probe must be divided by \(10^6\) or 1,000,000 to keep the units consistent. Assuming that TK is the temperature in Kelvin (K) the function for converting the temperature to voltage in our system is:

$$ V_{ICTD} = \frac{T_K}{10^6} \times 10^3 $$

And since we love algebra and hate writing stuff unnecessarily the simplified function is:

$$ V_{ICTD} = \frac{T_K}{10^3}$$

That’s great and all, but we’re used to measuring temperature in Fahrenheit not Kelvin.  A conversion must be done since Fahrenheit and Kelvin are not the same unit.  The most direct way is it to convert F (Fahrenheit) to R (Rankine) which is the equivalent to Kelvin, but in the imperial measurement system and then convert Rankine to Kelvin.  Assuming TF is temperature in Fahrenheit, the function for converting Fahrenheit to Rankine is \(T_R = T_F + 459.67\).  Formula for converting Rankine to Kelvin, assuming TR is temperature in Rankine is \(T_R * \frac{5}{9}\).  The complete function for converting temperature in Fahrenheit to Kelvin is then:

$$ T_K = (T_F + 459.67) \times \frac{5}{9} $$

Since math is heavily dependent on mystical incantations uttered in just the right order we need to check our work.  Assuming that TF = 70F then  \( T_K = (70 + 459.67) \times  \frac{5}{9}  = 294.2611\).  Function for converting K to C (Celsius) is \(T_C = T_K -273.15 \) thus \(294.2611 – 273.15 = 21.\overline{1} \).  So, according to our math, 70F = 294.2611K = 21.1C.  The Google machine of ultimate truth agrees.

Putting all that together, the function for determining the voltage that an ICTD probe will generate (VICTD) in our hardware configuration for a given temperature in Fahrenheit (TF) is:

$$ V_{ICTD} = \frac{(T_F + 459.67) \times \frac{5}{9}}{10^3} $$

Or in a slightly more pleasant form for later use

$$ V_{ICTD} = \frac{(T_F + 459.67) }{10^3} \times \frac{5}{9} $$

To test our work lets assume that TF = 70 which gives us:

$$ V_{ICTD} = \frac{(70 + 459.67) }{10^3} \times \frac{5}{9}  = 0.2943 $$

This of course is Kelvin equivalent of temperature in Fahrenheit divided by 1000 as seen above.  That’s all fine and dandy, but doesn’t answer the initial question – at which temperature does the ADC input become saturated.  We need to rearrange the function a bit to solve for the temperature (TF) at a given voltage (VICTD).

$$T_F = V_{ICTD} \times \frac{9}{5} \times 10^3 – 459.67  $$

Since we know that the ICTD voltage (VICTD) that will saturate our ADC input is 0.4995, we plug it into the function:

$$ T_F = 0.4995 \times \frac{9}{5} \times 10^3 – 459.67 = 439.43 $$

Above 439.43F our ADC input will become saturated.  To double check we plug 439.43F into the VICTD function above

$$ V_{ICTD} = \frac{( 439.43 + 459.67) }{10^3} \times \frac{5}{9}  = 0.4995  $$

Magic.

Now we know for sure that \(\approx110F\) is no where near the maximum temperature that the system can measure.

That’s all fine and good – the system design seems to be validated, but is the physical incarnation of the math accurate?  That will be next.

Leave a Reply