Introduction

The DFRobot Tilt Sensor is a digital tilt switch. It could be used as a simple tilt sensor. Simple plug to our IO/Sensor Expansion board, you can make amazing interactive projects. The dedicated sensor expansion boards with the Arduino, in combination, can achieve very interesting and an interactive work.

Specification

Connection Diagram

Digital module connection diagram

Sample Code

int ledPin = 13;                // Connect LED to pin 13
int switcher = 3;                 // Connect Tilt sensor to Pin3

void setup() {
  pinMode(ledPin, OUTPUT);      // Set digital pin 13 to output mode
  pinMode(switcher, INPUT);       // Set digital pin 3 to input mode
}

void loop() {
  if (digitalRead(switcher) == HIGH) //Read sensor value
    digitalWrite(ledPin, HIGH);   // Turn on LED when the sensor is tilted
  else
    digitalWrite(ledPin, LOW);    // Turn off LED when the sensor is not triggered
}

FAQ

Q&A Some general Arduino Problems/FAQ/Tips
Q Dear Sir/Madam, I'd like to know what angle does this tilt sensor trigger? How sensitive is it? Can the tilt angle trigger be adjusted?
A It's just a simple digital tilt sensor, if the sensor are not placed on a strict flat surface, the little steel ball in the green tube will slip to one end of it, so it will output 0 or 1 digital signal, that's why we call it a "Switch". Actually strong vibration can effect it's output, but generally speaking, it's about 3 degree to make it slip from one side to the other side. Then you could know that its tilt angle could not be adjusted.

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

Version histoy

DFRobot Tilt Sensor_SKU:DFR0028

More Documents

DFshopping_car1.png Get DFRobot Tilt Sensor (SKU:DFR0028) from DFRobot Store or DFRobot Distributor.

Turn to the Top