DIYables SW520D Tilt Angle Sensor Module Ball Switch LM393 for Arduino ESP32 ESP8266 Raspberry Pi, Adjustable Sensitivity, 5 Pack
Click to zoom




Quick Overview
The DIYables SW520D Tilt Angle Sensor Module uses the SW520D ball switch to detect tilt and angle changes, outputting a clean digital signal through an LM393 comparator. When the module tilts beyond the trigger threshold, the ball switch closes and the LM393 outputs a logic-level signal readable by Arduino, ESP32, ESP8266, Raspberry Pi, or any 3.3V–5V digital input.
An onboard potentiometer lets you adjust the trigger sensitivity to suit different tilt angles and applications without modifying your code. The module includes a power LED and a separate output indicator LED so you can visually confirm both power status and trigger events during setup and testing. Mounting holes are provided for permanent installation.
Ideal for tilt detection, anti-theft alarms, orientation sensing, safety cutoffs, and motion-triggered projects on Arduino, ESP32, ESP8266, and Raspberry Pi.
Key Features
- SW520D Ball Switch Sensor — Detects tilt and angle changes using the SW520D ball switch for stable and reliable digital output
- Adjustable Sensitivity — Built-in potentiometer allows easy adjustment of trigger sensitivity for different tilt angles and applications
- LM393 Digital Output — LM393 comparator provides a clean digital 0/1 signal for reliable performance with any microcontroller
- 3.3V to 5V Compatible — Works with Arduino, ESP32, ESP8266, Raspberry Pi, and other microcontrollers across a wide voltage range
- Dual LED Indicators — Onboard power LED and output indicator LED for visual confirmation of power status and tilt events
- Easy Installation — Mounting holes provided for secure, permanent installation in enclosures and project setups
- 5-Pack for DIY Projects — Includes five modules for multi-point tilt sensing or multiple projects
SPECIFICATION
| Specification | Value |
|---|---|
| Product Type | Tilt / Angle Sensor Module |
| Sensor | SW520D ball switch |
| Comparator | LM393 |
| Output Type | Digital (0 / 1) |
| Sensitivity | Adjustable via onboard potentiometer |
| Operating Voltage | 3.3V – 5V DC |
| Indicators | Power LED + output indicator LED |
| Mounting | Mounting holes provided |
| Package Quantity | 5 pieces |
| Compatibility | Arduino, ESP32, ESP8266, Raspberry Pi, any 3.3V–5V microcontroller |
| Applications | Tilt detection, anti-theft alarms, orientation sensing, safety cutoffs, motion triggering |
PACKAGE
A package includes:
| Qty | Items |
|---|---|
| 5 | SW520D tilt angle sensor modules |
Tutorials
- Arduino - SW520D Tilt Sensor tutorial
- Arduino Uno R4 - SW520D Tilt Sensor tutorial
- Arduino Nano - SW520D Tilt Sensor tutorial
- Arduino Nano ESP32 - SW520D Tilt Sensor tutorial
- ESP32 - SW520D Tilt Sensor tutorial
- ESP8266 - SW520D Tilt Sensor tutorial
- Raspberry Pi - SW520D Tilt Sensor tutorial
- Raspberry Pi Pico - SW520D Tilt Sensor tutorial
COMPATIBLE HARDWARE
- Arduino boards (UNO, Mega, Nano, etc.) — Via digital input pin at 5V
- Arduino Uno R4 WiFi/Minima — Via digital input pin
- Arduino Nano ESP32 — Via digital GPIO input at 3.3V
- ESP32 development boards — Via digital GPIO input at 3.3V
- ESP8266 boards (NodeMCU, Wemos D1, etc.) — Via digital GPIO input at 3.3V
- Raspberry Pi (all models) — Via GPIO digital input at 3.3V
- Raspberry Pi Pico — Via digital input pin at 3.3V
- Any microcontroller with digital input — Compatible at 3.3V or 5V logic