MockDataLab

Engineering & Industrial Data

Industrial IoT: machines → sensors → readings with drift and outliers

Six machines, each with temperature, vibration and pressure sensors sampled every five minutes for a day. Signals combine a daily cycle and machine load with the instrument artefacts the noise stack offers: random-walk drift, quantization, spikes, out-of-range dropouts and lost packets.

machines (6) → sensors (3 types) → readings (288 per sensor)

Data structure

Sensor time series grouped by asset are the standard input for anomaly detection and predictive maintenance, where realistic artefacts matter more than the clean signal.

machinesone row = one machine
Production line, load factor and a one-in-six chance of a developing bearing fault.
sensorsone row = one sensor
Type, unit and the sensor's upper measurement range.
readingsone row = one 5-minute sample
Minute of day and value with drift, quantization, outliers, dropouts above the sensor range and 1 % missing packets.

Generate the iot sensor readings tables

The preset is a starting point: change any formula, noise step or row count and the preview, ER diagram and relation check update.

The relational generator loads as it scrolls into view…

Key relationships

  • value = base(type) + amplitude·sin(2π·minute/1440) + 6·bearing_fault·(minute/1440)²

    Faulty machines get a rising vibration ramp over the day: a labelled anomaly. machines.* is read two levels up.

  • drift(random walk) → gaussian → quantize → outliers → clip(min 0) → missing_if(value > parent.range_max) → missing

    Drift resets at the first reading of each sensor because it is defined per parent group.

Common pitfalls

  • Random train/test splits on time series leak the future; split by time or by machine.
  • Interpolating across missing packets before checking whether they cluster around faults.
  • Treating readings at the sensor limit as true values.
  • Normalizing all sensors together although units and ranges differ.

Typical analysis

Per sensor: robust z-scores or STL decomposition for anomalies. Per machine: aggregate features such as the rolling standard deviation of vibration, then classify faulty against healthy machines with grouped cross-validation.

Python
import pandas as pd
r = pd.read_csv("readings.csv", comment="#"); s = pd.read_csv("sensors.csv", comment="#"); m = pd.read_csv("machines.csv", comment="#")
d = r.merge(s, on="sensor_id").merge(m, on="machine_id")
vib = d[d.sensor_type == "vibration"].sort_values(["sensor_id", "minute"])
vib["sd_1h"] = vib.groupby("sensor_id").value.transform(lambda x: x.rolling(12, min_periods=6).std())
print(vib.groupby(["machine_id", "bearing_fault"]).value.mean())

Further reading

  • Blázquez-García A, Conde A, Mori U, Lozano JA (2021). A review on outlier/anomaly detection in time series data. ACM Computing Surveys 54(3).

Other relational presets