AI & ML

Deploying Real-Time Vibration & Audio Anomaly Detection on Jetson Orin Nano with TinyML

Jul 5, 2026
5 min read
TinyML Anomaly Detection on Jetson Orin Nano

Traditional predictive maintenance relies on sending raw vibration, current, or acoustic data to the cloud, where server-side models check for anomalies. While this works for slow-changing systems (like temperature), it fails for high-speed machinery. Sending raw high-frequency sensor streams (e.g., 20 kHz vibration samples) over cellular or plant Wi-Fi consumes massive bandwidth and introduces latencies of several seconds—far too slow to prevent a catastrophic machine crash.

The solution is Edge AI: running lightweight machine learning models (often referred to as TinyML) directly next to the machine. By deploying models on hardware like the NVIDIA Jetson Orin Nano, you can process raw data streams locally, achieving sub-millisecond inference speeds and running entirely offline.

This guide walks you through the architecture of a real-time vibration and acoustic anomaly detection system running on the factory floor.

The Target Hardware: Jetson Orin Nano

The NVIDIA Jetson Orin Nano is the industry-standard edge computer for industrial AI. It delivers up to 40 TOPS (Trillion Operations Per Second) of AI performance in a compact, low-power (7W to 15W) module. While many associate the Jetson line with video streams and computer vision, its GPU and Deep Learning Accelerator (DLA) cores are equally powerful at accelerating 1D signal processing and neural networks for telemetry data.

High-Level Edge Pipeline Architecture

An edge anomaly detection pipeline consists of four main stages:

  1. Data Acquisition: High-frequency industrial sensors (like Piezoelectric accelerometers or MEMS microphones) feed data to the Jetson Orin Nano via an ADC module, USB interface, or industrial Ethernet.
  2. Signal Pre-processing: Raw time-domain signal waveforms are converted into frequency-domain representations. We typically compute the FFT (Fast Fourier Transform) or extract MFCCs (Mel-Frequency Cepstral Coefficients) to create spectrograms (images of sound/vibration over time).
  3. Model Inference: A lightweight neural network (such as a 1D Convolutional Neural Network or an Autoencoder) evaluates the spectrogram features.
  4. Alert and Egress: If the model's anomaly score exceeds a preset threshold, a local digital output pin is triggered (e.g., to sound an alarm or stop the PLC line), and a compact status payload is published to the cloud via MQTT.

Designing the Anomaly Model: The Autoencoder Approach

In manufacturing, obtaining labeled data of "failures" is extremely difficult because machines rarely break. Therefore, we use an unsupervised learning model called an Autoencoder.

An Autoencoder is trained only on normal operational data. It learns to compress the normal data into a low-dimensional bottleneck and then reconstructs it back to the original size. When the machine behaves normally, the reconstruction error is low. If a bearing cracks or a belt slips, the frequency signature changes; the Autoencoder fails to reconstruct this unfamiliar pattern, and the reconstruction error spikes, flagging an anomaly.

Python Implementation: Edge Inference with ONNX Runtime

To run PyTorch or TensorFlow models at maximum speed on the Jetson Orin Nano, we export the trained model to the ONNX (Open Neural Network Exchange) format and run inference using TensorRT acceleration via ONNX Runtime.


import numpy as np
import onnxruntime as ort
import time

# Configs
MODEL_PATH = "autoencoder_vibration.onnx"
ANOMALY_THRESHOLD = 0.08  # Set during calibration
WINDOW_SIZE = 512         # Sensor readings per inference window

# Initialize ONNX session with CUDA (TensorRT) execution provider
providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
session = ort.InferenceSession(MODEL_PATH, providers=providers)
input_name = session.get_inputs()[0].name

def preprocess_sensor_data(raw_data):
    # Normalize input vector
    mean = np.mean(raw_data)
    std = np.std(raw_data) + 1e-6
    normalized = (raw_data - mean) / std
    # Reshape to match model input shape [Batch, Features]
    return np.expand_dims(normalized, axis=0).astype(np.float32)

def calculate_reconstruction_loss(original, reconstructed):
    # Mean Squared Error (MSE) reconstruction loss
    return np.mean((original - reconstructed) ** 2)

def monitor_loop():
    print("Starting edge anomaly monitoring...")
    while True:
        # Simulate reading 512 high-frequency sensor points from ADC
        raw_sensor_buffer = np.sin(np.linspace(0, 10, WINDOW_SIZE)) + np.random.normal(0, 0.1, WINDOW_SIZE)
        
        # Preprocess
        input_data = preprocess_sensor_data(raw_sensor_buffer)
        
        # Run Accelerated Inference
        t_start = time.perf_counter()
        model_outputs = session.run(None, {input_name: input_data})
        reconstructed_data = model_outputs[0]
        inference_time = (time.perf_counter() - t_start) * 1000 # Convert to ms
        
        # Calculate loss
        loss = calculate_reconstruction_loss(input_data, reconstructed_data)
        
        if loss > ANOMALY_THRESHOLD:
            print(f"[ALERT] Anomaly Detected! Loss: {loss:.4f} (Inference: {inference_time:.2f}ms)")
            # In production: trigger local GPIO pin to alert PLC
            # trigger_gpio_shutdown()
        else:
            print(f"[OK] Normal Operation. Loss: {loss:.4f} (Inference: {inference_time:.2f}ms)")
            
        time.sleep(0.5)

if __name__ == "__main__":
    monitor_loop()

Optimization for Industrial Hardware

To run this reliably 24/7 on the shop floor:

  • Quantization (INT8): Convert floating-point model weights (FP32) to 8-bit integers (INT8) using TensorRT. This reduces model size by 75% and doubles inference speed with negligible loss in accuracy.
  • Hardware Enclosures: Jetson Orin Nano modules must be housed in IP67-rated fanless dustproof enclosures to prevent metallic dust or oil mist from short-circuiting the electronics.

Conclusion

By moving machine learning models directly onto edge hardware like the Jetson Orin Nano, manufacturing systems can perform real-time, sub-millisecond anomaly detection. Unsupervised autoencoders running locally are a powerful way to detect equipment wear and prevent costly unplanned downtime without flooding corporate networks with high-frequency telemetry.

AdaptNXT designs and deploys custom Edge AI models, signal processing algorithms, and industrial hardware systems. Contact our AI engineers to discuss your shop floor intelligence roadmap.

Category AI & ML
Share this article
Link copied to clipboard!

Want to Discuss Your Next Project?

Let's explore how our expertise can drive your business forward.

Get In Touch
Call
WhatsApp
Email