• +965 51122049
Hit/Knock Vibration sensor module

Hit/Knock Vibration sensor module

KWD1.250KWD1.250
0%Off

Hit/Knock Vibration sensor module


 

 


  • SKU: 350222
Share:

The vibration sensor consists of a spring connected to one contact and a pin inside the spring connected to the other contact. Vibration of the spring will cause the spring to come into contact with the pin, closing the switch circuit briefly.
The surface mount resistor (103 = 10K ohms) pulls the signal pin up to +5V. When the contacts close, the signal pin is pulled to ground.

 

Example Code

int Led = 13 ; // define LED Interface
int Shock = 3 // define the percussion Sensor Interface
int val ; // define numeric variables val
 
void setup ()
{
  pinMode (Led, OUTPUT) ; // define LED as output interface
  pinMode (Shock, INPUT) ; // define knock sensor output interface
}
void loop ()
{
  val = digitalRead (Shock) ; // read digital interface is assigned a value of 3 val
  if (val == HIGH) // When the percussion when the sensor detects a signal, LED flashes
  {
    digitalWrite (Led, LOW);
  }
  else
  {
    digitalWrite (Led, HIGH);
  }
}

Add your review

Your email address will not be published. Required fields are marked *

Please login to write review!

Upload photos

Looks like there are no reviews yet.

Related Products