npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thehighestbit/node-red-contrib-vibration-ism330dhcx

v1.0.2

Published

Node-RED node for vibration sensing using the STMicroelectronics ISM330DHCX 6-axis IMU

Readme

node-red-contrib-vibration-ism330dhcx

A Node-RED node for vibration sensing using the STMicroelectronics ISM330DHCX 6-axis IMU over I2C. Continuously samples the accelerometer, computes time- and frequency-domain vibration metrics on fixed-size windows and emits both per-window values for live charting and an aggregated record for long-term storage.

Installation

cd ~/.node-red
npm install @thehighestbit/node-red-contrib-vibration-ism330dhcx

Configuration

| Property | Description | |----------|-------------| | Data Rate | Accelerometer output data rate (12.5 Hz – 6.66 KHz). Higher rates resolve higher vibration frequencies but produce more data. | | Measurement Range | Full-scale acceleration range (±2g, ±4g, ±8g, ±16g). Pick the smallest range that still covers your expected peaks. | | High Pass Filter | Optional accelerometer high-pass filter to remove DC / gravity bias (None, Slope, ODR/10 … ODR/800). | | Window Size | Number of samples per analysis window (128 – 65536). Larger windows give finer frequency resolution but slower update rate. | | Output Interval | How often the aggregated metrics record (output 1) is emitted, in ms. Defaults to 30000. |

The gyroscope is intentionally powered down — only the accelerometer is used.

Outputs

The node has 5 outputs. Output 1 is intended for database storage; outputs 2–5 are intended for live charts (e.g. Node-RED Dashboard 2.0). All amplitude values (mean, RMS, peak, top-peak magnitudes) are in m/s².

1. Aggregated metrics

Emitted every Output Interval ms. Aggregates all per-window metrics computed since the last emission.

{
    "payload": {
        "ts_start": 1714400000000,
        "ts_end": 1714400030000,
        "window_size": 256,
        "avg_mean": 9.83,
        "max_peak": 24.33,
        "overall_rms": 10.14,
        "avg_crest_factor": 2.41,
        "avg_kurtosis": 3.12,
        "dominant_freq": 124.5,
        "top_peaks": [
            { "f": 124.5, "m": 18.2 },
            { "f": 249.0, "m": 7.4 }
        ]
    }
}

dominant_freq and top_peaks are taken from the highest-RMS window in the interval (a "worst-case spectral snapshot"), since averaging FFT peaks across windows is unreliable when frequencies drift.

2. RMS / Peak (m/s²)

Emitted once per analysis window as two messages with topics RMS and Peak.

3. Crest Factor

Emitted once per analysis window with topic Crest Factor. Ratio of peak to RMS — useful for detecting impulsive faults.

4. Kurtosis

Emitted once per analysis window with topic Kurtosis. Fourth-moment statistic — rises sharply when the signal contains transients.

5. Dominant Frequency (Hz)

Emitted once per analysis window with topic Dominant Frequency. Frequency of the largest FFT magnitude bin (DC removed, Hann-windowed, zero-padded to next power of two).

How it works

  1. The accelerometer is configured with the chosen rate, range and (optional) high-pass filter, and put into FIFO continuous mode.
  2. Every 10 ms the FIFO is drained and the magnitude √(x² + y² + z²) of each sample is appended to a rolling buffer.
  3. Once the buffer reaches Window Size samples, that window is consumed and metrics are computed: mean, RMS, peak, crest factor, kurtosis, and an FFT (DC-removed, Hann-windowed, zero-padded). The five strongest spectral peaks are picked greedily with a minimum separation of three FFT bins so a single true peak cannot fill multiple slots.
  4. Per-window metrics go out on outputs 2–5 immediately and are also stashed for aggregation.
  5. Every Output Interval ms, the stashed metrics are aggregated and emitted on output 1.