The shock switch sensor detects impact, shock, or shaking. The module consists of a conductive vibration spring and a resistor, and when it detects a vibration, it will close the circuit, producing a LOW output signal (The default signal is HIGH).
Code example for shock switch module
Upload the code to Arduino. Test the shock switch module by tapping the shock sensor. If the module detects shock or vibration, the led lights on.