In this Illustration we will going to wire the mercury switch module is a family of the tilt switching sensor, and it has an on-board LED as indicator as power status it can be used to build a simple circuit
Starter #7 How to use Tilt Switch in Arduino with Sample Source Code
How to use the TILT switch using Arduino.
Download the source code here | 14Core_Tilt_Switch