Back to Automation & Control

Automation Fundamentals

Connecting Analog Sensors to a Controller

Learn how ADC loading and sensor response affect measured values.

  • By MySunDirection
  • 16 min read
Share this explanation
One-minute answer

A real system shows a symptom related to “Connecting Analog Sensors to a Controller”, and you need to find the cause before replacing parts or changing settings.

Connect a potentiometer or other analog sensor to an ADC without overlooking source impedance, acquisition time, reference range, taper, noise, filtering, protection and fault detection.

Select or check first
Acquisition time is not conversion time. Acquisition is the interval in which the input charges the sample capacitor; conversion is the interval in which the ADC resolves that held value. Firmware must meet both timing requirements.
Controlling assumption
Sensors, controller logic, actuator limits, timing, fault response and environmental conditions are defined together.
Top risk
Protect the input without creating a new measurement error. Do not let a sensor wire drive an ADC pin beyond the device's absolute maximum ratings. Select series resistance, clamps, filtering, isolation and grounding from the expected transient environment and the controller manufacturer's limits.
Proof
Check the exact manufacturer data, units and limits, then verify the result by calculation, measurement or a controlled acceptance test.
Start with the basics Optional foundation before “Connecting Analog Sensors to a Controller”

Automation-and-control basics

An automatic system measures a condition, decides what it means and commands an actuator while checking whether the expected result actually happened.

Sensor
A sensor converts a physical condition into a signal. Its range, uncertainty, response time, environment and failure behaviour matter as much as its nominal output.
Controller
A controller reads inputs, applies logic or a control law and issues outputs. Software cannot correct missing measurements, inadequate hardware authority or unsafe architecture.
Actuator
An actuator turns a command into physical action, such as motor torque, valve position or switching. Its real limits depend on load, supply, drive and duty.
Feedback
Feedback compares measured behaviour with the desired state so error can be corrected. Open-loop command assumes the action occurred; closed-loop control checks it.
Fault and safe state
A fault is an abnormal condition that may invalidate control. The safe response must be defined from the hazard and may require independent hardware, not only software.

How to use this article: Trace one complete chain—physical condition, sensor, signal conditioning, controller, drive, actuator and feedback—then ask how each link can fail.

On this page
  1. Treat the connection as a complete signal chain
  2. The ADC sample capacitor needs time to settle
  3. Mechanical movement does not guarantee a linear electrical response
  4. Scale the result and reserve room for fault detection

An analog input does not observe voltage without affecting it. Many microcontroller ADCs briefly connect the input through a switch to an internal hold capacitor. The source must charge that capacitor close enough to the new voltage during the available acquisition interval. Wiring resistance, the sensor's output impedance, previous channel voltage, external filters and the ADC's internal switch all influence the result. A stable-looking number can still be systematically wrong.

Treat the connection as a complete signal chain

Every stage can change the number
StageQuestion to answerCommon failure
SensorWhat range, impedance, bandwidth and fault behavior does it have?Wrong taper, worn contact or out-of-range output
WiringWhere are signal return and shield connected?Ground offset, coupled motor noise or broken conductor
ProtectionHow are overvoltage, ESD and input current bounded?Clamping outside device limits or injection into adjacent channels
Filter/bufferWill it settle within the required time and remain stable?Too much delay or an unstable op-amp driving capacitance
ADC/referenceWhat input range, acquisition time and resolution apply?Clipping, poor settling or noisy reference
SoftwareHow are scaling, plausibility and calibration handled?Averaging hides a fault or stale value

The ADC sample capacitor needs time to settle

Higher source resistance lengthens the settling time of the ADC's hold capacitor. The allowed impedance and acquisition interval must come from the selected converter's documentation.
Diagram description

The illustrated 10 kiloohm recommendation is specifically identified as a PIC16(L)F1503 data-sheet example. Internal resistance, capacitor value, switch behavior and timing differ between products.

Potentiometer source resistance

R_TH = R_top ∥ R_bottom = (R_top × R_bottom)/(R_top + R_bottom)

For an unloaded uniform potentiometer, this resistance is greatest at mid-travel and equals one quarter of total track resistance. Lead resistance, a series protection resistor, the sensor's real output impedance and the ADC's internal switch resistance add to the settling problem. A load connected to the wiper also changes both the ratio and source resistance.

R_TH
external Thevenin resistance seen from the wiper, ohms
R_top
track resistance above the wiper, ohms
R_bottom
track resistance below the wiper, ohms

First-order acquisition model

V_C(t) = V_final + (V_initial − V_final)e^(−t/(R_eq C_HOLD))

This simplified model explains why a large channel-to-channel voltage step and high source impedance can leave a residual error. The real minimum acquisition time also includes internal switch and interconnect resistance, temperature, converter resolution and the manufacturer's error target. Use the device-specific equation and limits rather than selecting time from this equation alone.

