Product Introduction #
The vibration sensor adopts SW-18010P high sensitive vibration switch, a kind of spring non-directional vibration sensing device, which can be triggered at any Angle.
When the module is static without vibration, the two internal pins are disconnected, and the signal S port will output a high level.
When subjected to external force collision or shaking vigorously, spring deformation and central electrode contact conduction make two pins instantaneous conduction state, signal S port will output low level. When the external force disappears, the circuit resumes to the disconnected state, and the signal S port will output a high level.
Application reference: security system, smart home, vehicle anti-theft system, etc.
Parameter Specification #
Parameters | Value/Description |
Operating voltage | 3.3~5V |
Operating temperature | -20°C~+70°C |
Output signal | Digital signal |
Size | 3.16cm*2.38cm |
Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.
Vibration Sensor | ESP32 |
VCC | 5V |
GND | GND |
Sign | Pin 32 |
Sample Code #
void setup() {
pinMode(32,INPUT);//Set pin 32 to input mode
Serial.begin(115200);//Set baud rate to 115200
}
void loop() {
Serial.println(digitalRead(32));//Read the state of pin 32 and print it to the serial monitor
delay(1000);
}
Note: If you are using an Arduino board, then change the pin in the program to PIN7, set the baud rate to 9600, and then connect the hardware pin to PIN7 and upload the program.
Test Results #
After uploading the code to the controller board, open the serial port monitor of the Arduino IDE, set the baud rate to 115200, and switch to the scroll mode.
When we shake the vibration sensor, it returns 0; When we don’t shake it, the sensor returns 1.
Note: The SW-18010P pin is relatively thin, do not break it, just shake the test.
When the vibration sensor is shaking, it is instantly on and then off, so the data 0 May be difficult to capture.
Related Resources #
Get One Now #
B2B Business: info@acebott.com
Official Website: Ceramics Vibration Sensor