KY-027 Magic Light Cup Module

KY-027 Magic Light Cup Module image

View on Amazon

Overview

The KY-027 is a motion detection module featuring a mercury tilt switch and an LED. It detects tilt or orientation changes and can be used in various interactive applications.

About KY-027 Magic Light Cup Module

The KY-027 Magic Light Cup Module consists of a mercury tilt switch and an LED. When the module is tilted, the mercury tilt switch closes, activating the LED. This module is ideal for projects that respond to tilt or orientation changes, such as interactive lights, toys, or simple alarm systems.

Where to Buy

Get Your KY-027

KY-027 Magic Light Cup Module

Starting from

$2 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-027 Specifications

Complete technical specification details for KY-027 Magic Light Cup Module

📊 Technical Parameters

Operating Voltage 3.3V to 5V
Dimensions 36 x 15 x 14 mm
Weight 2 g
Pin Configuration

KY-027 Pinout

The **KY-027** is a 4-pin magic light cup module with integrated tilt switch and LED:

Visual Pinout Diagram

Pinout Diagram Primary
KY-027 Magic Light Cup Module pinout
4
Total Pins

Pin Types

Power
2
Communication
2

Quick Tips

🔌

**Interface**: Digital tilt switch + LED control,⚖️ **Sensor**: Mercury tilt switch (sealed glass tube with mercury droplet),💡 **LED Output**: Onboard LED controllable via L pin

🎮

**Signal**: Active low - S pin goes LOW when tilted,⚡ **Power**: 3.3V to 5V operation

⚠️

**Mercury Warning**: Contains mercury - handle with care, dispose properly,🎯 **Applications**: Interactive lights, magic cup games, tilt-activated systems, orientation alarms

Pin Descriptions

Pin NameTypeDescriptionNotes
1 GND
Power

Ground connection

2 +V
Power

Power supply

3.3V or 5V

3 S
Communication

Signal output from tilt switch

LOW when tilted (active low)

4 L
Communication

LED control input

Drive HIGH to turn on LED

Connection Guide

Wiring KY-027 to ESP32

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

Visual Wiring Diagram

Wiring Diagram Recommended
KY-027 Magic Light Cup Module wiring with ESP32
4
Connections

Connection Status

Required
3
Optional
1

Protocol

Digital

Pin Connections

KY-027 PinConnectionESP32 PinDescription
1 GND Required
GND

Ground

2 +V Required
3.3V or 5V

Power supply

3 S Required
GPIO17

Digital input for tilt switch (any GPIO)

4 L Optional
GPIO16

LED control output (any GPIO)

💡

**Tilt Detection**: Read S pin - LOW when tilted, HIGH when upright

🔦

**LED Control**: Write HIGH to L pin to illuminate onboard LED

🎮

**Magic Cup Effect**: Use two modules to create interactive light transfer effect

**Pull-up**: Internal pull-up recommended on S pin for stable readings

⚠️

**Mercury Safety**: Do not break or incinerate module - contains toxic mercury

🔋

**Power LED**: Separate power indicator LED always on when powered

📌

**Tilt Angle**: Typically activates at 15-30° from vertical

Help & Support

KY-027 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

KY-027 Programming Examples

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

Summary

Wrapping Up KY-027

The ESP32 KY-027 Magic Light Cup 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-027 into your ESP32 project and bring your ideas to life!

Similar Options

Explore Alternative Sensors

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

KY-011 Two-Color LED Module

KY-011 Two-Color LED Module

KY-0XX MODULE Digital

The KY-011 is a two-color LED module featuring a common cathode 3mm LED capable of emitting red and green light. By adjusting the intensity...

View Details
KY-006 Passive Buzzer Module

KY-006 Passive Buzzer Module

KY-0XX MODULE PWM

The KY-006 is a passive piezoelectric buzzer module that produces sound when driven by a PWM signal. It is ideal for generating various...

View Details
KY-053 Analog Digital Converter Module

KY-053 Analog Digital Converter Module

KY-0XX MODULE I2C

The KY-053 is an analog-to-digital converter module featuring the ADS1115 ADC. It provides four 16-bit resolution channels and communicates...

View Details