Introduction
This tutorial details the 2801 Tilt Ball Switch Sensor, its functions and the process to build a simple project using the 2801 Tilt Ball Switch Sensor and an Arduino.
The 2801 Tilt Ball Switch Sensor
The 2801 Tilt Ball Switch Sensor is a highly sensitive sensor that is switched on by inclination or tilting.
The switch remains off until a tilt of more than 15 degrees is detected then turns on. Due to the sensor packing, it is waterproof and dustproof.

Pin Out
The two pins of the 2801 Tilt Ball Switch Sensor are interchangeable.
How it Works
The 2801 Tilt Ball Switch Sensor works just like a typical switch where tilting is the mechanism that turns the switch on and off. In addition, the two legs of the switch are interchangeable.
Project - Arduino Switch Status Monitor
This project will demonstrate the display of the switch status on the serial monitor.
Components
- Arduino Uno Board (1 pc.)
- 2801 Tilt Ball Switch Sensor (1 pc.)
- Pull-up Resistor (1pc.)
- Jumper Wires
Wiring Diagram
The 2801 Tilt Ball Switch Sensor pins are connected to the Arduino Uno board as follows:
Module Pin | UNO Board Pin |
---|---|
Leg1 | GND |
Leg2 | 2 |
Leg2 | 5v Through a pull-up resistor |

Code
void setup() {
Serial.begin(9600); //start serial monitor
pinMode(2,INPUT);
}
void loop() {
if (digitalRead(2) == HIGH)
{
Serial.println("SWITCH IS OFF");
}
else
{
Serial.println("SWITCH IS ON");
}
}
Project Test
Once the components are wired as per the wiring diagram, connect the Arduino to the PC and upload the program. Open the Serial Monitor in the Arduino IDE, and on/off status of the switch will be displayed.