Reference: RBD-3644
Banner

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. Featured By RoboticsBD.
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. Featured By RoboticsBD.
Product Images are shown for illustrative purposes only and may differ from the actual product.
Note: Product images/ Components brand may vary from actual product as our stock rotates.
Note: PCB might be different from the picture as per stock

| General Specification | |
| Operating Voltage (VDC) | 3.3 ~ 5 |
| Length (mm) | 22 |
| Width (mm) | 24 |
| Height (mm) | 25 |
| Weight (gm) | 2 |
| Shipment Weight | 0.005 kg |
| Shipment Dimensions | 12 × 8 × 2.5 cm |
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. Featured By RoboticsBD.
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);
}
1 x Magic Cup Light Module
Specific References
Your review appreciation cannot be sent
Report comment
Report sent
Your report cannot be sent
Write your review
Review sent
Your review cannot be sent
Reference: RBD-3644
Reference: RBD-1675
Reference: RBD-2094
Reference: RBD-1348
We'll slide into your inbox when the product is back in stock.
Reference: RBD-1383
Reference: RBD-0680
Reference: RBD-1227
Reference: RBD-3598
Reference: RBD-0686
Reference: RBD-0816
Reference: RBD-1195
Reference: RBD-3733
Reference: RBD-3849
Reference: RBD-1813
Reference: RBD-4143
Reference: RBD-1197
Reference: 0245
Reference: RBD-0152
Reference: RBD-0672
Reference: RBD-0702
Reference: RBD-0755
Reference: RBD-0917
Reference: RBD-1367
Reference: RBD-0415
Reference: RBD-1811
Reference: RBD-1932
Reference: RBD-0151
Reference: RBD-2089
Reference: RBD-0152
Reference: RBD-2088
Reference: RBD-1740
Reference: RBD-2078
check_circle
check_circle