FAQ: Tilt Angle Window Detector

Document created by NevadaMark Employee on Sep 30, 2013Last modified by NevadaMark Employee on Oct 1, 2013
Version 4Show Document
  • View in full screen mode


How can I use a tilt sensor to determine if my instrument has move clockwise or counterclockwise?



The ADIS16209 offers a an accurate tilt sensor function, along with two programmable alarms that will simplify this process.  The ADIS16209 offers both horizontal (XINCL_OUT, YINCL_OUT) and vertical (ROT_OUT) tilt angle measurements, using a fully-calibrated dual-axis accelerometer. If we assume that the axis of rotation is perpendicular to gravity and to one of the accelerometers, one might be able to accomplish this using one of the horizontal outputs and the two alarms.  For this discussion, let's assume that the reference position is when the x-axis is at 0 degrees, clockwise rotation produces a positive response and counterclockwise rotation produces a negative response.


ALM_CTRL = 0x661F

ALM_MAG1 = 0x8028

ALM_MAG2 =0x3FD8


The ALM_CTRL setting options are located on page 16 of the ADIS16209 (Rev C) datasheet.  Setting this to 0x661F establishes the following settings:

  • Set Alarm 1 and Alarm 2 to monitor XINCL_OUT
  • Use static level comparisons (not dynamic, "rate of change")
  • Use filtered data for both Alarm 1 and Alarm 2
  • Set DIO2 as a positive-polarity alarm indicator.


Setting ALM_MAG1 = 0x8028 establishes the Alarm 1 threshold at greater than 1 degree.

Setting ALM_MAG2 = 0x3FD8 establishes the Alarm 2 threshold at less than -1 degree.

So, DIO2 will go high when XINCL_OUT is greater than 1 degree or less than -1 degree.


In order to discriminate between Alarm 1 (clockwise) and Alarm 2 (counterclockwise), monitor STATUS[9:8], using the SPI port. For more information on the STATUS register, refer to page 18 in the ADIS16209 (Rev C) datasheet.


Note that this technique will also work when using the ADIS16201, ADIS16203 or ADIS16210.


For a step-by-step guide for testing this, using the ADIS16209/PCB and EVAL-ADIS, click on the following link:



I hope that helps!