3.3V to 5V
3.3V to 5V
10mA to 20mA
10mV/g to 100mV/g (adjustable)
0Hz to 5kHz
10-bit to 16-bit (depending on the output format)
Digital output (I2C, SPI, or UART)
-20C to 80C
-40C to 125C
Applications
Conclusion
The Vibration Sensor Module is a versatile and accurate component for detecting and measuring vibrations in various applications. Its compact design, low power consumption, and adjustable sensitivity make it an ideal choice for IoT projects and industrial automation systems.
Vibration Sensor Module DocumentationOverviewThe Vibration Sensor Module is a compact, low-cost sensor designed to detect vibrations or shocks in a variety of applications, including industrial automation, robotics, and IoT projects. This module is based on a piezoelectric sensor that generates an electrical signal in response to mechanical stress, such as vibrations or impacts.Pinout and SpecificationsOperating Voltage: 3.3V - 5V
Detection Range: 0.5g - 10g
Sensitivity: 100mV/g
Output Signal: Analog (0-5V)
Dimensions: 12mm x 12mm x 5mmCode Examples### Example 1: Basic Vibration Detection with ArduinoIn this example, we'll use an Arduino Uno board to read the vibration sensor's output and trigger an LED when a vibration is detected.
```c
const int vibrationPin = A0; // Analog input pin for vibration sensor
const int ledPin = 13; // Digital output pin for LEDvoid setup() {
pinMode(vibrationPin, INPUT);
pinMode(ledPin, OUTPUT);
}void loop() {
int sensorValue = analogRead(vibrationPin);
if (sensorValue > 500) { // Adjust this threshold value based on your application
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(50); // Debouncing delay
}
```
### Example 2: Vibration Monitoring with Raspberry Pi (Python)In this example, we'll use a Raspberry Pi to read the vibration sensor's output and display the vibration intensity on a GUI using Python and Matplotlib.
```python
import RPi.GPIO as GPIO
import matplotlib.pyplot as plt
import time# Set up GPIO mode
GPIO.setmode(GPIO.BCM)# Define vibration sensor pin
vibration_pin = 17# Set up vibration sensor as an analog input
GPIO.setup(vibration_pin, GPIO.IN)while True:
# Read vibration sensor value
sensor_value = GPIO.input(vibration_pin)
# Convert sensor value to a meaningful vibration intensity
vibration_intensity = sensor_value 5 / 1024 # Assuming 5V analog output
# Display vibration intensity on GUI
plt.plot(vibration_intensity)
plt.xlabel('Time')
plt.ylabel('Vibration Intensity (g)')
plt.show(block=False)
plt.pause(0.1)
plt.cla()
time.sleep(0.1)
```
### Example 3: Vibration-based Alarm System with ESP32 (MicroPython)In this example, we'll use an ESP32 board to create a vibration-based alarm system that sends an SMS notification when a vibration is detected.
```python
import machine
import urequests
import time# Set up vibration sensor pin
vibration_pin = 32# Set up vibration sensor as an analog input
adc = machine.ADC(vibration_pin)while True:
# Read vibration sensor value
sensor_value = adc.read_u16()
if sensor_value > 500: # Adjust this threshold value based on your application
# Send SMS notification using urequests library
urequests.post('https://api.example.com/send_sms', json={'message': 'Vibration detected!'})
print('Vibration detected! SMS sent.')
time.sleep(10) # Debouncing delay
time.sleep(0.1)
```
These examples demonstrate the basic usage of the Vibration Sensor Module in various contexts. Please adjust the threshold values and sensor calibration based on your specific application requirements.