• Your position
  • Sign In or Join Free
Your position: Home / Sensors

Free shipping !Keyestudio Knock Sensor Module compatible with Arduino

KS0024
Sold:2
Price:
Wholesale:
5+
$2.38
    Please select the information you wantX
Quantity:
-
+
(964 available)
Shipping Cost:
to
Estimated Delivery Time:
Please select the country you want to ship from
  • Description
  • Reviews

KS0024 (1)KS0024 (2)KS0024 (3)KS0024 (4)KS0024 (5)

Introduction
 
This module is a knock sensor. When you knock it, it can send a momentary signal. We can combine it with Aduino to make some interesting experiment, e.g. electronic drum
 
Specification
 
Working voltage: 5V
 

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);

}

}

 
 
Average rating: 5.0
Share your thoughts with other customers
Write a review
Product reviews can be carried out after the member login, please click here to login