0% found this document useful (0 votes)
9 views2 pages

Hit Sensor Module

The Hit Sensor Module, also known as a knock switch, outputs a high-level signal when hit. It operates at 5V, has a 3-pin configuration, and measures 24.5mm by 15.5mm with a weight of 1.604g. An example code is provided to demonstrate how to use the module to light an LED when a knock is detected.

Uploaded by

pacho_1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Hit Sensor Module

The Hit Sensor Module, also known as a knock switch, outputs a high-level signal when hit. It operates at 5V, has a 3-pin configuration, and measures 24.5mm by 15.5mm with a weight of 1.604g. An example code is provided to demonstrate how to use the module to light an LED when a knock is detected.

Uploaded by

pacho_1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hit Sensor Module

DESCRIPTION:
This module also called knock switch, if you hit this module, the signal pin would pinout High
level signal.

Specification:
● Operation voltage: 5V
● 3Pin
● Size:24.5*15.5mm
● Weight: 1.604g

PIN CONFIGURATION:
1、“S”: Digital signal input pin, if it detect a knock,it output High level
2、 “+” : +5V
3、 “-”: Ground

Example:
This example shows you how to use this module to catch a hit, which is different to
the shock. If you hit this module, the LED13 will light on.
The connection as below:

1/2
Code:

int Led=13;
int Shock=3;
int val;
void setup()
{
pinMode(Led,OUTPUT);
pinMode(Shock,INPUT);
}
void loop()
{
val=digitalRead(Shock);
if(val==HIGH)
{
digitalWrite(Led,LOW);
}
else
{
digitalWrite(Led,HIGH);
}
}

2/2

You might also like