Magic Light Cup Module Ky-027 Interfacing
with Arduino, Node MCU, ESP32
The mercury tilt sensor is a tilt sensor which opens and closes an electrical circuit when it is inclined beyond a certain angle. It can be primarily used in tilt prevention machinery beds where large motors, generators and turbines are installed. Slight tilt of machinery could cause wear and tear of bearings. There are different types of tilt switch sensor modules for sensing the tilt and module can have a ball switch or mercury witch.
Using PWM to drive the LEDs on each module, you can achieve the effect of light being “magically” transferred from one module to the other when tilting them, similar to pouring water from one cup to the other, hence the name. It has a glass tube consists of two electrodes and liquid mercury ball. The liquid mercury ball closes and opens the circuit when inclined in a particular direction.
Magic Light Cup Module Ky-027 Interfacing with Arduino, Node MCU, ESP32
Mercury based tilt sensor has four terminals of which VCC and GND are connected to 5 volt of DC terminal and ground of Arduino. The third pin Signal out is connected to any digital Pin of Arduino say Pin 7. Apart from the above there are two LEDs and one Buzzer to be connected. The green LED is connected to Pin 2 of Arduino to indicate the power on condition of Arduino. The Red LED is connected to Pin 3 and Buzzer is connected to Pin 4 of Arduino. Both Red LED and Buzzer will switch on when Signal connected to Pin 7 goes High.
Magic Light Cup Module Ky-027 Interfacing with Node MCU:
Mercury based tilt sensor has four terminals of which VCC and GND are connected to 3.3 volt of DC terminal and ground of Node MCU. The third pin Signal out is connected to any digital Pin of Node MCU say Pin GPIO7. Apart from the above there are two LEDs and one Buzzer to be connected. The green LED is connected to Pin GPIO2 of Node MCU to indicate the power on condition of Node MCU. The Red LED is connected to Pin GPIO3 and Buzzer is connected to Pin GPIO4 of Node MCU. Both Red LED and Buzzer will switch on when Signal connected to Pin GPIO7 goes High.
Magic Light Cup Module Ky-027 Interfacing with ESP32:
Mercury based tilt sensor has four terminals of which VCC and GND are connected to 3.3 volt of DC terminal and ground of ESP32. The third pin Signal out is connected to any digital Pin of ESP32 say Pin GPIO7. Apart from the above there are two LEDs and one Buzzer to be connected. The green LED is connected to Pin GPIO2 of ESP32 to indicate the power on condition of ESP32. The Red LED is connected to Pin GPIO3 and Buzzer is connected to Pin GPIO4 of ESP32. Both Red LED and Buzzer will switch on when Signal connected to Pin GPIO7 goes High.