A practical guide to collecting data from your sensors and preparing it for AI training.
Sensor data can come from many sources. Here are the most common ones and how to export them.
| Source | How to export | Typical format |
|---|---|---|
| PLC / SCADA | Built-in data export or historian software (TIA Portal, FactoryTalk, etc.) | CSV, XLSX |
| Arduino / ESP32 | Serial.println() to Serial Monitor, or write to SD card with the SD library | Serial text, SD card CSV |
| Data logger USB | Connect the logger, download the file via manufacturer software | CSV, TXT |
| Excel / Google Sheets | Spreadsheet with manual readings — export as CSV (File > Save As > CSV) | XLSX → CSV |
| OPC-UA / MQTT | Use a client (e.g. Node-RED, Python opcua) to subscribe and log to CSV | JSON → CSV |
Raw sensor exports often include timestamps, text status columns, or metadata that Luviner doesn't need. Here's a before/after example:
What to do:
Quick fixes for the most common problems in sensor data exports.
| Problem | Solution |
|---|---|
| Empty cells or missing values | Delete rows with missing values, or fill with the previous reading (forward fill) |
| Text in feature columns (e.g. "N/A", "ERR") | Replace with a numeric value or remove the row |
| Mixed units (e.g. some rows in °C, others in °F) | Convert all values to the same unit before export |
| Decimal comma instead of dot (1.234 vs 1,234) | Replace commas with dots in numeric columns, or use semicolon as CSV delimiter |
| Duplicate rows or irregular sampling intervals | Remove duplicates; for irregular intervals, resample to a fixed rate if possible |
Each row needs a label — an integer that tells Luviner which class that reading belongs to. There are several ways to assign labels depending on your situation.
| Method | When to use | Example |
|---|---|---|
| Known fault types | You already know what each condition looks like (from maintenance logs or domain knowledge) | normal=0, bearing_fault=1, misalignment=2 |
| From SCADA/PLC alarms | Your system already flags abnormal conditions — map alarm codes to integers | OK=0, ALARM=1 |
| By time window | You know when a fault occurred — label all rows before that moment as 0, and rows during/after as 1 | "Everything before March 15 = normal (0), after = fault (1)" |
Accelerometer data from an electric motor. Labels: 0 = normal, 1 = bearing fault, 2 = misalignment.
Air handling unit readings. Labels: 0 = normal, 1 = low airflow, 2 = compressor overload.
Cold room monitoring for perishable goods. Labels: 0 = safe conditions, 1 = spoilage risk.
Electrical panel readings. Labels: 0 = normal, 1 = harmonic distortion, 2 = undervoltage.