Analog Scaling


The analog temperature sensor has no software requirements other than configuring the connecting devices analog gain and offset.

The sensor is based on a TI TMP235 temperature sensor and has a gain and offset of:

gain (\(T_{c}\)) 10mV/degC
offset (\(V_{0}\)) 500mV (at 0degC)

It is straightforward to convert this for use on JCS devices:

The temperature sensor has the transfer function \(V_{o} = T_{A} \times T_{c} + V_{0}\).

Here \(V_{o}\) is the sensor output voltage, \(T_{A}\) is the measured ambient temperature and \(T_{c}\) and \(V_{0}\) are the scale and offset from above.

The sensor transfer function is rearranged to solve for the ambient temperature:

\[ T_{A} = \left({1\over{T_{c}}}\right) V_{o} - {V_{0}\over{T_{c}}} \]

Most JCS devices that accept the analog temperature sensor have a 3.3V reference and a 12bit ADC, therefore scaling from ADC counts to Volts is given by \(V_{o} = \left({3.3\over{4096}}\right)\times adc_{counts}\).

The analog sensor temperature is then be given by the formula:

\[ T_{A} = \left({1\over{T_{c}}}\right) \left({3.3\over{4096}}\right)\times adc_{counts} - {V_{0}\over{T_{c}}} \]

Substituting values in gives:

\[ T_{A} = \left({1.0\over{0.01}}\right) \left({3.3\over{4096}}\right)\times adc_{counts} - {500.0\over{0.01}} \]
\[ T_{A} = 0.080566406 \times adc_{counts} - 50.0 \]

JCS device requires the analog gain and offset in the form \(V_{o} = gain \times adc_{counts} - offset\). Here we can simply extract the analog interface gain and offset terms for the device configuration:

  an_0_gain:   0.0805664063
  an_0_offset: 50.0