Chris Collins

Tools · sensors

Sensor data logger

Log a sensor for a science project from an Arduino, ESP32, Pico or micro:bit over USB (Web Serial) or Bluetooth, or from a simulated source: CSV, name:value, JSON and Serial Plotter lines plotted live with zoom and scroll, markers, per-channel statistics, units and calibration, the sample rate, recordings saved in your browser, CSV/JSON export, and example programs to copy.

Added

How to use it

Plug in a board that prints readings, press Connect, and watch them plot. Everything runs in this page: your data stays in this browser unless you export it.

How to use it

  1. Choose a source in the first menu:

    • Simulated (demo) — no hardware needed: a swinging pendulum, a cooling cup of tea, a light sensor or an accelerometer with taps. The demo starts on its own the first time.

    • USB serial (Web Serial) — an Arduino, ESP32/ESP8266, Raspberry Pi Pico or micro:bit on a USB cable. Pick the same baud rate as the board’s Serial.begin() (a micro:bit uses 115200).

    • Bluetooth UART — a device advertising the Nordic UART Service, such as a micro:bit running the Bluetooth UART service or an ESP32 "BLE UART" sketch.

    • micro:bit sensors — reads a micro:bit’s built-in accelerometer and temperature services directly, no UART needed (the program must start those services).

  2. Pick the line format or leave it on auto-detect (below), then press Connect (or Start demo). The status line shows the connection, the measured sample rate, how many samples and lines arrived, and how many lines could not be read.

  3. Read the plot. Each value becomes a channel. One axis auto-scales all channels together; Lanes gives each its own strip and scale, better when units differ. The time window (5 s to 1 h, or All) follows the newest data.

    • Pause (or Space) freezes the view while data keeps arriving; drag the plot sideways to scroll back, use the wheel, a pinch or +/- to zoom, and Live ⏭ to return.

    • Tap the plot to put a cursor there and read every channel at that moment; tap again to clear it.

    • ⚑ Marker (or the M key) adds a marker with a note at the cursor, or at the latest sample — "added salt", "lamp on". Markers are drawn on the plot, listed below it and exported.

  4. Channels table. Show or hide each channel, give it a unit, and see its statistics over the visible window: count, latest, minimum, maximum, mean and sample standard deviation.

  5. Calibrate a channel to turn raw numbers into real units. Scale + offset: value = scale × raw + offset (an Arduino’s 0–1023 to volts is scale 5/1023). Two-point: hold the sensor at two known values — ice water (0 °C) and boiling water (100 °C at sea level), or two known weights — note the raw reading at each (Use latest raw fills it in) and the tool draws the straight line through them. The raw values are kept, so a calibration can be changed afterwards.

  6. Record saves the data as it arrives into this browser (IndexedDB), with its channels, units, calibration and markers. The Recordings tab lists them to open again, rename, delete, or export as CSV (calibrated values, raw columns for calibrated channels, and a marker column) or JSON; JSON recordings can be imported back.

  7. Full screen (⛶ or F; Esc to leave) gives the plot the whole screen, with ☰ Channels to show or hide the table.

Line formats

One reading per line, ending in a newline. With auto-detect each line is recognised:

Format Example Notes

CSV

light,temp_c then 512,21.4

A first row of names becomes the channel names; without one, columns are named 1, 2, 3 …. Commas, semicolons or tabs; quoted cells allowed.

name=value

light=512, temp=21.4

Pairs separated by commas, semicolons, tabs or spaces; : works too.

JSON

{"light":512,"imu":{"x":0.1}}

Nested fields become imu.x; arrays a[0]; true/false become 1/0.

Serial Plotter

light:512,temp:21.4 or 512 21.4

The Arduino IDE plotter’s format: labelled values or bare numbers.

Lines starting with # or //, blank lines, and chatter such as "Booting…" are ignored (and counted as unreadable when they are not blank). Times are when each line arrives at the browser, from the first sample.

Example programs

The Sketches & browsers tab has programs to copy: an Arduino CSV logger with a header (an LDR and a TMP36), an Arduino/ESP32 name:value sketch that also works with the Serial Plotter, a Raspberry Pi Pico MicroPython logger (with the RP2040’s internal temperature sensor), and micro:bit MakeCode programs for USB serial (serial.writeValue) and Bluetooth UART (bluetooth.uartWriteLine).

Browser support

  • Web Serial (USB): Chrome, Edge and Opera on Windows, macOS, Linux and ChromeOS.

  • Web Bluetooth: Chrome and Edge on Windows, macOS, ChromeOS and Android (on Linux it needs a flag).

  • Not supported: Safari and Firefox, and every browser on iPhone and iPad (they all use Safari’s engine). The simulated source, recordings and export work in any browser; the tool says so when a connection type is missing.

For Bluetooth the device must advertise the Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e). Nordic’s own UART sends on characteristic …0003 and receives on …0002; the micro:bit’s Bluetooth profile swaps the two, so the tool subscribes to whichever of them can notify. On the micro:bit, choose "No Pairing Required" in the MakeCode project settings so the browser can connect.

Limits

  • Timestamps are arrival times in the browser, so USB and Bluetooth buffering add a few milliseconds of jitter; for precise timing, print the board’s own millis() as a channel.

  • The sample rate shown is the median of recent intervals; bursts (several lines per USB packet) are smoothed out.

  • Up to 200,000 samples stay on screen; long recordings are saved every 2 seconds. Very fast streams (more than a few hundred lines a second) are better logged to an SD card.

  • Bluetooth notifications carry up to about 20 bytes per packet on older devices; long lines are reassembled, but keep them short.

  • Calibration is linear (one or two points); for thermistors and other non-linear sensors use the thermistor or sensor tools to convert first.

  • Share links carry the settings (source, format, window, channel units and calibrations), never recorded data.

Linking to an example

Share link copies your settings. Links can be written by hand; add the tab after #: live, recordings or sketches.

Parameter Meaning Example

src

demo, serial, ble (Bluetooth UART) or mbsensors (micro:bit sensors)

src=serial

sim

Demo signal: pendulum, cooling, light or imu

sim=cooling

fmt

auto, csv, kv, json or plotter

fmt=csv

baud

Serial baud rate

baud=9600

win

Time window in seconds (0 = all)

win=60

view

overlay (one axis) or stacked (lanes)

view=stacked

example

A preset below; parameters given with it override it

example=cooling

example= Opens

pendulum

The simulated pendulum, 10 s window: measure the period (about 2.0 s for 1 m) (open)

cooling

A cooling cup of tea and the room, 10 min window (open)

light

A light sensor in Serial Plotter format (open)

imu

An accelerometer sending JSON, in lanes (open)

arduino

Ready for an Arduino printing CSV at 115200 baud (open)

microbit

Ready for a micro:bit over Bluetooth UART (open)

Runs entirely in your browser — network requests go only to the services named on this page.