•  Telephone: 9700399009
  •  E-mail: contact@robozone.in
  • My Account
      • Login
    • My Account
    • My Cart
    • Checkout
My Wishlist
Robozone
  • Home
  • Shop
  • My Account
    • Cart
    • About Us
  • Track your order
  • Refund Or Replacement Policy
    • Shipping And Refund Policy
  • Privacy Policy
0 item
Categories
  • Arduino
  • Display Devices
  • Drone Parts
  • Electronics Components
  • ESP – Chip, Modules
  • ICs
  • Microcontrollers
  • Modules
  • Motors
  • Raspberry Pi
  • Relay
  • Robotics
  • Sensors
  • Shields
  • SMD Components
  • Home
  • Sensor
  • Magic Cup Titlt Switch Module

Related products

mini-pir-motion-sensor-hc-sr312-800x800

Mini PIR Motion Detection Sensor HC-SR505

₹210.00

Capacitive-Soil-Moisture-Sensor-V2-1

Capacitive Soil Moisture Sensor V2.0

₹179.00

DS18B20 Temperature Sensor Module For Arduino – ROBOZONE

₹249.00 ₹208.00

Recommended Products
1

Water Level Depth Detection Sensor Module – ROBOZONE

Water Level Depth

Water Level Depth Detection Sensor Module – ROBOZONE

0 Review(s)
₹59.00 ₹46.00
2

1602 16×2 LCD Display with I2C/IIC interface – Blue Backlight – ROBOZONE

16x2 LCD Display with I2C

1602 16×2 LCD Display with I2C/IIC interface – Blue Backlight – ROBOZONE

0 Review(s)
₹199.00 ₹186.00
3

16mm Telephoto Lens for Raspberry Pi High Quality Camera – ROBOZONE

16mm Telephoto Lens for Raspberry Pi

16mm Telephoto Lens for Raspberry Pi High Quality Camera – ROBOZONE

0 Review(s)
₹4,999.00 ₹3,999.00
4

6mm Wide Angle Lens for Raspberry Pi High Quality Camera – ROBOZONE

6mm Wide Angle Lens for Raspberry Pi

6mm Wide Angle Lens for Raspberry Pi High Quality Camera – ROBOZONE

0 Review(s)
₹2,100.00 ₹1,970.00
5

Raspberry Pi High Quality Camera with Interchangeable Lens Base – ROBOZONE

Raspberry Pi High Quality Camera with Interchangeable Lens

Raspberry Pi High Quality Camera with Interchangeable Lens Base – ROBOZONE

0 Review(s)
₹4,599.00 ₹3,999.00

Magic Cup Titlt Switch Module

0 Review(s)
Availability: In stock

Category: Sensor
  • Description
  • Reviews (0)

Description

Description

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

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Sign up and Save!

Receive email-only deals, special offers & product exclusives

My Account

My Account

Wishlist

Cart

Checkout

Information

Track your order

Contact Us

Privacy Policy

Replacement Policy

Why Choose Us

About us

Shipping Policy

Cancellation Policy

Policies

Privacy policy

2020 @ robozone.in all rights reserved |
Close
Sign in Or Register
Forgot your password?

NEW HERE?

Registration is free and easy!

  • Faster checkout
  • Save multiple shipping addresses
  • View and track orders and more
Create an account
Or
x
  • Menu
  • Categories
  • Home
  • Shop
  • My Account
    • Cart
    • About Us
  • Track your order
  • Refund Or Replacement Policy
    • Shipping And Refund Policy
  • Privacy Policy
  • Arduino
  • Display Devices
  • Drone Parts
  • Electronics Components
  • ESP – Chip, Modules
  • ICs
  • Microcontrollers
  • Modules
  • Motors
  • Raspberry Pi
  • Relay
  • Robotics
  • Sensors
  • Shields
  • SMD Components