# zero'ing a tilt sensor

I have a tilt sensor where I want to measure a 10 degree angle. The 10 degree angle is on a machined ramp. The ramp has a built in "level" 0 degree section in it. Basically what I want to do is be able to find if the sensor's voltage is in its tolerance +/-3.5% measuring the angles. However, to zero the sensor I want it zeroed for what the ramp is sitting on, say if the ramp isn't at true zero. So I'm trying to calculate a delta I could use for a reference so the ramp doesn't have to be compared to true zero, but compared relative to what the ramp is sitting on (a table for instance).

The sensor works as a potentiometer. The sensor is excited with 4VAC

And the sensor has two sides, one side should be 2VAC, and the other is 2VAC when the sensor is level at 0 degrees. When the sensor is tilted one side increases and the other side decreases proportionately adding up to 4VAC.

I think I would just measure the sensor at level 0 degrees

measure the sensor at 10 degrees

The first side error is (2.00 - 1.998 = 0.002V)

The second side error is (2.00 - 2.002) = - 0.002V

Would I just keep track of which side I'm measuring, then just subtract the first side error from what I'm measuring.

And since the second side error is negative, I add this error to the second side measurement of what I'm measuring?

But not sure how to make it so it is relative to the 0 degrees on the ramp and ignore if the whole fixture is truly level.

This sensor changes roughly 43mV per degree, so if the fixture was set on a sloped table the reading will be off, I want to ignore that the fixture is sloped, by subtracting that difference to make it zero in the sensor measurements.

• In your example, your two sides don't add up to 4.0VAC. 1.998V + 2.02V = 4.018V! Commented Oct 29, 2013 at 16:00
• Are you planning in using a voltmeter to infer the angle or something more sophisticated like an MCU? Commented Oct 29, 2013 at 18:26

I get the impression you are only interested in the relative angle of two plane surfaces. If one is your reference surface, then note the voltage. Move to your unknown surface and measure the voltage. Subtract A from B and you have a voltage representing the relative angle.

If this voltage is the same for all relative angles no matter what tilt is present initially then job done else, you need to do some trigonometry.

• Wow simple nice answer. The sensor has high and low voltage side measured from a common pin similar to a pot. so the voltage I subtract is first put sensor on reference surface, measure one side of sensor, measure other side of sensor. Keep track of which side was high and low. Then move the sensor to the unknown surface, measure both sides of sensor, find high and low side, then subtract the corresponding high or low reference voltage. Curious, what trigonometry would be necessary? I'm curious, any online tutorials explaining it? Commented Oct 29, 2013 at 19:42
• if it's always 43mV per degree then no trig necessary I reckon but do recheck this. Commented Oct 29, 2013 at 20:01
• Nominal Scale Factor, 43.5 mV/degree/volt excitation (at 22° C) The volt of excitation is fairly steady with a +/- 0.00005VAC drift and the temperature will be fairly constant around 22 C The sensor has an error of +/- 3.5% for 0 to 8 degrees Anything above 8 degrees the - tolerance gets worse to 5% Should I trust nominal? Commented Oct 29, 2013 at 20:13
• It might be worth doing a calibration with a known angle to just see how it performs - maybe create your own look-up table - a simple spreadsheet formula in excel would get you better accuracy if you did this. You might also consider having a bit of electronics to make your measurment easier - an instrumentation amplifier will give you one voltage to measure from the differential voltages you currently have. Also measurements depend on the AC accuracy of your meter and what excitation frequency you are using. Commented Oct 29, 2013 at 20:31

This is really quite easy to achieve. What you need to do:

1) Ensure the operator places the sensor on the 0 degree shelf.

2) Measure the angle reading for the sensor from the 0 degree shelf.

3) Store away the reading in a safe place. Storage requirement will depend upon the system usage scenario. If the system can be zeroed every time it is powered up then it may be applicable to simply store the reading into a global memory variable. If the zeroing is only done once in a while across various system power cycles then the reading will need to be stored in nonvolatile memory such as Flash, FRAM or serial EEPROM.

4) Whenever the sensor is placed on the sloped surface where a measurement is required then measure the angle reading from the sensor.

5) Go to storage and fetch the previous zero reading. Subtract the zero reading from the current sensor reading.

6) Present the difference reading to the user / system as the relative angle reading for the sloped surface.

• When you say zero degree shelf you mean the built in zero degree shelf I'm talking about. Not a true perfectly level zero degree shelf? right? As for #3 It will have to be done every time because the user will move it table to table. So each table will have slightly different level error in them. Commented Oct 29, 2013 at 16:11
• @zacharoni16 - Yes, when I mention "zero degree shelf" it refers to what ever surface deemed to be the nominally horizontal location where the sensor is zeroed. Commented Oct 29, 2013 at 17:55
• @zacharoni16 - If you ever needed to quantify the difference in "level" from table to table in the shop you would have to establish a "calibrated reference bench" that was deemed to be as close to "perfect" that you can afford with the absolute level determined by another measurement technique whether that be an expensive instrument or a fairly large wide water tank (with water in it). Commented Oct 29, 2013 at 18:00