Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

Using The 2801 Tilt Ball Switch Sensor with Arduino

Contents

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.

2801 Tilt Ball Switch Sensor front view
Figure 1: THE 2801 TILT BALL SWITCH SENSOR

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 PinUNO Board Pin
Leg1GND
Leg22
Leg25v Through a pull-up resistor
2801 Tilt Ball Switch Sensor wiring diagram

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.

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top