Ks0114 keyestudio EASY plug Knock Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==EASY plug Knock Sensor ==
[[image:ks0114图.jpg|thumb|600px|right|EASY plug Knock Sensor ]]
<br>[[File:ks0114-1.png|500px|frameless|thumb]]<br>


==Introduction==
==Introduction==
This module is a knock sensor. When you knock it, it can send a momentary signal. You can combine it with Arduino to make some interesting experiments, e.g. electronic drum.<br>
The knock sensor is mainly composed of SW-280 vibration switch, which is an inductive proximity switch. <br>
Note: this module needs to be used together with EASY plug control board.<br>
It is an electronic switch that transmits the sensing result to the circuit device and induces the circuit to start working when the vibration force is induced. <br>
The module comes with a positioning hole for you to fix it to other devices.<br>
You can make full use of it with creative thinking, like electronic drum, and so on. <br>
<span style="color: red">'''Note: ''' this module should be used together with EASY plug control board.<br>
<br>


==Specification==
==Features==
* Interface: Easy plug
* Connector: Easy plug
* Working voltage: 5V
* Working voltage: 5V
* Sensor type: digital
* Sensor type: Digital
* Size: 38*20mm
* Weight: 5g


<br>
==Technical Details==
* Dimensions: 38mm*20mm*18mm
* Weight: 4.4g
<br>


==Connection Diagram ==
==Connect It Up==
<br>[[File:ks0114-2.png|500px|frameless|thumb]]<br>
Connect the EASY Plug knock sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
<br>[[File:ks0114.jpg|500px|frameless|thumb]]<br>


 
<br>
==Sample Code==
==Upload the Code==
Copy and paste below code to Arduino IDE and upload.
<pre>
<pre>
int Led=13;//define LED interface
int Led=13;//define LED interface
Line 25: Line 33:
void setup()
void setup()
{
{
pinMode(Led,OUTPUT);//define LED to be output interface
pinMode(Led,OUTPUT);//define LED as output  
pinMode(Shock,INPUT);//define knock sensor to be output interface
pinMode(Shock,INPUT);//define knock sensor as output  
}
}
void loop()
void loop()
{
{
val=digitalRead(Shock);//read the value of interface8 and evaluate it to val
val=digitalRead(Shock);//read the value of interface8 and assign it to val
if(val==HIGH)//when the knock sensor detect a signal, LED will be flashing
if(val==HIGH)//when the knock sensor detect a signal, LED will flash.
{
{
digitalWrite(Led,LOW);
digitalWrite(Led,LOW);
Line 40: Line 48:
}
}
}
}
</pre>


</pre>
<br>
==What You Should See==
Done uploading the code, if knock the sensor hard, the led will be turned on.
<br>[[File:ks0114 Result.png|500px|frameless|thumb]]<br>


<br>
==Resources ==
==Resources ==
 
'''PDF'''<br>
'''PDF'''
 
https://drive.google.com/open?id=19tGbFz54E0AB3Z_fQj3OPQbwM9442keA
https://drive.google.com/open?id=19tGbFz54E0AB3Z_fQj3OPQbwM9442keA


<br>
==Buy from ==
==Buy from ==
'''Official Website'''
'''Official Website'''<br>
http://www.keyestudio.com/keyestudio-easy-plug-knock-sensor-module-for-arduino.html


http://www.keyestudio.com/keyestudio-easy-plug-knock-sensor-module-for-arduino.html


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

Revision as of 09:09, 23 November 2018

EASY plug Knock Sensor

Introduction

The knock sensor is mainly composed of SW-280 vibration switch, which is an inductive proximity switch.
It is an electronic switch that transmits the sensing result to the circuit device and induces the circuit to start working when the vibration force is induced.
The module comes with a positioning hole for you to fix it to other devices.
You can make full use of it with creative thinking, like electronic drum, and so on.
Note: this module should be used together with EASY plug control board.

Features

  • Connector: Easy plug
  • Working voltage: 5V
  • Sensor type: Digital


Technical Details

  • Dimensions: 38mm*20mm*18mm
  • Weight: 4.4g


Connect It Up

Connect the EASY Plug knock sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Copy and paste below code to Arduino IDE and upload.

int Led=13;//define LED interface
int Shock=8;//define knock sensor interface;
int val;//define digital variable val
void setup()
{
pinMode(Led,OUTPUT);//define LED as output 
pinMode(Shock,INPUT);//define knock sensor as output 
}
void loop()
{
val=digitalRead(Shock);//read the value of interface8 and assign it to val
if(val==HIGH)//when the knock sensor detect a signal, LED will flash.
{
digitalWrite(Led,LOW);
}
else
{
digitalWrite(Led,HIGH);
}
}


What You Should See

Done uploading the code, if knock the sensor hard, the led will be turned on.
thumb


Resources

PDF
https://drive.google.com/open?id=19tGbFz54E0AB3Z_fQj3OPQbwM9442keA


Buy from

Official Website
http://www.keyestudio.com/keyestudio-easy-plug-knock-sensor-module-for-arduino.html