Ks0024 keyestudio Knock Sensor Module: Difference between revisions
Jump to navigation
Jump to search
Keyestudio (talk | contribs) No edit summary |
Keyestudio (talk | contribs) No edit summary |
||
| Line 37: | Line 37: | ||
}</pre> | }</pre> | ||
== | ==Resources == | ||
'''Video''' | |||
http://www.keyestudio.com/wp/2016/05/ks0024-keyestudio-knock-sensor/ | http://www.keyestudio.com/wp/2016/05/ks0024-keyestudio-knock-sensor/ | ||
'''Datasheet''' | |||
http://www.keyestudio.com/files/index/download/id/1463649536/ | |||
==Get One Now== | |||
http://www.keyestudio.com/keyestudio-knock-sensor-module.html | |||
https://www.amazon.com/Keyestudio-Sensor-Module-Arduino-raspberry/dp/B016ZWRK1I/ref=sr_1_1?srs=13497667011&ie=UTF8&qid=1479870736&sr=8-1&keywords=keyestudio+Knock+Sensor+Module | |||
[[Category: Sensor]] | [[Category: Sensor]] | ||
Revision as of 11:15, 23 November 2016
Introduction
This module is a knock sensor. When you knock it, it can send a momentary signal. We can combine it with Arduino to make some interesting experiment, e.g. electronic drum.

Specification
- Working Voltage: 5V
- Size: 30*20mm
- Weight: 3g
Connection Diagram
Sample Code
int Led=13;//define LED interface
int Shock=3//define knock sensor interface
;int val;//define digital variable val
void setup()
{
pinMode(Led,OUTPUT);//define LED to be output interface
pinMode(Shock,INPUT);//define knock sensor to be output interface
}
void loop()
{
val=digitalRead(Shock);//read the value of interface3 and evaluate it to val
if(val==HIGH)//when the knock sensor detect a signal, LED will be flashing
{
digitalWrite(Led,LOW);
}
else
{
digitalWrite(Led,HIGH);
}
Resources
Video
http://www.keyestudio.com/wp/2016/05/ks0024-keyestudio-knock-sensor/
Datasheet
http://www.keyestudio.com/files/index/download/id/1463649536/
Get One Now
http://www.keyestudio.com/keyestudio-knock-sensor-module.html