From ProdDocs
Jump to: navigation, search

4-Directional Tilt Sensor



The 4-Directional Tilt Sensor is a perfect accelerometer replacement in those applications which may not need precise angular feedback. This type of sensor is commonly used in many smart phones and digital cameras as a cheaper means to adjust the screen display when the device is rotated.

ST-00008 back.JPG ST-00008 front.JPG

Product Features

  • Small 6-pin DIP packaging with breadboard-friendly 0.1" pin spacing
  • Easy communication with any microcontroller
  • Positional feedback in four directions

Technical Details

  • Power Requirements: 3 to 5.5 VDC
  • Communication Interface: 2-pin high/low output for four sensor states
  • Operating temperature: 32 to 122 °F (0 to 50 °C)
  • Dimensions: 0.42 x 0.32 x 0.49 in (1.07 x 0.81 x 1.24 cm)

Applications Ideas

  • Rotating display adjustment
  • Robotic movement
  • Tilt sensing for remote controls
  • Alarm systems

Theory of Operation

Internally, the 4-Directional Tilt Sensor includes one IR LED, two phototransistors, and a small ball that moves when the sensor is rotated. Depending on the orientation of the sensor, the two phototransistors will output high or low signals depending whether light is detected or not. New locations are triggered when the sensor is rotated roughly 30° toward the new position.

The chart below depicts the cylinder location when rotating the sensor, and the output states of each phototransistor during revolution.

4 Directional Tilt Sensor4.JPG

Items of Note:

  • When the sensor is lying flat and only acted on by g-forces, the cylinder will be in Location C.
  • Upon startup and when lying flat, the sensor remains in the last location before shutdown. Once movement is detected, the sensor will respond normally.

Pin Definitions

Pin Name Type Function
1 OUT2* O Output state of phototransistor 2
2 Vdd* P Supply Voltage -> 3.0 - 5.5V
3 GND G Ground -> 0V
4 GND G Ground -> 0V
5 Vdd* P Supply Voltage -> 3.0 - 5.5V
6 OUT1* O Output state of phototransistor 1

Pin Type: P = Power, G = Ground, I = Input, O = Output

  • Note: Maximum output signal voltage approaches power supply voltage.

Capture Tilt 2.JPG

Connection Diagrams

For use with the BASIC Stamp and Propeller P8X32A programs. Note: Maximum output signal voltage approaches power supply voltage, so use the same voltage level for microcontroller and sensor supply.

4 Directional Tilt Sensor3.JPG

Resources and Downloads


4DirectionalTiltSesnor_Simple.bs2 displays the output states of both phototransistors. It uses the Debug Terminal, which is built into the BASIC Stamp Editor software


4DirectionalTiltSesnor_Simple.spin displays the current output states of both phototransistors. It uses the Parallax Serial Terminal to display the device output. The object and the Parallax Serial Terminal itself are included with the with the Propeller Tool v1.2.7 or higher, which is available from the link below