meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
sensor:vibration [2026/04/15 14:01] – [LDTM-028K] vamsansensor:vibration [2026/04/15 15:21] (current) vamsan
Line 1: Line 1:
 ====== lamaPLC project: Arduino - Vibration sensors ====== ====== lamaPLC project: Arduino - Vibration sensors ======
 {{ :sensor:ldtm_028k_1.png?140|LDTM 028K}} {{ :sensor:ldtm_028k_1.png?140|LDTM 028K}}
-A vibration sensor is a device that detects mechanical oscillations and transforms them into electrical signals to measure displacement, velocity, or acceleration. They are vital for predictive maintenance, enabling teams to identify machine issues such as misalignment or bearing wear before a failure becomes catastrophic.+A vibration sensor is a device that detects mechanical oscillations and transforms them into electrical signals to measure displacement, velocity, or acceleration. They are vital for predictive maintenance, enabling teams to identify machine issuessuch as misalignment or bearing wearbefore failures become catastrophic.
  
 **Common Types of Vibration Sensors** **Common Types of Vibration Sensors**
Line 23: Line 23:
 {{page>:tarhal}} {{page>:tarhal}}
  
-===== LDTM-028K =====+**Comparison: GXFM0459 vs. LDTM-028K** 
 + 
 +^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, GND, OUT)|2-pin (Raw AC output)| 
 +^Signal Handling|Built-in amplifier/comparator|Requires external resistor/circuit| 
 + 
 +===== LDTM-028K (Film Sensor) =====
 {{ :sensor:ldtm_028k_1.png?140|LDTM 028K}} {{ :sensor:ldtm_028k_1.png?140|LDTM 028K}}
  
Line 30: Line 38:
 It specifically features a cantilever beam design with an integrated mass (//the "M" in the name//) to increase its sensitivity, especially at lower frequencies. It specifically features a cantilever beam design with an integrated mass (//the "M" in the name//) to increase its sensitivity, especially at lower frequencies.
  
-**Key Characteristics**+**LDTM 028K Key Characteristics**
  
   * **Technology:** It employs a flexible **PVDF** (//Polyvinylidene Fluoride//) polymer film that is 28 μm thick.   * **Technology:** It employs a flexible **PVDF** (//Polyvinylidene Fluoride//) polymer film that is 28 μm thick.
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:** Approximately (200 mV/g at resonance).   * **Sensitivity:** Approximately (200 mV/g at resonance).
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 LDTM 028K Sensor (Raw Element) ====
 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):** To prevent voltage spikes from damaging the pins, some designers install a Schottky diode or a Zener diode across the terminals to clamp the voltage to the supply level.  **Protection (optional but recommended):** To prevent voltage spikes from damaging the pins, some designers install a Schottky diode or a Zener diode across the terminals to clamp the voltage to the supply level. 
  
-===== Wiring =====+==== Arduino example code for the LDTM 028K Standalone Sensor ====
  
 +Connect a 1 MΩ resistor in parallel with the sensor's two pins to prevent the analogue input from //"floating"// and to dissipate static charges, reducing the risk of false readings or excessive voltage. 
  
 +  * 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 //"hardware interrupt"// to promptly detect vibrations, even when the main program is busy with other tasks.
  
 <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' is required for variables shared between main loop and interrupt
 +volatile bool vibrationDetected = false; 
 +
 +void setup() {
 +  Serial.begin(115200);         // Higher baud rate for fast events
 +  pinMode(LED_PIN, OUTPUT);
 +  pinMode(PIEZO_PIN, INPUT);    // Sensor acts as a digital pulse generator
 +
 +  // Trigger the 'vibrationISR' function when Pin 2 goes from LOW to HIGH (RISING)
 +  attachInterrupt(digitalPinToInterrupt(PIEZO_PIN), vibrationISR, RISING);
 +  
 +  Serial.println("System Armed. Waiting for vibration...");
 +}
 +
 +void loop() {
 +  if (vibrationDetected) {
 +    Serial.println("!!! IMPACT DETECTED !!!");
 +    
 +    // Visual feedback
 +    digitalWrite(LED_PIN, HIGH);
 +    delay(500);                 // Short pause to show the LED lit
 +    digitalWrite(LED_PIN, LOW);
 +    
 +    // 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;
 +}
 +</code>
 +
 +**Why use this method?**
 +
 +  * **Zero Lag:** The //vibrationISR// function executes immediately when the piezo film detects a voltage spike. 
 +  * **Multitasking:** You can insert resource-intensive code in the //loop()// (such as driving a display or processing data) without risking missing a quick knock or vibration. 
 +  * **Power Saving:** This approach lets you put the Arduino into //"Sleep Mode"// and have the vibration sensor wake it.
 +
 +===== 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|< 1mA|
 +^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):** Digital TTL output. High signal when vibration exceeds the threshold set by the onboard potentiometer. 
 +
 +**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:** If your version features a potentiometer (the small blue screw), you can turn it to set the threshold that triggers the digital output (D0). 
 +  * **Durability:** The ceramic element is sturdy and highly responsive to quick, high-frequency impacts, such as tapping on a table.
 +
 +==== 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 "strength" of a knock while also using the digital pin to trigger an alert instantly.
 +
 +<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);     // High baud rate for fast vibration data
 +  pinMode(DIGITAL_PIN, INPUT);
 +  pinMode(LED_PIN, OUTPUT);
 +  
 +  Serial.println("GXFM0459 Ready. Tap the sensor!");
 +}
 +
 +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("Intensity: ");
 +    Serial.print(intensity);
 +    
 +    if (hitDetected == HIGH) {
 +      Serial.println(" | *** DIGITAL TRIGGERED ***");
 +      digitalWrite(LED_PIN, HIGH); // Light up on hit
 +      delay(50);                   // Brief flash
 +      digitalWrite(LED_PIN, LOW);
 +    } else {
 +      Serial.println();
 +    }
 +  }
 +  
 +  delay(10); // Small delay for stability
 +}
 </code> </code>
  
-===== Communication topics on lamaPLC ===== +===== Sensor topics on lamaPLC ===== 
-{{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}}, Until now: {{counter|total}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}