Overview
The LoopString Parts Library includes two flexible "meta" sensor types that unlock use cases beyond the purpose-built parts:
The Generic Programmable Analog Sensor connects any 4-20mA, 0-10V, 0-5V, or 0-3.3V transmitter to your Pi via a Sequent Microsystems HAT. You configure the signal type, input and output ranges, and units — and the Configurator generates the flow that maps raw electrical values to meaningful measurements on your dashboard. Optional multi-point calibration in the dashboard lets you correct for sensor nonlinearity after deploy.
The Pi Native System Signal parts read directly from the Linux kernel on your Raspberry Pi — no wiring, no external hardware, no cost. They report CPU temperature, CPU usage percentage, memory usage percentage, and disk usage percentage. These signals appear on your dashboard like any other sensor and can be wired to controllers, alert thresholds, and the device health panel.
Both types are marked with a cost of $0 because they require no additional hardware beyond what you already have.
Generic Programmable Analog Sensor
When to Use This Part
Choose the Generic Analog Sensor when:
- You have an industrial sensor with a 4-20mA or voltage output that does not have a dedicated part in the library (pressure transducers, level sensors, pH transmitters, flow meters, weight transmitters, etc.)
- You want to connect a sensor with a non-standard measurement range and output unit
- You need multi-point calibration to correct for sensor drift or nonlinearity
Do not use this part for sensors that already have a dedicated part (DS18B20 temperature, Atlas Scientific EZO probes, BME280, etc.) — those purpose-built parts handle protocol quirks that the generic sensor does not.
How to Wire It
- Power off your Pi before making any connections.
- Connect the sensor analog output to an ADC input channel on your Sequent Microsystems HAT (AI1 through AI8).
- For 4-20mA loop-powered sensors: connect the mA+ and mA- terminals on the BAS HAT. The HAT has a built-in precision shunt resistor — no additional resistor is needed.
- For voltage output sensors: wire the sensor output directly to the analog input screw terminal. Ensure the sensor output voltage does not exceed the HAT input range.
- Provide excitation power to the sensor from an appropriate external supply. Loop-powered 4-20mA transmitters typically require 24V DC.
- After wiring, power on the Pi.
Configuration Options
After adding the part to a room in the Configurator, click the part card to open its settings.
Signal Type — The electrical signal your transmitter outputs. Options are 4-20 mA, 0-10 V, 0-5 V, and 0-3.3 V. Default is 4-20 mA. Select this first so the flow generator knows how to interpret the raw ADC value.
Sensor Name — An optional custom display name for this sensor on the dashboard (for example, "Mash Pressure" or "Tank Level"). If left blank, the part name is used.
Measurement Type — What this sensor measures. Used for dashboard grouping and the signal registry. Options are pH, Pressure, Flow Rate, Level, Humidity, Temperature, and Custom. Select Custom for anything that does not fit a listed category.
Input Range Min — The raw signal value at the low end of the transmitter's output range. For a 4-20mA sensor this is 4. For a 0-10V sensor this is 0. Default is 4.
Input Range Max — The raw signal value at the high end of the transmitter's output range. For a 4-20mA sensor this is 20. For a 0-10V sensor this is 10. Default is 20.
Output Range Min — The measurement value that corresponds to the input minimum. For example, if a pressure transmitter outputs 4mA at 0 PSI, set this to 0. Default is 0.
Output Range Max — The measurement value that corresponds to the input maximum. For example, if the transmitter outputs 20mA at 150 PSI, set this to 150. Default is 100.
Output Unit — The display unit label for the mapped measurement. Type any string here: psi, GPM, pH, kg, %, ft, etc. This label appears on the dashboard card.
Polling Interval — How often the Pi reads the ADC and publishes a new value. Minimum is 500 milliseconds. Default is 5 seconds. Increase this interval for slow-changing measurements to reduce Firebase writes and stay within tier limits.
How Range Mapping Works
The Configurator generates a linear interpolation function in your Node-RED flow. When the Pi reads the ADC, the raw value is clamped to your input range and mapped proportionally to the output range. The formula is:
mapped value = Output Min + ((raw - Input Min) / (Input Max - Input Min)) × (Output Max - Output Min)For example, with Input Min 4, Input Max 20, Output Min 0, Output Max 150 (PSI): a raw reading of 12 mA maps to 75 PSI.
Values outside the input range are clamped to the nearest endpoint rather than extrapolated.
Multi-Point Calibration (Dashboard Calibration Wizard)
After deploying, you can refine the sensor using the dashboard calibration wizard. Navigate to your sensor card and open the calibration option from the card menu.
Two calibration modes are available:
Offset Mode — Applies a fixed offset to every reading. Use this when the sensor reads consistently high or low. For example, if your transmitter always reads 2 PSI high when you know the true pressure is 0 PSI, set an offset of -2.
Linear Mode — Applies a gain and offset correction. Use this when the span (scale factor) of the sensor is slightly off. You provide two known reference points and the calibration system calculates the adjustment.
Calibration is applied on the display side — the raw data in Firebase is unchanged. Every surface that shows sensor data (SensorStat cards, Sparklines, Analytics charts) applies calibration in real time. This means you can always adjust or remove calibration without losing historical data.
Pi Native System Signals
What These Parts Provide
The following system signal parts are available in the Parts Library under the System category:
Pi CPU Temperature — The SoC core temperature in degrees Celsius, read from the Linux kernel thermal zone. Published every 30 seconds by default. Minimum sample interval is 5 seconds.
Pi GPU Temperature — The GPU temperature in degrees Celsius, read via the vcgencmd utility that comes pre-installed on Raspberry Pi OS. On the Pi 5, this reports the same silicon die as the CPU temperature. Published every 30 seconds by default.
Pi CPU Usage — CPU utilization as a percentage (0–100), computed from the delta between consecutive reads of /proc/stat. The first reading after deploy is skipped because there is no prior baseline to compare against. Minimum sample interval is 10 seconds — shorter intervals produce inaccurate deltas. Default is 30 seconds.
Pi Memory Usage — Memory utilization as a percentage, computed from /proc/meminfo (MemTotal minus MemAvailable, divided by MemTotal). Default interval is 60 seconds. Minimum is 5 seconds.
Disk usage and uptime are reported by the loopstring-sf-health background subflow, which runs every 60 seconds independently of the individual system signal parts. The Device Health panel in your dashboard always shows disk and uptime regardless of which system signal parts you have added in the Configurator.
No Wiring Required
System signal parts have zero pin count and no interface requirements. They do not use GPIO, I2C, UART, or any HAT. Just add the part to a room, set the sample interval, and deploy. The signals appear on your dashboard immediately after the Pi picks up the new flow.
How to Add System Signals
- Open your project in the Configurator.
- Click Add Part inside any room.
- Search for "Pi" or browse the System category.
- Add the desired signal parts (CPU Temperature, CPU Usage, Memory Usage, etc.).
- Set the sample interval for each. Default values are appropriate for most cases.
- Wire the output signals to controllers or leave them unwired to appear as standalone dashboard cards.
- Deploy to your Pi.
Wiring System Signals to Controllers
System signals can be wired like any other sensor signal:
- Wire Pi CPU Temperature to a Hysteresis Controller controlling a Pi GPIO Fan (On/Off) or Pi GPIO Fan (PWM) for automatic thermal management. For example, turn on the fan at 65°C and off at 55°C.
- Wire Pi CPU Temperature to a PID Controller driving a Pi GPIO Fan (PWM) for smooth variable-speed fan control. The PID adjusts fan speed proportionally to hold a target temperature.
- Wire Pi CPU Usage to an alert threshold so you get notified when sustained high load indicates a runaway process.
- Wire Pi Memory Usage to the same alert setup to catch memory leaks in long-running Node-RED flows.
Alert Thresholds for System Signals
Set alert thresholds directly on the sensor card in the dashboard:
- CPU temperature: default warning at 70°C, critical at 80°C
- CPU usage: default warning at 90%, critical at 95%
- Memory usage: default warning at 85%, critical at 95%
The device health panel shows all system metrics together with colored status indicators and provides a quick overview without requiring individual alert configuration.
Use Cases
4-20mA Pressure Transducer on a Brewing System
A 4-20mA pressure transmitter mounted on a fermenter measures tank pressure from 0 to 30 PSI. The transmitter needs 24V DC excitation and outputs a current proportional to pressure.
In the Configurator, add a Generic Programmable Analog Sensor to your fermenter room. Set Signal Type to 4-20 mA, Input Min to 4, Input Max to 20, Output Min to 0, Output Max to 30, and Output Unit to psi. Name it "Fermenter Pressure." Wire the sensor output through the HAT BAS input. Deploy to Pi.
After a few days, if you notice the reading is consistently 0.5 PSI high compared to a calibrated gauge, open the calibration wizard and apply an offset of -0.5. The dashboard immediately reflects the corrected values, and no redeployment is required.
Pi Thermal Management for a Server Rack Pi
A Raspberry Pi 4 running as a home automation hub is mounted in a warm rack enclosure. Without cooling, CPU temperature climbs above 75°C under load, causing thermal throttling.
In the Configurator, add a Pi CPU Temperature part and a Pi GPIO Fan (PWM) part to a System room. Wire the CPU Temperature output to a PID Controller. Set the PID target (setpoint) to 60°C. Wire the PID output to the GPIO Fan PWM actuator on GPIO 18. Set the fan minimum duty cycle to 20% to prevent stall.
After deploying, the fan runs at low speed when the Pi is idle and ramps up under load, maintaining a stable operating temperature without manual intervention.
Troubleshooting
The Generic Sensor Reads 0 or Does Not Update
First check that the correct ADC channel is selected in the HAT configuration for this sensor's room. Then verify that the physical wiring goes to that channel's screw terminal. For 4-20mA sensors, confirm the sensor is receiving its excitation voltage from an external supply — a 4-20mA loop with no power produces no signal. Check that the sensor is not in fault mode (some transmitters output less than 4mA on fault). Open the Node-RED editor on the Pi and inject a test message to the mapping function to verify the flow is reaching that node.
The Generic Sensor Reads the Wrong Value
Double-check your Output Range Min and Output Range Max against the sensor datasheet. These must match the physical measurement range, not the electrical range. For example, a pressure sensor with a 0-10 bar range and 4-20mA output should have Output Min 0, Output Max 10 with unit "bar" — not Output Max 20 (which would be the electrical range). If the reading is consistently offset, use the dashboard calibration wizard to add a correction without redeploying.
Pi CPU Usage Shows No Value After Deploy
This is expected behavior for the first reading interval. The CPU usage calculation computes the difference between two consecutive /proc/stat reads. There is no prior baseline until the first interval has elapsed, so the node returns no value for the first cycle. Wait for the second interval (default 30 seconds) and the reading will appear. If it still does not appear after two intervals, check the flow is deployed and the inject timer is running.
Pi CPU Temperature Reads Much Higher Than Expected
If the CPU temperature is consistently above 80°C at idle, the Pi enclosure may be blocking airflow. Remove the lid or add ventilation. If you are using a Pi 4 in a closed case, a small heatsink on the SoC makes a significant difference. You can also reduce the sample interval on CPU temperature to 10 seconds during troubleshooting so you get faster feedback while experimenting with cooling changes. Remember to restore the interval afterward to avoid unnecessary Firebase writes.
System Signal Parts Not Visible in Parts Library
System signal parts appear under the System category in the parts library search. If you are searching by name, try searching for "Pi" to find all Pi-native parts together. These parts are not listed under Temperature or Environmental — they have their own System category. If the category does not appear in the sidebar, scroll down past the protocol bridge parts.
Memory Usage or Disk Usage Not Matching System Commands
The dashboard memory percentage is computed from MemAvailable (not MemFree) per /proc/meminfo. MemAvailable includes kernel cache that can be reclaimed, so it reads lower (more available) than some other tools that use MemFree. This matches the behavior of tools like free -h. Disk usage comes from the loopstring-sf-health subflow using df on the root partition. If your data is on a separate mount point, that mount will not be reflected in the disk usage reading.
Known Issues and Limitations
Generic Analog Sensor — no polynomial calibration in flow generator. The Configurator only supports linear (two-point) range mapping in the generated flow. For sensors with significantly nonlinear response curves, use the dashboard calibration wizard after deploy, which supports multi-point correction applied on the display side.
Pi CPU Usage — first reading is always skipped. This is by design, not a bug. The delta-based calculation needs a prior baseline. A sample interval shorter than 10 seconds produces unreliable results because the delta between two rapid reads of /proc/stat may not capture a representative slice of CPU time.
Pi GPU Temperature — not available on non-Pi hardware. The vcgencmd utility is specific to Raspberry Pi OS. If your Pi is running a third-party OS image, vcgencmd may not be present. In that case, use Pi CPU Temperature instead (which reads from /sys/class/thermal and works on any Linux distribution).
Disk and uptime on the dashboard do not come from Parts Library parts. These metrics are published by the loopstring-sf-health background subflow, which runs independently of any parts you add in the Configurator. You cannot set the publish interval for disk or uptime from the Configurator — they always publish every 60 seconds. View them in the Device Health panel rather than as standalone sensor cards.
Related Documentation
- Adding Rooms and Parts — how to add any part to a room
- Wiring Flows — how to connect sensor outputs to controllers
- Deploying to Pi — deploy your configuration after adding parts
- Configurator Overview — start here if you are new to the Configurator