Skip to main content

Worldwide Shipping · Secure Payments

At a glance

This vibration/tilt sensor and modules is a good fit for makers, students and electronics hobbyists. Main specs: model no. / name Tilt Sensor Module; operating voltage (vdc) 3.3 to 5; length (mm) 22. Check that your power source supplies 3.3 to 5 before connecting it.

Key Highlights

  • Model No. / Name: Tilt Sensor Module
  • Operating Voltage (VDC): 3.3 to 5
  • Length (mm): 22

Ideal For

  • Arduino, ESP32 and Raspberry Pi projects
  • School and college lab work
  • Prototypes and test rigs

Buying Tip

Compare the pin layout and operating voltage with your circuit, and order a spare or two: small parts are easy to damage while soldering.

Specifications

Model No. / NameTilt Sensor Module
Operating Voltage (VDC)3.3 to 5
Length (mm)22
Width (mm)24
Weight (g)2
Shipping Weight0.005 kg
Shipping Dimensions7 × 6 × 4 cm

Overview

The Magic Cup Tilt Switch Sensor Module is listed in our vibration/tilt sensor and modules range and suits makers, students and electronics hobbyists. The notes below explain the main specifications and what to check before you order.

Specifications explained

  • Model No. / Name: Tilt Sensor Module
  • Operating Voltage (VDC): 3.3 to 5 (match this to your power supply; too high a voltage can damage the part)
  • Length (mm): 22 (measure your mounting space before ordering)
  • Width (mm): 24 (measure your mounting space before ordering)
  • Weight (g): 2 (important for drones, RC models and anything you carry)
  • Shipping Weight: 0.005 kg (important for drones, RC models and anything you carry)
  • Shipping Dimensions: 7 × 6 × 4 cm (measure your mounting space before ordering)

Before you order

Compare the specifications with your project or device, and check delivery times and return terms for your country in our help centre. Questions about this item? Email [email protected] with the product code.

Magic Light Cup Module is a board which has a led and a mercury tilt switch. Using PWM to drive the LEDs on the module you can achieve the effect of light being "magically" transferred from one module to the other when tilting them. In short, it’s 2 components combined, a mercury tilt switch and a led. On tilting the module mercury inside small tube connect the switching point and make switch ON while tilting it to other side move the mercury and it disconnects the circuit and switch get OFF. The module operates on 5V DC supply.

So the magic in the name of this module is because when you tilt the switch, the led will turn on and off. And Of course, it is also possible to connect it to the NodeMCU.

Pin Connection with Arduino:
  1. G: GND
  2. +:  5v DC
  3. S:  Arduino pin 8
  4. L: Arduino pin 9
Pin Connection with Node MCU:
  1. Connect G to a GND port of your NodeMCU
  2. Connect + to a 3.3v port of your NodeMCU
  3. Connect S to a digital port on your NodeMCU (in my example port D3)
  4. Connect L to a digital port on your NodeMCU (in my example port D5)

Connection Diagram:
Magic Cup Light Module for Arduino
Arduino Example Code
In this Arduino sketch, we'll use two Switching modules to create the magic light cup effect. The mercury switches in each module provide a digital signal that is used to regulate the brightness of the LEDs using PWM. Tilting the modules will decrease the brightness on one module while increasing it on the other one, creating the illusion of light magically passing from one module to the other.
int ledPinA = 9;
int switchPinA = 8;
int switchStateA = 0;
int ledPinB = 6;
int switchPinB = 7;
int switchStateB = 0;
int brightness   = 0;

void setup() 
{
  pinMode(ledPinA, OUTPUT); 
  pinMode(ledPinB, OUTPUT);  
  pinMode(switchPinA, INPUT); 
  pinMode(switchPinB, INPUT);
}

void loop() 
{
  switchStateA = digitalRead(switchPinA);
  if (switchStateA == HIGH && brightness != 255)
  { 
   brightness ++;
  } 
  switchStateB = digitalRead(switchPinB);
  if (switchStateB == HIGH && brightness != 0)
  { 
   brightness --;
  } 
  analogWrite(ledPinA, brightness);  //  A slow fade out
  analogWrite(ledPinB, 255 - brightness);  // B slow bright up
  delay(20);
}

Package Includes:

1 x Magic Cup Light Module

Quick specs

Model No. / Name
Tilt Sensor Module
Operating Voltage (VDC)
3.3 to 5
Length (mm)
22
Width (mm)
24
Weight (g)
2
Shipping Weight
0.005 kg
See all specifications