Tilt Switch

Tilt Switch is a component that detects if it’s right side up or tilted.


  • 1 Arduino Uno board
  • 1 Basic Education shield
  • 1 Tinkerkit tilt switch
  • 1 TinkerKit wire


  1. Connect the Tilt Switch with TinkerKit wire
  2. Connect the other end of the wire to to D10 on the shield.

In the Arduino IDE open Example>BasicEducationShield>Help>TiltSwitch.


#include <BasicEducationShield.h>

TiltSwitch me=TiltSwitch(10);

void setup(){

//Initialize the component. Must be called.
void loop(){
Serial.println("Please tilt...");

//Wait until the tilt switch is tilted.

Note: The Tilt Switch only have 2 states, up-right or not up-right. It does not detect whether it’s upside down or measures the angle of the tilt. So make sure it suits your project, and if you’re using it, it’s recommended that it starts with up-right.

It’s not working

  1. Make sure you’ve connected the sensor to the same pin as stated in the code.