KY-020 Tilt Switch Module

KY-020 Tilt Switch Module image

View on Amazon

Overview

The KY-020 is a tilt switch module that detects changes in orientation. It provides a digital signal output, making it suitable for applications like motion detection, security systems, and tilt-based controls.

About KY-020 Tilt Switch Module

The KY-020 Tilt Switch Module is designed to detect orientation or inclination. It contains a metallic ball that connects or disconnects the circuit depending on the module’s tilt angle. When tilted, the ball moves, closing or opening the circuit, which can be read as a digital signal by microcontrollers like the Arduino or ESP32. This module operates at voltages between 3.3V and 5V, making it versatile for various projects.

Where to Buy

Get Your KY-020

KY-020 Tilt Switch Module

Starting from

1$ per unit

Amazon com
Amazon.com Ships worldwide
Amazon de
Amazon.de Ships to EU
Aliexpress
AliExpress Best value option

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specs

KY-020 Specifications

Complete technical specification details for KY-020 Tilt Switch Module

πŸ“Š Technical Parameters

Operating Voltage 3.3V - 5V
Output Type Digital
Dimensions 19 x 15 x 5 mm
Pin Configuration

KY-020 Pinout

The **KY-020** is a 3-pin ball tilt switch sensor module:

Visual Pinout Diagram

Pinout Diagram Primary
KY-020 Tilt Switch Module pinout
3
Total Pins

Pin Types

Power
2
Communication
1

Quick Tips

πŸ”Œ

**Interface**: Digital output (tilt/orientation detection),🎯 **Sensor**: Metallic ball switch mechanism

πŸ’‘

**Operation**: Ball moves with tilt, connecting or disconnecting circuit,⚑ **Power**: 3.3V to 5V operation

🎲

**Binary**: Simple binary tilt detection (on/off),🎯 **Applications**: Orientation detection, motion sensors, anti-theft alarms, tilt-based controls

Pin Descriptions

Pin NameTypeDescriptionNotes
1 Pin (-)
Power

Ground connection

2 Pin (middle)
Power

Power supply

3.3V to 5V

3 Pin (S)
Communication

Digital signal output

Changes state when tilted

Connection Guide

Wiring KY-020 to ESP32

To interface the **KY-020** with an **ESP32** for tilt detection:

Visual Wiring Diagram

Wiring Diagram Recommended
KY-020 Tilt Switch Module wiring with ESP32
3
Connections

Connection Status

Required
3

Protocol

Digital

Pin Connections

KY-020 PinConnectionESP32 PinDescription
1 Pin (-) Required
GND

Ground

2 Pin (middle) Required
3.3V

Power supply

3 Pin (S) Required
GPIO4

Digital input (any GPIO)

πŸ’‘

**GPIO Selection**: Any digital GPIO pin works, GPIO4 is just an example

⚑

**Voltage**: Use 3.3V for ESP32 compatibility

🎲

**Ball Switch**: Physical ball moves inside to make/break contact

🎯

**Binary Output**: Simple HIGH/LOW state based on tilt angle

⚠️

**Safer Alternative**: Consider using KY-017 mercury-free version for environmental safety

Help & Support

KY-020 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

KY-020 Programming Examples

Ready-to-use code examples for different platforms and frameworks

Summary

Wrapping Up KY-020

The ESP32 KY-020 Tilt Switch Module is a powerful KY-0xx module sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

Best Practices

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Safety First

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.

Ready to Start Building?

Now that you have all the information you need, it's time to integrate the KY-020 into your ESP32 project and bring your ideas to life!

Similar Options

Explore Alternative Sensors

Looking for alternatives to the KY-020? Check out these similar sensors that might fit your project needs.

KY-004 Key Switch Module

KY-004 Key Switch Module

KY-0XX MODULE Digital

The KY-004 is a key switch module equipped with a tactile push-button. It provides a digital output signal when pressed, making it ideal for...

View Details
KY-001 Temperature Sensor Module

KY-001 Temperature Sensor Module

KY-0XX MODULE 1-Wire

The KY-001 is a temperature sensor module that operates within a wide temperature range. It supports 1-Wire communication and is based on...

View Details
KY-050 Ultrasonic Distance Sensor Module

KY-050 Ultrasonic Distance Sensor Module

KY-0XX MODULE Digital

The KY-050 is an ultrasonic distance sensor module capable of measuring distances ranging from 2 cm to 300 cm with a resolution of...

View Details