Automation Fundamentals
Connecting Analog Sensors to a Controller
Learn how ADC loading and sensor response affect measured values.
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
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
| Stage | Question to answer | Common failure |
|---|---|---|
| Sensor | What range, impedance, bandwidth and fault behavior does it have? | Wrong taper, worn contact or out-of-range output |
| Wiring | Where are signal return and shield connected? | Ground offset, coupled motor noise or broken conductor |
| Protection | How are overvoltage, ESD and input current bounded? | Clamping outside device limits or injection into adjacent channels |
| Filter/buffer | Will it settle within the required time and remain stable? | Too much delay or an unstable op-amp driving capacitance |
| ADC/reference | What input range, acquisition time and resolution apply? | Clipping, poor settling or noisy reference |
| Software | How are scaling, plausibility and calibration handled? | Averaging hides a fault or stale value |
The ADC sample capacitor needs time to settle
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
| Action | Benefit | Trade-off or check |
|---|---|---|
| Use a lower-value potentiometer | Reduces worst-case source impedance | Raises track current and power; respect ratings |
| Increase acquisition time | Allows more settling without extra hardware | Reduces maximum sample rate; device may limit configurability |
| Discard the first sample after channel change | Gives additional acquisition opportunity | Not a substitute for meeting data-sheet conditions |
| Add a suitable buffer amplifier | Presents high impedance to sensor and low impedance to ADC | Output range, offset, bias, noise, stability and power matter |
| Add a local capacitor | Supplies charge during brief sampling | Creates response delay and transient current; size from vendor guidance |
| Sample channels in a helpful order | Can reduce the largest voltage steps | Does not fix an otherwise noncompliant design |
Mechanical movement does not guarantee a linear electrical response
Diagram description
The curves are qualitative and unloaded, not product traces or measured loudness. Audio tapers, terminal orientation and taper codes vary by manufacturer.
| Response | Typical reason to use it | Controller consequence |
|---|---|---|
| Linear | Position measurement and calibration | Equal shaft increments ideally produce equal ratio increments |
| Audio/log-like | Human-perception control such as volume | Position needs a product-specific inverse mapping if used as a sensor |
| Custom/nonlinear | Compensating mechanism or process geometry | Use declared transfer curve and validate interpolation |
| Unknown | Unidentified replacement part | Do 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 | What to examine |
|---|---|
| Static points | Error at several traceable input voltages and positions |
| Large channel step | First and later samples after switching from low to high input |
| Source resistance sweep | Error against the device's documented limit and timing |
| Motor switching nearby | Noise, grounding and cable-routing sensitivity |
| Rapid movement | Filter delay, sample rate and missed transients |
| Open, short and out-of-range | Detection threshold, debounce and controlled response |
| Temperature and supply range | Reference, 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
- 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.
- 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.
- The Potentiometer HandbookBourns · 2026-10-13Manufacturer handbook reviewed for resistance taper, loading, contact resistance variation and potentiometer application limits.