This SW-520D basic tilt switch can easily be used to detect orientation. Inside the can is a ball that make contact with the pins when the case is upright. Tilt the case over and the balls don’t touch, thus not making a connection.

There are numerous uses for these basic sensors, but keep in mind you might need to use some debouncing code, as the sensor isn’t immune to small vibrations and such.

Tilt sensors are essential components in security alarm systems today. Standalone tilt sensors sense tilt angle or movement. Tilt sensors can be implemented using mercury and roller ball technology, and can be mounted using mechanical threading, magnets, or adhesives, depending on what type of surface they are being mounted to.


  • The use of highly sensitive angle switch SW-520D as a sensor
  • The comparator output signal clean, good waveform, driving ability, than 15mA
  • The working voltage 5V
  • The output format: Digital switching output (0 and 1)
  • A fixed bolt hole for easy installation
  • Small PCB board size: 3.2cm x 1.4cm
  • Using a wide voltage comparator LM393
  • Model: SW-520D
  • Max Current : 20mA
  • Max voltage : 12V
  • Conductive time : 2ms
  • Closed resistance :< 10M ohm
  • Open resistance : > 10M ohm
  • Material: Metal, PVC
  • SW-520D is roll ball type tilt switch

Recent technological advancements in the manufacturing of tilt sensors have improved accuracy, reduced cost, and increased lifetime. The type SW-520D is a commonly available roller-ball type tilt sensor consists of two conductive elements (poles) and a conductive free mass (rolling ball), encapsulated in the same case. When the tilt sensor is oriented so that that end is downwards, the mass rolls onto the poles and shorts them, acting as a switch stroke. Microcontroller-compatible tilt sensor modules based on SW-520D are also available at affordable costs.

Electronics circuitry behind this tiny module is usually centered around the dual- comparator chip LM393. The module features a tilt sensor, a signal amplifier, a standard 4-pin header, a power indicator that signals that the module is correctly powered, and a status indicator that lights up when a tilt is detected by the tilt sensor.

This module will output logic LOW when the sensor is tilted below the threshold angle; logic HIGH when it is tilted above the threshold angle. The threshold angle ranges from 45 degree to 130 degree. Aside from threshold angle, angular velocity also affect the tilt module. It can also be used as a vibration sensor!


Arduino Example:

Tilt Sensor & MQTT:

Leave a Reply

WordPress spam blocked by CleanTalk.
Bombax Theme designed by itx