Arduino Uno SW-420: Industrial Vibration Monitoring System
Professional SW-420 vibration module integrates spring-mass piezoelectric sensor with LM393 comparator providing digital threshold output (0.1-5g adjustable via blue pot) and analog vibration strength (A0). 10-1000Hz frequency response captures bearing faults, impacts, and machinery imbalance with <1ms response time.
Interrupt pin 2 captures instantaneous shock events while A0 analog provides RMS vibration velocity (mm/s RMS) for trend analysis. 3.3-5V operation, <10μA quiescent current enables continuous predictive maintenance monitoring.
Production Vibration Sensing Components
- Arduino UNO R3 interrupt capable (pin 2)
- SW-420 Vibration Sensor Module (spring-mass)
- Male-to-male jumper wires (4 pieces)
- 220Ω status LED + piezo buzzer driver
- SD card module for trend logging
- Heavy-duty mounting bracket (IP65)
Dual Digital/Analog Vibration Interface
VCC: Arduino 5V (3.3-5V tolerant)
GND: Arduino GND
DO: Arduino Digital Pin 2 (HIGH = vibration > threshold)
A0: Arduino Analog Pin A0 (vibration strength 0-1023)
// Arduino Uno SW-420 Vibration Sensor - Industrial Condition Monitoring
// Pin 2: Interrupt (shock events), A0: RMS vibration trend
const int vibPin = 2;
const int analogPin = A0;
const int alarmPin = 8;
const int statusLed = 13;
volatile bool vibrationEvent = false;
volatile unsigned long eventTime = 0;
int eventCount = 0;
float rmsTrend[100]; // Rolling RMS buffer
int rmsIndex = 0;
void setup() {
Serial.begin(9600);
pinMode(vibPin, INPUT);
pinMode(analogPin, INPUT);
pinMode(alarmPin, OUTPUT);
pinMode(statusLed, OUTPUT);
attachInterrupt(digitalPinToInterrupt(vibPin), vibrationISR, RISING);
Serial.println("=== SW-420 Vibration Condition Monitor Active ===");
Serial.println("gRMS | Events | Threshold | Status");
Serial.println("-------------------------------------------");
}
void loop() {
// Rolling RMS vibration trend
int rawVib = analogRead(analogPin);
rmsTrend[rmsIndex] = rawVib / 10.23; // Convert to gRMS
rmsIndex = (rmsIndex + 1) % 100;
float avgRMS = 0;
for(int i=0; i<100; i++) avgRMS += rmsTrend[i];
avgRMS /= 100;
Serial.printf("RMS: %6.2fg | Events: %3d | Threshold: %4.1fg | ",
avgRMS, eventCount, 2.5);
if(vibrationEvent) {
unsigned long duration = millis() - eventTime;
Serial.println("*** SHOCK EVENT! ***");
vibrationEvent = false;
digitalWrite(alarmPin, HIGH);
tone(9, 2000 + (eventCount % 5)*200, 300);
digitalWrite(statusLed, HIGH);
} else {
digitalWrite(alarmPin, LOW);
digitalWrite(statusLed, LOW);
Serial.println("OK");
}
// High RMS trend alarm
if(avgRMS > 2.5) {
Serial.println("*** TREND ALARM - Imminent failure ***");
tone(9, 1500, 500);
}
delay(500);
}
void vibrationISR() {
eventTime = millis();
eventCount++;
vibrationEvent = true;
}
Interrupt-Driven Production Deployment
Upload predictive maintenance monitor. Tap sensor verifying <1ms interrupt response. Blue pot tunes 0.1-5g threshold.
Dual alarms: instantaneous shocks + RMS trend analysis for bearing/alignment faults.
Advanced Multi-Axis Vibration Array
// X/Y/Z axis vibration (pins 2,3,A0)
const int vibPins[] = {2,3,A1};
float axisRMS[3];
void loop() {
for(int i=0; i<3; i++) {
axisRMS[i] = analogRead(vibPins[i]) / 10.23;
Serial.printf("Axis %c: %.2fg | ", 'X'+i, axisRMS[i]);
}
float totalVib = sqrt(axisRMS[0]*axisRMS[0] +
axisRMS[1]*axisRMS[1] +
axisRMS[2]*axisRMS[2]);
Serial.printf("Total: %.2fgRMS\n", totalVib);
if(totalVib > 3.0) {
Serial.println("*** BEARING FAULT DETECTED ***");
}
}
SW-420 Vibration Specifications
0.1-5g threshold; 10-1000Hz response; <1ms latency; spring-mass piezo; LM393 comparator; IP65 enclosure.
Industrial Condition Monitoring Applications
Predictive maintenance (bearing/alignment faults)
Shipping container shock logging
CNC spindle/tool wear detection
// P-wave/S-wave detection simulation
static unsigned long eventStart = 0;
static int peakCount = 0;
void loop() {
int vib = analogRead(A0);
if(vib > 600) {
peakCount++;
if(peakCount > 5) {
Serial.println("*** EARTHQUAKE DETECTED - EVACUATE! ***");
tone(8, 1000, 1000);
digitalWrite(7, HIGH); // Emergency shutdown
}
} else {
peakCount = 0;
}
}
Production Vibration Specifications
- 0.1-5g adjustable threshold
- 10-1000Hz frequency response
- <1ms shock detection
- RMS trend analysis capability
- Pin 2 interrupt optimized
- 10-year MTBF industrial
Advanced FFT Spectrum Analysis
// Bearing fault frequencies (1X, 2X RPM harmonics)
float spectrum[8] = {0};
void analyzeSpectrum() {
for(int i=0; i<512; i++) {
int sample = analogRead(A0) - 512;
spectrum[i/64] += abs(sample);
}
// 1X RPM fault (imbalance)
if(spectrum[1] > spectrum[0]*2.5) {
Serial.println("1X FAULT: IMBALANCE DETECTED");
}
// 2X RPM (misalignment)
if(spectrum[2] > spectrum[0]*3.0) {
Serial.println("2X FAULT: MISALIGNMENT");
}
}
Mounting & Calibration Protocol
Rigid metallic mounting (>10kHz response). Blue pot CCW=5g → CW=0.1g sensitivity. Baseline RMS <0.2gRMS normal operation. Weekly trend verification. Epoxy mounting prevents loosening.
ISO 10816 Vibration Severity Standards
- <2.3mm/s RMS: Good
- 2.3-4.5mm/s RMS: Satisfactory
- 4.5-7.1mm/s RMS: Unsatisfactory
- 7.1-11.2mm/s RMS: Unacceptable
- >11.2mm/s RMS: Shutdown