Skip to content
Tutorial
14 min read
October 17, 2026

Read Arduino Uno or Nano Sensors over Serial in Node-RED

Read sensor measurements from Arduino Uno or Nano over USB serial into Node-RED. Use newline-delimited records, configure the serial node correctly, parse JSON, validate data and troubleshoot port and baud-rate problems.

Read Arduino Uno or Nano Sensors over Serial in Node-RED

An Arduino Uno or classic Nano can collect sensor readings locally and send them to a computer over USB serial. Node-RED can read each line, parse it and route data to a dashboard, file or another service. This is useful when the board has no network connection or you want a direct USB link.

The key design choice is to separate machine-readable data from human-friendly debugging text. A serial stream containing arbitrary messages, partial records and sensor values is difficult to parse reliably. Here, the Arduino emits one newline-terminated JSON object per sample, and Node-RED treats each line as a record.

Image pending: Image placeholder: Arduino Uno/Nano connected over USB to a computer running Node-RED, with serial records sent to Debug and a dashboard.

1. Define a serial message format

For a simple data logger, a record might look like this JSON object:

JSON

Send a newline after each complete record, for example with Serial.println(). JSON is useful when each record has several named fields. For a very small constrained record, documented comma-separated values can also work. Do not mix startup banners or debug prose into the same stream if Node-RED expects every line to be JSON.

Make the baud rate explicit and use the same value at both ends. Keep the sample rate sensible: serial has finite throughput, and a high-frequency stream can overwhelm downstream dashboard or storage nodes.

2. Upload a transport test to Arduino

This sketch verifies that Arduino-to-Node-RED transport works before adding a real sensor. It reports the raw ADC reading from A0 and a sample counter. The ADC number is not a calibrated voltage or temperature. Replace the test fields with measurements only after you implement the appropriate sensor conversion.

C++

Keep memory use modest on Uno/Nano and avoid building large dynamic strings for long-running streams. Close Arduino IDE's Serial Monitor before Node-RED opens the same serial port because many operating systems allow only one application to own it at a time.

Image pending: Image placeholder: Arduino Uno or Nano connected to a computer by USB. Label USB serial as the data path, not an Ethernet or Wi-Fi connection.

3. Configure the Node-RED serial input

Install a maintained serial node package appropriate for your Node-RED installation if a serial node is not present. Add a serial input node, select the operating system's port for the Arduino, set 115200 baud to match the sketch, and configure the node to emit a complete line when it receives a newline delimiter.

The port name differs by operating system and device. Windows commonly displays a COM port; Linux commonly exposes a tty device; macOS uses a device path. Do not guess based on an old screenshot. Recheck it when reconnecting the board or changing USB adapters.

Connect Serial In to Debug first. Confirm each output contains exactly one line and lines do not arrive as fragments or combined records.

Image pending: Image placeholder: Node-RED serial input configuration with an example port, 115200 baud and newline-delimited mode. Blur machine-specific port paths.

4. Parse and validate each line

Connect serial input to a JSON node, then to Debug. Inspect the type emitted by your serial node: it may provide a string or buffer depending on configuration. Configure the parser for the actual incoming type rather than assuming it.

Before driving a gauge or writing to a database, check that required values exist and are finite numbers. If a line is malformed, route it to an error branch or count it for diagnostics; do not automatically turn it into zero. For long-running logs, record a receive timestamp and decide what to do if the Arduino stops sending.

Image pending: Image placeholder: flow diagram Serial In → JSON parser → validation → Debug and Dashboard, plus an invalid-line error branch.

5. Send values to a dashboard or logger

Once parsing works, route validated fields to FlowFuse Dashboard widgets or a storage node. If your JSON object contains raw ADC counts, label the field as counts. Do not label it volts unless converted with the correct board reference voltage and ADC resolution. Do not label it temperature until an appropriate sensor and conversion are in place.

For a chart, include time or use the timestamp behavior documented by the chosen node. Keep sampling cadence and retention deliberate; a direct serial stream can create a large number of points in a long session.

Image pending: Image placeholder: dashboard card with raw ADC count, sample number and receive timestamp, clearly distinguishing raw data from calibrated measurements.

Troubleshooting

No data: check power, the selected port and baud-rate agreement; close Serial Monitor.

Garbled output: check baud rate, line endings and cable/USB connection.

JSON parse error: verify every emitted line is valid JSON and no diagnostic message is mixed into the stream.

Port busy: close other applications using the serial port, then reconnect the device or restart the relevant serial node.

Dashboard freezes: measure arrival rate, verify serial input still continues and inspect downstream node errors.

Next steps

Official reference: Node-RED messages and documentation for the specific serial node package. Record your operating system, board variant, node package version and baud rate when reproducing serial issues.

Signal In

Built from what makers search for

The lookups piling up in SolderHub's search bar every day shape what we publish next — new component pages, board guides, and firmware notes, sent out as they go live.

By subscribing you agree to our Privacy Policy. Unsubscribe anytime.