Magic Light Cup Sensor Module KY-027

Magic Light Cup Sensor Module KY-027

Sensors
DET577
Part.No: KY-027
€1.75
In Stock
Immediate Dispatch
The KY-027 Magic Light Cup Sensor Module uses two mercury tilt switches and PWM-controlled LEDs to create a mesmerizing light-transfer visual effect — ideal for Arduino beginners and interactive projects.

 

The KY-027 Magic Light Cup Sensor Module (MPN: KY-027) is a dual-module kit that combines mercury tilt switches with PWM-driven LEDs to simulate the visual illusion of light being poured between two cups. When you tilt one module, its mercury switch sends a digital signal that triggers a PWM dimming sequence: one LED fades out while the other fades in — creating a smooth, captivating light-transfer effect. It is a popular demonstration module for learning PWM control, digital input reading, and sensor-driven animation on Arduino-compatible boards.

Key Features

  • Mercury Tilt Switch Input: Provides a clean digital signal on tilt → reliable trigger for PWM sequences without debounce complexity
  • Dual-Module Design: Two modules work in tandem → creates the iconic "magic cup" light-pouring illusion
  • PWM Brightness Control: LED brightness changes smoothly via PWM → visually striking dimming effect ideal for demos and exhibitions
  • Arduino-Ready: Designed to interface directly with Arduino digital and PWM pins → plug-and-play with the provided example code

Pinout & Wiring

Each KY-027 module connects to your Arduino using the following pins as demonstrated in the reference code:

FunctionArduino Pin (Module A / B)Description
LED Output APin 5PWM-capable pin controlling LED brightness on Module A
LED Output BPin 6PWM-capable pin controlling LED brightness on Module B
Tilt Switch APin 7Digital input reading mercury switch state on Module A
Tilt Switch BPin 4Digital input reading mercury switch state on Module B

Wiring note: Connect each module's signal pin to the designated Arduino digital pin, power to 5V, and GND to GND. Use PWM-capable pins (marked with ~ on Arduino UNO) for the LED outputs to enable smooth brightness transitions.

Compatibility

  • Arduino UNO / Nano / Mega: Fully compatible — module operates at 5V logic, and the LED pins require PWM-capable outputs (pins 5 & 6 on UNO are PWM-enabled).

Typical Applications

  • Learning PWM dimming and digital input reading on Arduino
  • Interactive art installations and science fair demonstrations
  • Beginner electronics workshops showcasing sensor-driven light effects
  • Tilt/orientation detection projects with visual feedback
  • Fun desktop gadget or conversation-piece build for makers and hobbyists

Technical Specifications

InterfaceDigital (mercury tilt switch) + PWM (LED output)
Sensor TypeMercury tilt switch (×2, one per module)
Output TypeDigital signal + PWM-driven LED
Compatible PlatformArduino (5V logic)
MPNKY-027

FAQ

Q: Why does the light effect look like liquid being poured between cups?
A: When you tilt Module A, its mercury switch triggers a PWM sequence that fades its LED down while simultaneously fading Module B's LED up — the smooth inverse brightness change creates the visual illusion of light transferring from one cup to the other.

Q: Do I need two KY-027 modules for the effect?
A: Yes — the magic cup illusion requires both modules working together. One module's tilt triggers the other's LED to brighten as the first dims, which is why the KY-027 is typically sold or used as a pair.

Package Contents: 2 × KY-027 Magic Light Cup Sensor Module

Warning: These modules contain mercury switches. Handle with care and dispose of responsibly according to local regulations. Not suitable for children.
16 other products in the same category:
Product added to wishlist
Product added to compare.