Components Required:

  • Mercury Switch/ Tilt Sensor
  • Arduino UNO
  • Buzzer
  • LED
  • Resistor - 220 ohm
  • Breadboard
  • Connecting wires

Schematic:

Connecting the circuit:

To connect a Tilt sensor with the Arduino, it requires 5v dc input to operate. That 5v is supplied using Arduino UNO and the output of Tilt sensor is taken at PIN 4 of the Arduino. LED is connected with the PIN 2 of the Arduino UNO with 220-ohm resistor to limit the current to a safe value. And, the buzzer is directly connected to the PIN 3 of the Arduino UNO.

Testing the Sensor:

After connecting everything together and uploading the code to arduino IDE , whenever you will tilt the sensor then the buzzer will beep and the LED will blink according to the rotation of sensor.