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.
| Parameter | Description |
|---|---|
| Pin | The GPIO the sensor's data line is connected to. |
| Resolution | 9–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.
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:
| Module | When to use |
|---|---|
| nHX711 | One load cell, one HX711 — simple weight measurement. |
| nHX711Group | Several HX711s connected to one common SCK pin and individual DOUT pins — for multi-axis force plates, brake pedals with four corner cells, etc. |
| Parameter | Description |
|---|---|
| DOUT / SCK pins | The two GPIOs the HX711 uses. |
| Gain | 32 / 64 / 128 — sets the analog gain on the HX711's PGA. 128 is most common. |
| Sample rate | 10 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.
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:
| Module | Chip | Resolution | Bus |
|---|---|---|---|
| nADS1115 | TI ADS1115 | 16 bits, 4 channels | I²C |
| nAD7192 | AD7192 | 24 bits, 4 channels, integrated PGA | SPI |
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.
| Parameter | Description |
|---|---|
| I²C Port / Frequency | Standard I²C config — see I²C tutorial. |
| In Min / In Max | Raw 12-bit range that maps to the output's nominal extremes. Often calibrated rather than typed (see below). |
| Filter | On-chip slow-mode IIR filter level (0 = off). Useful when the signal is noisy. |
| Dead Zone Low / High | Ignore 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.
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:
| Module | Chip | Comprises |
|---|---|---|
| nICM20600 | InvenSense ICM-20600 | 6-axis (3-axis accel + 3-axis gyro). |
| nLSM6DS | ST LSM6DS-family | 6-axis (3+3). |
| nLIS3MDL | ST LIS3MDL | 3-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.
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:
| Module | Algorithm | Notes |
|---|---|---|
| nNXPSensorFusion | NXP's reference fusion (Kalman-like). | Computationally heavier, very stable. |
| nMahonyAHRS | Mahony filter — proportional/integral correction. | Light, fast, easy to tune. |
| nMadgwickAHRS | Madgwick 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:
- Buttons & switches — the other half of the input picture: contact-closure devices and the button-variant modules.
- Battery, Sleep & Power Management — feeding the board, reporting cell state, and saving energy.
- Encoders & rotary inputs — for the rotary-position sensors not covered here.
- Range, Calibration & Spline — turn a raw sensor reading into a usable, calibrated, smoothed value.