Analog Input
Applies to: IOcan · Standalone controller. What this means
Overview
An Analog Input reads a voltage on a hardware pin and turns it into a scaled value. It is the most common input type — temperature, pressure, throttle and pedal position, fuel level, anything with a voltage output.
Voltages are entered in volts. The app converts into the device's internal representation for you.
Two things about the order of the stages are worth knowing before you set anything, because neither is obvious from the field names: the fault window is checked before the filter, and turning interpolation off changes what the channel reports. Both are covered below, and the full chain is on Common IO settings.
For a non-linear sensor, feed this input into a Map Input rather than trying to fit a straight line to it.
Which pins can read a voltage is a hardware question: the IOcan pinout lists its analog inputs, and the standalone controller pinout its own.
Prerequisites & hardware
- A sensor whose output is a voltage inside the selected range.
- Signal wired to the analog pin, sensor ground to sGND — not to a chassis point elsewhere in the car.
- Pick the Range that covers the sensor's full scale, and no larger, so you keep resolution.
- Pull-up: only pins with pull-up hardware have it, which is a minority. Where present, a resistive sensor such as an NTC can use it to form the divider; 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 name (e.g.
Oil Temp). - Set the Range to cover the sensor's full scale and no more.
- Set the scaling and fault thresholds, in volts.
- For a non-linear sensor, scale it downstream with a Map Input.
Settings reference
| Setting | Meaning | Unit | Range / values | Notes |
|---|---|---|---|---|
| Range | The measurable voltage span | — | 5 V, Internal 5 V, 12 V, Raw |
Pick the smallest that covers the sensor's full scale. Raw reports ADC counts with no scaling at all. |
| Pull-up | Enables the pin's pull-up | — | on / off | Only on pins that have the hardware, which most analog pins do not. Applied once when the configuration is loaded. |
| Low-pass filter | Smooths a noisy signal | — | on / off | A fixed fourth-order IIR filter — no cutoff to set. Adds lag; use it on slow signals, not on anything you are timing. |
| Enable interpolation | Applies the In → Out scaling | — | on / off | Off means no scaling at all — see below. |
| In min / In max | Voltage range to scale from | V | sint32 | The sensor's low and high points. |
| Out min / Out max | Value range to scale to | your unit | sint32 | What the input reports at In min and In max. |
| Saturation | Clamps the reading into In min…In max before scaling | — | on / off | Only does anything when interpolation is on. Off, a reading past either end extrapolates beyond your Out range. |
| Fault min / Fault max | Out-of-range window | V | sint32 | Readings below Fault min or above Fault max raise a watchdog fault. Both zero disables the check. Reversed values are swapped automatically. |
Interpolation off reports a proportion, not volts
With Enable interpolation off, nothing converts the reading into your
units, and the channel logs as a 0–1024 proportion of the selected Range —
512 on the 5 V range is 2.5 V.
That is not a fault, and it is the normal way to set up a non-linear sensor: leave this input unscaled and let a Map Input do the curve. It is worth recognising, because an input that suddenly reads 0–1024 instead of degrees looks broken when it is simply unscaled.
The fault window
Fault min/max are checked before the low-pass filter, so a fault is raised on the real signal rather than a smoothed one.
Four faults come out of this, and the difference between them is how far out the reading is:
| Code | Meaning |
|---|---|
0x0101 |
Below Fault min |
0x0102 |
Above Fault max |
0x0103 |
Essentially at zero — shorted to ground |
0x0104 |
Essentially at full scale — shorted to the sensor supply |
Full descriptions on Fault codes.
The whole check is inhibited unless the car is properly powered. It does not run until ignition is on and the battery reads above about 8 V, plus a short settling period, and it stops again whenever the internal 5 V rail is out of specification. On a USB-only bench setup you will not see these faults at all — which is worth knowing before you conclude your fault window works.
Common settings
Analog Input also uses the shared Name and Pin settings. See Common IO settings.
Example — 0.5–4.5 V pressure sensor reading 0–10 bar
- Type Analog Input, name
Oil Pressure, on the sensor's pin. - Range
5 V. - Enable interpolation on, In min
0.5V, In max4.5V. - Out min
0, Out max1000— tenths of a bar, so you keep a decimal place through the integer arithmetic. - Saturation on, so a sensor reading slightly outside its span does not report a negative pressure.
- Fault min
0.2V, Fault max4.8V — outside the sensor's real span but inside the rails, so an open or shorted signal is caught and normal readings are not.
Example — coolant temperature (NTC)
- Type Analog Input, name
Coolant Temp Raw, 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 resistor externally. - Low-pass filter on — coolant temperature changes slowly, so the lag costs nothing.
- Enable interpolation off. The channel now reports a 0–1024 proportion of the 5 V range, and the curve is done properly in the next step.
- Feed
Coolant Temp Rawinto a Map Input with a reading → °C curve from the sensor data sheet. An NTC is far too non-linear for two points.
Troubleshooting
- Reads 0–1024 instead of your engineering values: Enable interpolation is off, so the channel is reporting a proportion of the Range. That is deliberate when a Map Input does the scaling; turn interpolation on if it is not.
- Scaling is out by a constant factor: check the Range — In min/max are volts, but they only mean what you intend if the Range covers the sensor.
- Reading goes negative or past full scale: turn Saturation on. It only applies with interpolation on.
- Value noisy or jumpy: enable the low-pass filter — unless you are timing the signal, in which case fix the noise at the sensor.
- No fault when the sensor is disconnected: either Fault min and Fault max are both zero (check disabled), or the watchdog is inhibited because the car is not powered up — see above.
- Curve is wrong at the ends but right in the middle: the sensor is non-linear. Use a Map Input.
Related
- Common IO settings — the full signal chain
- Analog Switch Input — detect a switch level on an analog pin
- Map Input — multi-point scaling for non-linear sensors
- Scaling and maps · Fault codes