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

From Keyestudio Wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
==EASY plug Digital Tilt Sensor Module ==
[[image:ks0115图.jpg|thumb|600px|right|Keyestudio EASY plug Tilt Sensor Module ]]
<br>[[File:ks0115-1.png|500px|frameless|thumb]]<br>


==Introduction==
==Introduction==
Tilt Sensor is a digital tilt switch. It can be used as a simple tilt sensor. Simply plug it to our IO/Sensor shield; you can make amazing interactive projects. With dedicated sensor shield and Arduino, you can achieve interesting and interactive work.<br>
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. <br>
Note: this module needs to be used together with EASY plug control board.<br>
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.  <br>
Here is the principle of tilt sensor to illustrate how it works:<br>
<br>[[File:ks0115 works.jpg|600px|frameless|thumb]]<br>
<br>


<span style=color:red> '''Special Note:''' <br>
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface. <br> If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module. </span><br>


==Specification==
<br>
* Interface: Easy plug
 
==Features==
* Connector: Easy plug
* Supply Voltage: 3.3V to 5V
* Supply Voltage: 3.3V to 5V
* Sensor type: Digital
* Sensor type: Digital
* Size: 39*20mm
<br>
* Weight: 5g
 
==Technical Details==
* Dimensions: 39mm*20mm*18mm
* Weight: 4.8g
 
<br>
==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.
<br>[[File:倾斜灯.jpg|600px|frameless|thumb]]<br>
 
<br>
==Upload the Code==
Below is an example code. Open or drag below code to [https://wiki.keyestudio.com/Getting_Started_with_Mixly  Mixly Blocks] and upload. <br>
<br>[[File:ks0397 13.1.png|600px|frameless|thumb]]<br>
 
<br>
 
==What You Should See==
<br>[[File:ks0397 13-1.png|600px|frameless|thumb]]<br>
<br>
Done uploading the code, if tilt the sensor, you should see the led state ON or OFF. 
<br>[[File:ks0397 13-2.png|600px|frameless|thumb]]<br>
<br>[[File:ks0397 13-3.png|650px|frameless|thumb]]<br>


==Connection Diagram ==
<br>[[File:ks0115-2.png|500px|frameless|thumb]]<br>


<br>


==Sample Code==
==Extension Experiment==
<pre>
<br>
int ledPin = 13;                // Connect LED to pin 13
<span style=color:brown><big>'''Controlling Two Lights'''</big> </span><br>
int switcher = 10;                // Connect Tilt sensor to Pin10
Next, how to use tilt sensor to control two lights on and off. Let’s get started right now!<br>
void setup()
<br>
{
'''Hookup Guide'''<br>
pinMode(ledPin, OUTPUT);      // Set digital pin 13 to output mode
Connect the EASY Plug tilt sensor and two LED modules to control board using an RJ11 cable. <br>
pinMode(switcher, INPUT);      // Set digital pin 10 to input mode
<br>[[File:倾斜两灯.png|600px|frameless|thumb]]<br>
}
<br>
void loop()
{
 
  if(digitalRead(switcher)==HIGH) //Read sensor value
    {
      digitalWrite(ledPin, HIGH);  // Turn on LED when the sensor is tilted
    }
  else
    {
      digitalWrite(ledPin, LOW);    // Turn off LED when the sensor is not triggered
    }
}
</pre>


'''Upload the Code'''<br>
Below is an example code.<br>
<br>[[File:ks0397 13.2.png|600px|frameless|thumb]]<br>
<br>
'''What You Should See'''<br>
<br>[[File:ks0397 13-4.jpg|600px|frameless|thumb]]<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.
<br>[[File:ks0397 13-6.png|600px|frameless|thumb]]<br>
<br>[[File:ks0397 13-5.png|600px|frameless|thumb]]<br>
<br>
<br>
==Resources ==
==Resources ==


'''PDF'''
https://fs.keyestudio.com/KS0115


https://drive.google.com/open?id=11zcE-Avm45q59CnFpU486L5WpoqgaPB9
<br>


==Buy from ==
==Buy from ==
'''Official Website'''
*[https://www.keyestudio.com/new-keyestudio-easy-plug-digital-tilt-sensor-module-for-arduino-starter-steam-p0089-p0089.html  '''Official Website''']
 
*[https://www.aliexpress.com/store/product/New-Keyestudio-EASY-plug-Digital-Tilt-Sensor-Module-for-Arduino-Starter/1452162_32641882185.html?spm=2114.12010612.8148356.32.10904ba7S3qhWP  Shop on aliexpress]


http://www.keyestudio.com/keyestudio-easy-plug-digital-tilt-sensor-module-for-arduino-starter.html


[[category:EASY Plug]]
[[category:EASY Plug]]

Latest revision as of 16:15, 7 January 2021

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

Special Note:
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface.
If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module.


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

https://fs.keyestudio.com/KS0115


Buy from