Data Logging

How to record measurements you can trust: planning, sensors and converters, sampling and aliasing, time stamps, storage, logger hardware, strategies, telemetry and data quality, with worked numbers.

A data logger records measurements over time so that they can be analyzed later: to troubleshoot a machine, prove that a process stays in tolerance, monitor energy, test a prototype or train a model. The hard part is rarely storing numbers. It is deciding what to record, how fast and how accurately, and making sure that the numbers are correct, in order and correctly timed, long after you have forgotten how the logger was set up. This guide takes the logging chain from the sensor to the report in nine pages: planning, sensors and converters, sampling and aliasing, time stamps and clocks, storage and formats, logger hardware, logging strategies, telemetry and dashboards, and data quality. Every worked number is computed so that you can check your own system against it. The code and file formats for reading data back are in Data, Files and Parsing.

Start here: what do you need?

I need to…Go to
decide what to log and how long to keep itPlanning a Logging System
choose a sensor, a converter, or find out why readings are noisy or wrongSensors, Signal Conditioning and ADCs
pick a sample rate, avoid aliasing, or design a filterSampling, Aliasing and Filtering
get trustworthy time stamps, or synchronize several loggersTime Stamps and Clocks
estimate storage, pick a format, or stop an SD card wearing outStorage, Formats and Data Rates
choose a logger: a commercial unit, a microcontroller, a Pi or a PLCLogger Hardware: Dedicated, Embedded and Industrial
capture rare events, or store less without losing what mattersLogging Strategies: Triggers, Deadbands and Aggregation
send data to the cloud, build a dashboard or an alertTelemetry, Databases and Dashboards
check, analyze and report data honestlyData Quality, Analysis and Reporting

A suggested order

Start with Planning a Logging System, because every later choice follows from it. Then work along the chain: Sensors, Signal Conditioning and ADCs, Sampling, Aliasing and Filtering and Time Stamps and Clocks decide the quality of each number; Storage, Formats and Data Rates, Logger Hardware: Dedicated, Embedded and Industrial and Telemetry, Databases and Dashboards decide whether it survives and gets seen; Logging Strategies: Triggers, Deadbands and Aggregation and Data Quality, Analysis and Reporting decide whether it is useful.

  1. Planning a Logging System: The questions to answer first: what to measure, how fast, how accurately, for how long, and what happens when data is lost.
  2. Sensors, Signal Conditioning and ADCs: The measurement chain from sensor to number: thermocouples, RTDs, 4–20 mA, bridges, converters, noise, grounding and an uncertainty budget.
  3. Sampling, Aliasing and Filtering: Nyquist, how aliases appear, anti-alias filter design, oversampling and decimation, and choosing the sample rate and record length.
  4. Time Stamps and Clocks: UTC and ISO 8601, clock drift in ppm, NTP, PTP and GPS, jitter, stamping at the source and synchronizing several loggers.
  5. Storage, Formats and Data Rates: Data volume per day, text against binary, compression, SD card endurance, databases, file rotation and retention.
  6. Logger Hardware: Dedicated, Embedded and Industrial: Commercial loggers, microcontrollers with SD, Raspberry Pi, PLC trends and polling devices over a network, with power, enclosure and runtime.
  7. Logging Strategies: Triggers, Deadbands and Aggregation: Periodic, on-change, pre-trigger ring buffers, min/mean/max aggregation and burst capture, and what each saves and hides.
  8. Telemetry, Databases and Dashboards: MQTT, store-and-forward, time-series databases, Grafana dashboards, alerts, data costs and securing a remote logger.
  9. Data Quality, Analysis and Reporting: Validation, gaps, calibration, uncertainty, control charts, summary statistics, honest plots and a troubleshooting table.

The logging pipeline

Sensorphysical signalFilteranti-alias, conditioningADCsample and digitizeLoggertimestamp, scale, bufferLocal storageSD card or flashNetworkMQTT, HTTP, ModbusDatabasetime-series or SQLDashboardcharts, alarms, reportskeep a local copy first: the network will drop outEach stage can add error, delay or data loss: check them one at a time.
A typical logging chain. A problem in any stage shows up as bad data at the end, so test each stage separately.
StageWhat can go wrongWhere to look
Sensor and installationWrong range, slow response, poor contact, heat conductionSensors, Signal Conditioning and ADCs
Conditioning and ADCNoise, offset, aliasing, a poor referenceSensors, Signal Conditioning and ADCs, Sampling, Aliasing and Filtering
Logger and clockDrifting time, missed samples, power lossTime Stamps and Clocks, Logger Hardware: Dedicated, Embedded and Industrial
StorageFull disk, corrupted files, a worn cardStorage, Formats and Data Rates
Network and databaseLost messages, duplicates, no bufferingTelemetry, Databases and Dashboards
Analysis and reportingHidden gaps, wrong units, misleading plotsData Quality, Analysis and Reporting

Quick reference: rules and formulas

TopicRule or formulaPage
Nyquistfs > 2 fmax; in practice 5 to 10 × the highest frequency of interestSampling, Aliasing and Filtering
Alias frequency| f − k fs | with k the nearest whole numberSampling, Aliasing and Filtering
RC filter cut-offfc = 1 ÷ (2π R C)Sampling, Aliasing and Filtering
Oversampling gain+½ log2 N bits for N averaged samplesSensors, Signal Conditioning and ADCs
Uncertainty (independent)u = √(u1² + u2² + …)Sensors, Signal Conditioning and ADCs
Clock driftseconds per day = ppm × 0.0864Time Stamps and Clocks
Data per daychannels × bytes × rate × 86 400Storage, Formats and Data Rates
Control limitscenter line ± 3 σ of the subgroup meansData Quality, Analysis and Reporting

Related guides and tools

Safety and responsibility

  • A logger is not a safety system. If a reading protects people or equipment (a gas, pressure or temperature limit), the protection must be a rated device that acts without the logger.
  • Mains and process wiring is dangerous: use rated, isolated inputs and a competent person for anything above extra-low voltage.
  • Data can be personal or confidential: energy, occupancy and location logs reveal habits; secure remote access and know who may see the data (see Telemetry, Databases and Dashboards).
  • Regulated records (food safety, pharmaceutical, environmental) have rules on calibration, audit trails and retention: follow them from the start (see Data Quality, Analysis and Reporting).

FAQ

How fast should I sample?

At least twice the highest frequency in the signal, and in practice 5 to 10 times the frequency of interest, with an anti-alias filter in front of the converter. See Sampling, Aliasing and Filtering.

Should I log raw counts or scaled values?

Log values in engineering units for use, and keep the scaling and calibration in the metadata so that the raw counts can be recovered. See Planning a Logging System.

Which time zone should the log use?

UTC, in ISO 8601, with the source of the clock recorded. Convert to local time only for display. See Time Stamps and Clocks.

Where did the old Data Logging sections go?

All of them are in this guide with much more depth: sampling and aliasing, resolution, time stamps, storage size and formats, strategies, hardware and data quality each have their own page.

References

  • JCGM 100:2008 (GUM), Guide to the expression of uncertainty in measurement; Bell, S., A Beginner’s Guide to Uncertainty of Measurement, NPL.
  • Oppenheim, A. V. and Schafer, R. W., Discrete-Time Signal Processing; Smith, S. W., The Scientist and Engineer’s Guide to Digital Signal Processing.
  • Montgomery, D. C., Introduction to Statistical Quality Control; ISO 8601 (date and time format); RFC 5905 (NTP).

Last reviewed: October 2026. Specifications and prices change: check the datasheet of the part you use.