Ks0115 keyestudio EASY plug Digital Tilt Sensor Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
Line 31: Line 31:


==What You Should See==
==What You Should See==
<br>[[File:ks0397 13-1.png|600px|frameless|thumb]]<br>
Done uploading the code, if tilt the sensor, you should see the led state ON or OFF.   
Done uploading the code, if tilt the sensor, you should see the led state ON or OFF.   
<br>[[File:ks0397 13-1.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13-2.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13-2.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13-3.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13-3.png|500px|frameless|thumb]]<br>
Line 38: Line 38:


<br>
<br>
====Extension Experiment====  
==Extension Experiment==
<br>
<br>
<span style=color:brown><big>'''Controlling Two Lights'''</big> </span><br>  
<span style=color:brown><big>'''Controlling Two Lights'''</big> </span><br>  
Line 44: Line 44:
<br>
<br>
'''Hookup Guide'''<br>
'''Hookup Guide'''<br>
Connect the EASY Plug tilt sensor and two LED modules to control board using an RJ11 cable.  
Connect the EASY Plug tilt sensor and two LED modules to control board using an RJ11 cable. <br>
<br>[[File:倾斜两灯.png|500px|frameless|thumb]]<br>
<br>[[File:倾斜两灯.png|500px|frameless|thumb]]<br>
<br>
<br>
Line 50: Line 50:
'''Upload the Code'''<br>
'''Upload the Code'''<br>
Below is an example code.<br>
Below is an example code.<br>
<br>[[File:ks0397 13.2.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13.2.png|600px|frameless|thumb]]<br>


<br>
<br>
'''What You Should See'''<br>
'''What You Should See'''<br>
<br>[[File:ks0397 13-4.jpg|500px|frameless|thumb]]<br>
<br>[[File:ks0397 13-4.jpg|600px|frameless|thumb]]<br>
<br>
<br>
Upload success, if tilt the sensor to one side, you should see one led is turned on; if tilt toward another side, another led is turn on.
Upload success, if tilt the sensor to one side, you should see one led is turned on; if tilt toward another side, another led is turn on.
Line 63: Line 63:


<br>
<br>
==Resources ==
==Resources ==
'''Download the Arduino Code and PDF:'''<br>
'''Download the Arduino Code and PDF:'''<br>

Revision as of 09:33, 7 May 2019

Keyestudio EASY plug Tilt Sensor Module

Introduction

The tilt-switch twig is the equivalent of a button, and is used as a digital input. Inside the tilt switch is a ball that make contact with the pins when the case is upright. Tilt the case over and the balls don't touch, thus not making a connection.
When the switch is level it is open, and when tilted, the switch closes. It can be used for orientation detection, alarm device or others.
Here is the principle of tilt sensor to illustrate how it works:

thumb


Features

  • Connector: Easy plug
  • Supply Voltage: 3.3V to 5V
  • Sensor type: Digital


Technical Details

  • Dimensions: 39mm*20mm*18mm
  • Weight: 4.8g


Connect It Up

Connect the EASY Plug Tilt sensor and LED module to control board using RJ11 cables. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Below is an example code. Open or drag below code to Mixly Blocks and upload.

thumb


What You Should See


thumb
Done uploading the code, if tilt the sensor, you should see the led state ON or OFF.
thumb

thumb



Extension Experiment


Controlling Two Lights
Next, how to use tilt sensor to control two lights on and off. Let’s get started right now!

Hookup Guide
Connect the EASY Plug tilt sensor and two LED modules to control board using an RJ11 cable.

thumb

Upload the Code
Below is an example code.

thumb


What You Should See

thumb

Upload success, if tilt the sensor to one side, you should see one led is turned on; if tilt toward another side, another led is turn on.
thumb

thumb



Resources

Download the Arduino Code and PDF:
https://drive.google.com/open?id=1WSOFEl7LGGqPR0B7Jd4e_pCxKEZqOnvq

Download the Mixly Code and Datasheet:
https://drive.google.com/open?id=1tBPKJVBgSAY4b1QfW6PSl18d2H5khZdb



Buy from