V_C(t)
hold-capacitor voltage after acquisition time t
V_initial
voltage retained before the new acquisition
V_final
new source voltage
R_eq
total effective charging resistance
C_HOLD
ADC sample-and-hold capacitance
Choose with bandwidth and stability in mind
ActionBenefitTrade-off or check
Use a lower-value potentiometerReduces worst-case source impedanceRaises track current and power; respect ratings
Increase acquisition timeAllows more settling without extra hardwareReduces maximum sample rate; device may limit configurability
Discard the first sample after channel changeGives additional acquisition opportunityNot a substitute for meeting data-sheet conditions
Add a suitable buffer amplifierPresents high impedance to sensor and low impedance to ADCOutput range, offset, bias, noise, stability and power matter
Add a local capacitorSupplies charge during brief samplingCreates response delay and transient current; size from vendor guidance
Sample channels in a helpful orderCan reduce the largest voltage stepsDoes not fix an otherwise noncompliant design

Mechanical movement does not guarantee a linear electrical response

Track taper determines the output-to-travel relationship. Component shape does not identify that taper; use the part number and data sheet.
Diagram description

The curves are qualitative and unloaded, not product traces or measured loudness. Audio tapers, terminal orientation and taper codes vary by manufacturer.

Match taper to the measurement task
ResponseTypical reason to use itController consequence
LinearPosition measurement and calibrationEqual shaft increments ideally produce equal ratio increments
Audio/log-likeHuman-perception control such as volumePosition needs a product-specific inverse mapping if used as a sensor
Custom/nonlinearCompensating mechanism or process geometryUse declared transfer curve and validate interpolation
UnknownUnidentified replacement partDo not assume; measure safely or obtain documentation

Scale the result and reserve room for fault detection

Ideal ADC code

C_ideal ≈ (2^N − 1) × V_in/V_ref

This familiar transfer is only a starting point. Offset, gain error, integral nonlinearity, quantization, reference tolerance and noise affect the observed code. Keep V_in inside the ADC's specified input range. For fault detection, some systems deliberately scale normal sensor travel away from both rails so an open or short can be distinguished from a valid endpoint.

C_ideal
ideal unsigned output code
N
ADC resolution in bits
V_in
settled input voltage
V_ref
ADC reference span for the stated transfer
Test the real hardware and firmware together
TestWhat to examine
Static pointsError at several traceable input voltages and positions
Large channel stepFirst and later samples after switching from low to high input
Source resistance sweepError against the device's documented limit and timing
Motor switching nearbyNoise, grounding and cable-routing sensitivity
Rapid movementFilter delay, sample rate and missed transients
Open, short and out-of-rangeDetection threshold, debounce and controlled response
Temperature and supply rangeReference, bias, sensor and protection drift

A controller only benefits from this analog value if the feedback path is defined and fault-checked, as explained in Open-Loop Commands Versus Real Feedback. The ideal divider and loading problem are introduced electrically in Combining Resistors and Building Voltage Dividers.

Selection boundary and evidence to keep with the decision

Treat “Connecting Analog Sensors to a Controller” as a selection problem, not only a definition. Record the required result, alternatives considered, the controlling assumption and the condition that would change the choice.

Keep evidence proportional to consequence: Check the exact manufacturer data, units and limits, then verify the result by calculation, measurement or a controlled acceptance test. Revisit the decision when the load, environment, duty, interface, regulation or maintenance plan changes.

One-minute questions

Questions to answer before you apply this lesson

What should I select or check first for Connecting Analog Sensors to a Controller?

Acquisition time is not conversion time. Acquisition is the interval in which the input charges the sample capacitor; conversion is the interval in which the ADC resolves that held value. Firmware must meet both timing requirements.

Which assumption can change the conclusion?

Sensors, controller logic, actuator limits, timing, fault response and environmental conditions are defined together.

What can go wrong if I copy the example directly?

Protect the input without creating a new measurement error. Do not let a sensor wire drive an ADC pin beyond the device's absolute maximum ratings. Select series resistance, clamps, filtering, isolation and grounding from the expected transient environment and the controller manufacturer's limits.

How do I verify the result in the real system?

Check the exact manufacturer data, units and limits, then verify the result by calculation, measurement or a controlled acceptance test.

Sources and further reading

  1. PIC16(L)F1503 14-Pin Flash, 8-Bit MCU Data SheetMicrochip Technology · 2026-10-13Official product documentation reviewed for the figure's named ADC example, acquisition model and device-specific recommended source-impedance context.
  2. Analog-to-Digital Converter Acquisition TimeMicrochip Technology Developer Help · 2026-10-13Manufacturer guidance reviewed for sample-and-hold acquisition, source and switch impedance, hold capacitance, settling and the distinction between acquisition and conversion time.
  3. The Potentiometer HandbookBourns · 2026-10-13Manufacturer handbook reviewed for resistance taper, loading, contact resistance variation and potentiometer application limits.
Educational image