Analog Input¶
Overview¶
An Analog Input reads an analog voltage on a hardware pin and converts it into a
scaled engineering value. It is the most common input type — used for any
voltage-output sensor such as temperature (NTC), pressure, throttle/pedal
position, fuel level, and similar.
The raw measured voltage is mapped to an output value using the input/output
two-point scaling below. For a non-linear sensor, feed this input into a
Map Input for multi-point scaling.
Prerequisites & hardware¶
- A sensor whose output is a voltage within the selected range.
- Wire the sensor signal to the chosen analog pin and its ground to controller ground.
- Pick the range to match the sensor's full-scale voltage so you use the full
ADC resolution. -
Pull-up: most analog pins have no pull-up hardware, so the option is
unavailable on the majority of inputs. Where a pin does support it, a resistive
sensor (e.g. an NTC thermistor) can use it to form a divider instead of an
external resistor. Otherwise, fit the divider externally.
Add it in the app¶
- Add a new input and choose Analog Input as the type.
- Select the pin the sensor is wired to.
- Give it a clear alias (e.g.
Oil Temp). - Set the range, scaling and fault thresholds below.
- For a non-linear sensor, scale it with a Map Input.
Settings reference¶
Schema:
config/AdcConfiguration.proto.
| Setting | Meaning | Unit | Range / values | Notes |
|---|---|---|---|---|
| Range | Input voltage range / scaling reference | — |
5 V, Internal 5 V, 12 V, Raw
|
Choose the smallest range that covers the sensor's full-scale voltage. Raw reports unscaled ADC counts. |
| Pull-up | Enables an internal pull-up on the pin | — | on / off | Only available on pins with pull-up hardware — most analog pins do not have it. Where present, lets resistive sensors (e.g. NTC) form a voltage divider. |
| Low-pass filter | Smooths a noisy signal | — | on / off | Reduces jitter; adds a small amount of lag. |
| Saturation | Clamps the output to the out min/max range | — | on / off | When on, values are limited to Out min … Out max instead of extrapolating. |
| Enable interpolation | Linearly interpolates between the in/out scaling points | — | on / off | Off = step/clamped mapping. |
| In min / In max | Raw input range to scale from | mV (raw counts if Raw) |
sint32 | The measured low/high points. |
| Out min / Out max | Engineering range to scale to | input unit | sint32 | The value reported at In min / In max. |
| Fault min / Fault max | Out-of-range thresholds that flag a fault | mV | sint32 | Readings outside this band indicate an open/short or failed sensor. |
Scaling: the input is mapped from In min…In max to Out min…Out max using
two-point interpolation.
For example, a 0.5–4.5 V pressure sensor reading 0–10 bar: set In min/max to the
voltages and Out min/max to 0/10. Non-linear sensors should instead pass this
input through a Map Input for
multi-point scaling.
Common settings¶
Analog Input also uses the shared settings — alias and pin. See
Common IO Settings.
Example — coolant temperature (NTC)¶
- Type Analog Input, alias
Coolant Temp, on the sensor's pin. - Range
5 V. If the pin has pull-up hardware, enable Pull-up to form the
divider with the NTC; otherwise fit the divider resistor externally. - Low-pass filter on (temperature changes slowly; suppress noise).
- Feed this input into a Map Input with a voltage → °C curve from
the data sheet (NTCs are strongly non-linear, so a two-point scale is not enough). - Set Fault min/max just inside the supply rails to catch an open or shorted
sensor.
Troubleshooting¶
-
Reads full-scale or zero / stuck: check wiring; the value may be sitting
outside the Fault min/max band (open or shorted sensor). - Value noisy / jumpy: enable the Low-pass filter.
-
Reading scales wrong: verify In min/max are in the same units as the
measured signal and that Range matches the sensor. -
Non-linear / offset reading: scale it with a Map Input rather
than the straight in/out scale.
Related¶
-
Analog Switch Input — multi-position switch on one
analog pin. - Map Input — multi-point scaling for non-linear sensors.
- Scaling & Maps
Updated by Adam Klama 1 day ago · 2 revisions