Conceptualizing an analog input pin on a microcontroller

analoginputmicrocontroller

As I am trying to learn basic circuit design I would like to build and simulate simple models to test my conceptual understanding. One of the first designs I am trying to tackle is to use an analog input pin on a microcontroller, but it is not clear to me how the pin itself should be modeled (and indeed thus how it behaves in a real circuit).

Can I think of an analog input pin as behaving like a multimeter set to read DC voltage, with the negative lead attached to ground? And does it, like a multimeter, have some large internal resistance?

Best Answer

As a basic approximation, yes, the input is similar to a multimeter. If you want to take this further for high speed or high accuracy signals, you will find that most microcontroller ADCs use a Successive Approximation Register Architecture to read the voltage. These take some time to read the analog signal, so there needs to be a method to hold the signal on the pin.

A sample and hold circuit is normally used to take a sample of the signal. This involves connecting the input to a small capacitor (pF range I believe) via an op-amp buffer. The measurement is then taken against the voltage held on this capacitor. For a higher accuracy approximation, we can look at the input as the input to a op-amp, configured as a voltage follower. This will be a very high input resistance as it will be a gate of a mosfet, with some capacitance becoming more significant at higher frequencies

So as a simple approximation, a large resistance will be reasonably accurate. For a more complex model, a small gate capacitance with some series resistance from the switch, and a very small inductance from the package and wires connecting to it,