AN 1001: Temperature Compensation of Electrolytic Tilt Sensors

1 Description

Electrolytic tilt sensors are fluid-based devices making their output susceptible to variations in temperature. The purpose of this application note is to explain how temperature compensation of electrolytic tilt sensor outputs can be achieved to produce the highest accuracy angular measurement.

Back to Table of Contents

2 Temperature Compensation

There are two components to the temperature compensation of an electrolytic tilt sensor:

  1. Null temperature compensation
  2. Scale (or sensitivity) temperature compensation

Null temperature compensation is accomplished with a null temperature coefficient. This is a factor which varies from sensor to sensor and therefore must be calibrated individually for each sensor. The units of this factor will vary depending on the type of output. For example, some sensors have an analog output of 0 to 5 V while others will have an ASCII decimal output of the current tilt angle.

Scale temperature compensation is accomplished with a scale temperature coefficient. This is a factor which is uniform among all sensors of the same type. It has units of percent of output per degree C or %/°C.

The only other requirement for temperature compensation is the ability to read the current temperature. This feature is available on all Fredericks Company Signal Conditioner Circuits through the use of the MCP9700 from Microchip.

Back to Table of Contents

3 Null Temperature Compensation

In order to accomplish null temperature compensation, a null temperature coefficient must first be calculated (because the coefficient varies for each individual sensor, The Fredericks Company cannot provide it). This is accomplished by temperature cycling the sensor over the desired range and recording the output while the sensor remains stationary at null (0° tilt). At The Fredericks Company, we typically do a 3-point calibration at -20 °C, +20 °C, and +50 °C.

Let’s suppose we have a 0717-4318-99 Wide Range Dual-Axis Electrolytic Tilt Sensor sitting at null at +20 °C being driven by a signal conditioner with a 16-bit (0 to 65535) output. We take a reading and record the following output:

Output at +20 °C = 32768

We then reduce the temperature to -20 °C and allow the sensor to reach ambient temperature. We take another reading and record the following output:

Output at -20 °C = 32738

We then increase the temperature to +50 °C and again allow the sensor to reach ambient temperature. We take another reading and record the following output:

Output at +50 °C = 32798

We can now calculate a temperature coefficient for temperatures between -20 °C and +20 °C and another for temperatures between +20 °C and +50 °C using the following formula:

Temperature Coefficient = (Output at 20 °C − Current Output) / (20 − Current Temperature)

Completing the calculations for the above example, we find the following two temperature coefficients:

Temperature Coefficient between -20 °C and +20 °C = (32768 − 32738) / (20 − (-20)) = 30 / 40 = 0.75 counts/°C

Temperature Coefficient between +20 °C and +50 °C = (32768 − 32798) / (20 − 50) = -30 / -30 = 1 count/°C

Once the null temperature coefficients are calculated, null temperature compensation can be achieved by using the coefficients along with the following formula:

Null Compensated Output = ((20 − Current Temperature) × Null Temperature Coefficient) + Current Output

Let’s suppose that we have the same sensor above at an unknown position where its output reads 35000 at a temperature of +40 °C. We can use the formula for the compensated output to complete the following calculations:

Compensated Output = ((20 °C − 40 °C) × 1 count/°C) + 35000 = -20 + 35000 = 34980

It is important to note that the null offset due to temperature will produce an offset, and therefore an error, across the full range of the sensor if it is not compensated.

Back to Table of Contents

4 Scale Temperature Compensation

Scale temperature compensation can be achieved by using the scale temperature coefficient provided by The Fredericks Company along with the following formula:

Scale Compensated Output = (Current Output × (20 − Current Temperature) × -Scale Coefficient) + Current Output

Let’s suppose we have a 0703-1602-99 Mid-Range Single-Axis Electrolytic Tilt Sensor. This sensor has a scale temperature coefficient of 0.075%/°C. Now let’s suppose that the current sensor output is 5° tilt at a temperature of -20 °C. We can then use the formula above to complete the following calculations:

5° tilt × (20 °C − (-20 °C)) × -0.00075 = 5° tilt × 40 °C × -0.00075 = -0.15° tilt

5° tilt + (-0.15° tilt) = 4.85° tilt

4.85° is therefore your temperature-compensated angular position measurement.

Here’s another example. This time let’s suppose that the current sensor output is -5° tilt at a temperature of 40 °C:

-5° tilt × (20 °C − 40 °C) × -0.00075 = -5° tilt × -20 °C × -0.00075 = -0.075° tilt

Scale Compensated Output = -5° tilt + (-0.075° tilt) = -5.075° tilt

-5.075° is therefore your temperature-compensated angular position measurement.

It’s important to keep in mind the sign of the current output when doing calculations for scale temperature compensation. If you are using a signal conditioning board that has a 16-bit output of 0 to 65535, this output will first need to be shifted so that 0 is the midpoint (this is easily accomplished by subtracting 32768).

Back to Table of Contents

5 Complete Temperature Compensation

To properly apply temperature compensation, it’s necessary to use both components of temperature compensation together. This is done by using the null-compensated output to calculate the scale-compensated output:

Compensated Output = (Null Compensated Output × (20 − Current Temperature) × -Scale Coefficient) + Null Compensated Output

Let’s suppose we have the same 0717-4318-99 Wide Range Dual-Axis Electrolytic Tilt Sensor from the null temperature compensation example above. Recall that when the sensor was held at an unknown position at a temperature of +40 °C, the null-compensated output was 34980. Let’s finish the temperature compensation of this measurement by applying scale temperature compensation.

First, we have to shift the raw value to make sure the scale temperature coefficient is calculated correctly:

34980 − 32768 = 2212

The 0717-4318-99 has a scale temperature coefficient of 0.1%/°C. Using this and the null-compensated output, we can now apply scale temperature compensation as described above:

2212 × (20 °C − 40 °C) × -0.001 = 2212 × -20 °C × -0.001 = 44.24

Compensated Output = 2212 + 44.24 = 2256.24 = 2256

Finally, we add back the offset we subtracted earlier to get our final, unsigned 16-bit result.

2256 + 32768 = 35024

It’s important to make sure you use both components of temperature compensation in your calculations. Using only one component can have unpredictable results, sometimes resulting in the measurement becoming less accurate than the uncompensated output.

Back to Table of Contents