Digital Tilt Sensor SKU:DFR0028

From DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot


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.


  • Supply Voltage: 3.3V to 5V
  • Interface: Digital
  • Size:22x30mm

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
    digitalWrite(ledPin, LOW);    // Turn off LED when the sensor is not triggered


Q1. 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.

Version histoy

DFRobot Tilt Sensor_SKU:DFR0028

Nextredirectltr.pngGo Shopping DFRobot Tilt Sensor (SKU:DFR0028)

Category: DFRobot > Sensors & Modules > Sensors > Motion Sensors