Skip to main content

Sensors

This is the catch-all tutorial for the modules that read the physical world — temperature, weight, magnetic field, angle, motion, RFID tags. NodeBlue groups them by sensor family rather than by chip, so a project rarely needs to know what's on the other side of the wire: pick the module that matches your sensor, and its output is a clean numeric stream you can feed into operators, displays, dashboards, or send wirelessly.

Most of these chips sit on the I²C or SPI bus, and inherit that bus's parameters in their edit dialog (I²C Port / SPI Port / pins). When something isn't responding, the very first thing to do is run nI2CScan to confirm the chip is wired and addressable.

Temperature — DS18B20​

The nDS18B20 drives a Dallas/Maxim DS18B20 one-wire digital temperature sensor (the cheap waterproofed-cable type sold for aquariums and pool monitors). One-wire is unusual: power, ground and data share a single wire plus ground, with a single 4.7 kΩ pull-up to Vcc.

ParameterDescription
PinThe GPIO the sensor's data line is connected to.
Resolution9–12 bits. Higher = more precision and longer conversion time (12-bit ≈ 750 ms).
Unit°C / °F output.

Output is a single float reading. Open Examples/06-Sensors/DS18B20 for the minimal setup.

Dashboard companion

A Number Display widget pointed at the DS18B20's output, with Unit = "°C" and Digits = 1, makes the temperature visible at a glance. Add a Graph widget alongside (long Window, e.g. 600 s) to see drift over time. See Dashboards.

Load cells — HX711​

The HX711 is the 24-bit ADC that turns a strain-gauge load cell (the bar with four wires inside every digital kitchen scale) into a digital weight reading. NodeBlue offers two flavours:

ModuleWhen to use
nHX711One load cell, one HX711 — simple weight measurement.
nHX711GroupSeveral HX711s connected to one common SCK pin and individual DOUT pins — for multi-axis force plates, brake pedals with four corner cells, etc.
ParameterDescription
DOUT / SCK pinsThe two GPIOs the HX711 uses.
Gain32 / 64 / 128 — sets the analog gain on the HX711's PGA. 128 is most common.
Sample rate10 Hz or 80 Hz (set by the HX711 itself).

Useful pairings: feed the output into a Range / RangeModule with calibration to turn the raw 24-bit value into grams or pounds, or into a FloatIIRFilter to smooth the signal. Examples: HX711, Hx711_HID, Hx711Group_HID.

Dashboard companion

A Graph widget is ideal for a load cell — drop one pointed at the calibrated (post-Range) output to see the weight curve as you press the pedal / load the bridge, with the y-axis fixed to your expected range so two pedals compare visually. A Number Display alongside (with Unit = "g" or "kg") reports the live value. See Dashboards.

High-precision ADCs​

Boards' built-in ADCs are 10–12 bits and noisy enough at the LSB level that 8–10 effective bits is closer to reality. When you need more, plug in a dedicated chip:

ModuleChipResolutionBus
nADS1115TI ADS111516 bits, 4 channelsI²C
nAD7192AD719224 bits, 4 channels, integrated PGASPI

nADS1115 is the everyday upgrade — 16 bits at hundreds of Hz, four channels, costs a couple of euros. nAD7192 is the "I'm building a strain-gauge bridge" choice — 24 bits with the kind of low noise that lets it drive small bridge-output signals directly without external amplification.

Both expose per-channel gain, sample rate, and the bus parameters of I²C or SPI.

Magnetic angle — AS5600​

The AS5600 is a 12-bit contactless rotary sensor: glue a tiny diametric magnet to the end of your shaft, place the chip 1–3 mm below, and it reports the magnet's angle over I²C. Zero wear, sub-degree resolution, perfectly suited to wheel/pedal/throttle position sensing.

ParameterDescription
I²C Port / FrequencyStandard I²C config — see I²C tutorial.
In Min / In MaxRaw 12-bit range that maps to the output's nominal extremes. Often calibrated rather than typed (see below).
FilterOn-chip slow-mode IIR filter level (0 = off). Useful when the signal is noisy.
Dead Zone Low / HighIgnore zones at the ends of the travel.

The AS5600 has only one I²C address, so to use two you need two I²C buses (Wire and Wire1) or an I²C multiplexer. The AS5600_Dual_HID example shows the two-bus pattern. Single-sensor wiring: AS5600_HID.

Dashboard companion

For a wheel / pedal / lever, a Number Display with Unit = "°" shows the live angle and a Graph widget traces the rotation curve over time — both very useful while tuning travel and dead zones. A Number Selector with preset angles (e.g. 0=Centre, 90=Right, -90=Left) wired to a SetParam on a downstream module lets you flip between calibration test points without recompiling.

Magnetometer — MLX90393​

The Melexis MLX90393 is a 3-axis Hall-effect magnetometer with selectable resolution and range. Like the AS5600 it's contactless; unlike it, you get three axes of magnetic field, which makes it suitable for tilt-compensated electronic compasses, lever-position sensing with a magnet on the moving end, and generic non-contact joysticks.

It exposes the usual I²C parameters plus a Filter and per-axis resolution settings. See Examples/06-Sensors/MLX90393_HID.

IMUs — ICM-20600, LSM6DS, LIS3MDL​

An Inertial Measurement Unit combines an accelerometer, a gyroscope, and sometimes a magnetometer in one chip. NodeBlue ships modules for three popular ones:

ModuleChipComprises
nICM20600InvenSense ICM-206006-axis (3-axis accel + 3-axis gyro).
nLSM6DSST LSM6DS-family6-axis (3+3).
nLIS3MDLST LIS3MDL3-axis magnetometer (often paired with an LSM6DS for a 9-axis combo).

Each exposes the usual I²C bus parameters, the data rate, per-sensor full-scale range (±2g .. ±16g, ±125dps .. ±2000dps etc.), and 3 outputs per sensor delivering signed integer readings on each axis.

Examples: ICM20600_HID, LSM6DS_HID, LIS3MDL_HID, the 9-axis combo in LSM6DS_LIS3MDL_HID.

Dashboard companion

Three Graph widgets side by side — one each for X, Y, Z — make IMU motion immediately obvious while you're shaking / tilting the board. Lock all three to the same Y range (turn Auto Y off) so the traces are directly comparable.

Sensor fusion — turning IMU axes into orientation​

Raw accelerometer + gyroscope readings tell you instantaneous motion; what you usually want is orientation (roll / pitch / yaw, or a quaternion). Combining the two sensors into a stable orientation estimate is sensor fusion. NodeBlue offers three classic fusion algorithms:

ModuleAlgorithmNotes
nNXPSensorFusionNXP's reference fusion (Kalman-like).Computationally heavier, very stable.
nMahonyAHRSMahony filter — proportional/integral correction.Light, fast, easy to tune.
nMadgwickAHRSMadgwick filter — gradient-descent quaternion update.Light, lower drift than Mahony in many situations.

Wire your accel, gyro and (optionally) magnetometer outputs into the fusion module's inputs and you get back a quaternion and Euler angles. The TeensyPropMahony_HID and TeensyPropMahony_NRF examples build a wireless motion-tracked prop with a Teensy.

RFID — RDM6300​

The RDM6300 is a 125 kHz EM4100 RFID reader (the cheap blue-PCB module sold everywhere). It sits on a UART and emits the ID of any tag presented to its antenna. The nRDM6300 module wraps it: pick a Serial Port and its output emits the 10-digit ID as a buffer whenever a tag is read.

See Examples/04-Communication/RDM6300.

After the sensor — what's next​

Reading a value is rarely the end of the chain. The next few tutorials cover the common downstream steps: