meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sensor:vibration [2026/04/15 14:01] – [LDTM-028K] vamsan | sensor:vibration [2026/04/15 15:21] (current) – vamsan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== lamaPLC project: Arduino - Vibration sensors ====== | ====== lamaPLC project: Arduino - Vibration sensors ====== | ||
| {{ : | {{ : | ||
| - | A vibration sensor is a device that detects mechanical oscillations and transforms them into electrical signals to measure displacement, | + | A vibration sensor is a device that detects mechanical oscillations and transforms them into electrical signals to measure displacement, |
| **Common Types of Vibration Sensors** | **Common Types of Vibration Sensors** | ||
| Line 23: | Line 23: | ||
| {{page>: | {{page>: | ||
| - | ===== LDTM-028K ===== | + | **Comparison: |
| + | |||
| + | ^Feature^GXFM0459 (Ceramic Module)^LDTM-028K (Film Sensor)| | ||
| + | ^Physical Form|Rigid ceramic disk on a PCB|Flexible thin polymer film| | ||
| + | ^Detection Type|Best for knocks, taps, or high-impact shocks|Best for continuous vibration and low-frequency motion| | ||
| + | ^Wiring 3-pin|(VCC, | ||
| + | ^Signal Handling|Built-in amplifier/ | ||
| + | |||
| + | ===== LDTM-028K | ||
| {{ : | {{ : | ||
| Line 30: | Line 38: | ||
| It specifically features a cantilever beam design with an integrated mass (//the " | It specifically features a cantilever beam design with an integrated mass (//the " | ||
| - | **Key Characteristics** | + | **LDTM 028K Key Characteristics** |
| * **Technology: | * **Technology: | ||
| Line 39: | Line 47: | ||
| * **Key Benefit:** The additional mass decreases the resonant frequency, increasing sensitivity to low-frequency movements and strong shocks. | * **Key Benefit:** The additional mass decreases the resonant frequency, increasing sensitivity to low-frequency movements and strong shocks. | ||
| - | **Technical Specifications** | + | **LDTM 028K Technical Specifications** |
| * **Sensitivity: | * **Sensitivity: | ||
| Line 45: | Line 53: | ||
| * **Temperature Range:** 0°C to 85°C. | * **Temperature Range:** 0°C to 85°C. | ||
| - | ==== Wiring the Standalone Sensor (Raw Element) ==== | + | ==== Wiring the Standalone |
| The standalone LDTM-028K features only two crimped contacts. Since piezoelectric elements can produce very high voltage spikes (AC), they need a dedicated circuit to protect your microcontroller and ensure the signal remains stable. | The standalone LDTM-028K features only two crimped contacts. Since piezoelectric elements can produce very high voltage spikes (AC), they need a dedicated circuit to protect your microcontroller and ensure the signal remains stable. | ||
| Line 57: | Line 65: | ||
| **Protection (optional but recommended): | **Protection (optional but recommended): | ||
| - | ===== Wiring ===== | + | ==== Arduino example code for the LDTM 028K Standalone Sensor |
| + | Connect a 1 MΩ resistor in parallel with the sensor' | ||
| + | * Move the signal wire from A0 to Digital Pin 2 (Interrupt 0). | ||
| + | * Keep the 1 MΩ resistor in parallel between Pin 2 and GND. | ||
| + | |||
| + | This sketch uses a //" | ||
| <code c> | <code c> | ||
| + | /* | ||
| + | * LDTM-028K Interrupt-Driven Detection | ||
| + | * Connect sensor to Digital Pin 2 with a 1M Ohm resistor to GND. | ||
| + | */ | ||
| + | |||
| + | const byte PIEZO_PIN = 2; // Interrupt-capable pin (Uno/Nano: Pin 2 or 3) | ||
| + | const byte LED_PIN = 13; // Built-in LED | ||
| + | |||
| + | // ' | ||
| + | volatile bool vibrationDetected = false; | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | pinMode(LED_PIN, | ||
| + | pinMode(PIEZO_PIN, | ||
| + | |||
| + | // Trigger the ' | ||
| + | attachInterrupt(digitalPinToInterrupt(PIEZO_PIN), | ||
| + | | ||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | if (vibrationDetected) { | ||
| + | Serial.println(" | ||
| + | | ||
| + | // Visual feedback | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(500); | ||
| + | digitalWrite(LED_PIN, | ||
| + | | ||
| + | // Reset the flag so we can catch the next one | ||
| + | vibrationDetected = false; | ||
| + | } | ||
| + | |||
| + | // Your main code can do other things here without missing the sensor trigger | ||
| + | } | ||
| + | |||
| + | // The Interrupt Service Routine (ISR) - Must be fast and short | ||
| + | void vibrationISR() { | ||
| + | vibrationDetected = true; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Why use this method?** | ||
| + | |||
| + | * **Zero Lag:** The // | ||
| + | * **Multitasking: | ||
| + | * **Power Saving:** This approach lets you put the Arduino into //" | ||
| + | |||
| + | ===== GXFM0459 (Ceramic Module) ===== | ||
| + | The GXFM0459 is a standard alphanumeric SKU for an Analog Piezoelectric Ceramic Vibration Module. It is designed to detect mechanical stress (taps, knocks, or vibrations) and convert it into an electrical signal proportional to the impact strength. | ||
| + | |||
| + | **GXFM0459 Technical Specifications** | ||
| + | |||
| + | The module typically integrates a ceramic piezo disk with a basic buffering circuit on a small PCB. | ||
| + | |||
| + | ^Parameter^Value| | ||
| + | ^Operating Voltage|3.3V to 5V DC| | ||
| + | ^Working Current|< | ||
| + | ^Output Type|Analog voltage (and sometimes TTL Digital)| | ||
| + | ^Operating Temperature|-10 .. 70 °C| | ||
| + | |||
| + | **GXFM0459 Pinout and Connectivity** | ||
| + | |||
| + | Most modules use a 3-pin or 4-pin header for easy integration with microcontrollers like Arduino. | ||
| + | |||
| + | * **S / A0 (Signal):** Analog output. Connect to an Analog Input pin (e.g., A0). | ||
| + | * **+ / VCC:** Power supply (3.3V or 5V). | ||
| + | * **- / GND:** Ground connection. | ||
| + | * **D0 (Optional): | ||
| + | |||
| + | **GXFM0459 Key Features** | ||
| + | |||
| + | * **Proportional Output:** Unlike simple digital switches such as the SW-420, the GXFM0459 provides an analog signal, enabling you to gauge the strength of a strike, which is useful for electronic drum applications. | ||
| + | * **Adjustable Sensitivity: | ||
| + | * **Durability: | ||
| + | |||
| + | ==== Arduino - GXFM0459 Module Wiring Diagram ==== | ||
| + | |||
| + | If your module has 4 pins, follow this standard setup: | ||
| + | |||
| + | ^Module Pin^Arduino Pin^Description| | ||
| + | ^VCC / +|5V|Power supply for the module.| | ||
| + | ^GND / -|GND|Ground connection.| | ||
| + | ^A0 / S|Analog A0|Raw signal for measuring vibration intensity.| | ||
| + | ^D0 / L|Digital D2|(Optional) Threshold-based high/low trigger.| | ||
| + | |||
| + | ==== Arduino - GXFM0459 Example Code ==== | ||
| + | This sketch monitors the analog value to detect the " | ||
| + | |||
| + | <code c> | ||
| + | /* | ||
| + | * GXFM0459 Ceramic Vibration Sensor Example | ||
| + | * Reads analog intensity and digital hit detection. | ||
| + | */ | ||
| + | |||
| + | const int ANALOG_PIN = A0; // Connect to A0 for intensity | ||
| + | const int DIGITAL_PIN = 2; // Connect to D2 for quick trigger | ||
| + | const int LED_PIN = 13; // Built-in LED for feedback | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | pinMode(DIGITAL_PIN, | ||
| + | pinMode(LED_PIN, | ||
| + | | ||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | // 1. Read Analog Intensity (0-1023) | ||
| + | int intensity = analogRead(ANALOG_PIN); | ||
| + | |||
| + | // 2. Read Digital Trigger (0 or 1) | ||
| + | bool hitDetected = digitalRead(DIGITAL_PIN); | ||
| + | // Only print if there is actual movement to avoid flooding the monitor | ||
| + | if (intensity > 5 || hitDetected == HIGH) { | ||
| + | Serial.print(" | ||
| + | Serial.print(intensity); | ||
| + | | ||
| + | if (hitDetected == HIGH) { | ||
| + | Serial.println(" | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(50); | ||
| + | digitalWrite(LED_PIN, | ||
| + | } else { | ||
| + | Serial.println(); | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | delay(10); // Small delay for stability | ||
| + | } | ||
| </ | </ | ||
| - | ===== Communication | + | ===== Sensor |
| - | {{topic>communication}} | + | {{topic>sensor}} |
| - | {{tag>BMP280 AHT20 temperature humidity pressure sensor arduino oled SH1106 arduino_code}} | + | {{tag>Vibration Sensor Piezoelectric MEMS Eddy-Current Electrodynamic GXFM0459 LDTM-028K Arduino Arduino_code}} |
| This page has been accessed for: Today: {{counter|today}}, | This page has been accessed for: Today: {{counter|today}}, | ||