As the name suggests the Knock Sensor Module produces the Digital output on the detection of Knock i.e. vibration stroke. Further, the change in voltage level can be manipulated to produce the desired output and can be used in a variety of applications. RoboticsBD
Code Example for Arduino Board:
int Led = 13 ;// Declaration of the LED output pin
int Sensor = 10; // Declaration of the sensor input pin
int val; // Temporary variable
void setup ()
{
pinMode (Led, OUTPUT) ; // Initialization output pin
pinMode (Sensor, INPUT) ; // Initialization sensor pin
}
void loop ()
{
val = digitalRead (Sensor) ; // The current signal at the sensor will be read
if (val == HIGH) // If a signal was detected , the LED will light up
{
digitalWrite (Led, LOW);
}
else
{
digitalWrite (Led, HIGH);
}
}
Connections with Arduino:
- LED +: [Pin 13]
- LED -: [Pin GND]
- Sensor signal: [Pin 10]
- Sensor +V: [Pin 5V]
- Sensor -: [Pin GND] RoboticsBD
Code Example for Raspberry Pi:
# Needed modules will be imported and configured
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# The input pin of the sensor will be declared. Additional to that the pull up resistor will be activated
GPIO_PIN = 24
GPIO.setup(GPIO_PIN, GPIO.IN)
print "Sensor-Test [press ctrl+c to end]"
# This output function will be started at signal detection
def outFunction(null):
print("Signal detected")
# At the moment of detection a signal (falling signal edge) the output function will be activated.
GPIO.add_event_detect(GPIO_PIN, GPIO.FALLING, callback=outFunction, bouncetime=100)
# main program loop
try:
while True:
time.sleep(1)
# Scavenging work after the end of the program
except KeyboardInterrupt:
GPIO.cleanup()
Connections with Raspberry Pi:
- Signal: GPIO24[Pin 18]
- +V: 3,3V[Pin 1]
- GND: GND[Pin 6]
Specifications and Features:
- Detect shocks with the spring and send a signal to Controller Board
- Operating voltage: 3.3V-5V
- Digital output
- Bolt holes for easy installation. RoboticsBD
General Specification |
Operating voltage (v) |
3.3 ~ 5 |
Default Output |
High |
Output Type |
Digital |
Length (mm) |
19.5 |
Width (mm) |
16 |
Height (mm) |
7.5 |
Weight (gm) |
1 |
Shipment Weight |
0.01 kg |
Shipment Dimensions |
4 × 2 × 1 cm |
Package Includes:
1 x The Knock Sensor Module.
What is the price of Knock Sensor Module KY-031 For Arduino, PIC, AVR and Raspberry pi in Bangladesh?
The latest price of Knock Sensor Module KY-031 For Arduino, PIC, AVR and Raspberry pi in Bangladesh is BDT 99 You can buy the Knock Sensor Module KY-031 For Arduino, PIC, AVR and Raspberry pi at best price from our RoboticsBD or visit RoboticsBD Office.
Please note that the product information provided on our website may not be entirely accurate as it is collected from various sources on the web. While we strive to provide the most up-to-date information possible, we cannot guarantee its accuracy. We recommend that you always read the product labels, warnings, and directions before using any product.
|
Product Images are shown for illustrative purposes only and may differ from the actual product.
|