sensor. Figure 4 shows the measured temperature when I
touched the sensor and let go.
In this example, you can see the ambient temperature
of about 22°C before I touched the sensor. It rose about
2°C quickly in about three seconds. I let go and it cooled,
taking a longer time.
On the cooling leg, you can clearly see the 0.3°C
temperature steps corresponding to the resolution limit of
the Arduino’s ADC. This is not a sensor limitation; it is an
When the signal we care about is a small signal, we
just don’t have much sensitivity available from the 10-bit
Arduino analog inputs.
Problem #1 is the small resolution available with the
10-bit ADC. We just can’t see small changes with only 3
mV resolution even using the smaller Vref of 3.3V.
Problem #2 is there is a DC offset on the signal
(about 0.75V in this example). We can improve this by
adding some gain, but we have to be careful not to
exceed the 3.3V maximum voltage input to the ADC. This
would be a maximum gain of about four.
Problem #3 — just marginally an issue with this sensor
— is the output impedance of the sensor and what the
ADC pin needs to see. Section 23. 6.1 of the Atmel
manual states: “The ADC is optimized for analog signals
with an output impedance of approximately 10 kΩ or
less.” Where this spec comes from is explained in the
The output impedance of a sensor is a measure of
how much current it can source or sink. According to its
specs, the TMP36 has a maximum output current of about
50 uA of current draw possible. With roughly a 1V output
voltage, this is an output impedance of 1 V/50 uA = 20K
ohms. This is in the gray area of possibly a problem —
especially when looking at fast data acquisition.
One way of getting around these three problems and
enabling accurate and high resolution measurements from
a wide variety of sensors is using an analog front end
between the sensor output and the microcontroller input
to condition the analog signal.
An Analog Front End Essential Element:
We refer to all the electronics from the sensor
element to the input pin of the ADC as the analog front
end. While there is a huge variety of off-the-shelf building
block circuits we can use in the analog front end, the two
most important building blocks to solve all sensor
interface problems are operational amplifiers and
instrumentation amplifiers. An operational amplifier —
affectionately shortened to op-amp — is a super high gain
differential amplifier. Its output voltage is proportional to
the difference in voltage between its two input pins,
referred to as the V+ and V- inputs:
Voutput = G x (V+ — V-)
The value of G is often as high as 1,000,000. The
secret to using op-amps effectively is using combinations
of R and C elements in a feedback circuit to enable useful
features. Whole books are written about op-amp circuits
with specialized functions. A really great handbook by the
legendary Walter Jung called Op-Amp Applications
Handbook can be downloaded for free. The circuit we’ll
look at in this article is the non-inverting amplifier.
In the non-inverting amplifier, the input signal goes
into the V+ pin, and a simple resistor divider circuit
connects the output pin to the V- input as shown in Figure
5. The gain in this circuit is:
Since this amplifier is often the first circuit to interface
with a sensor, it is sometimes referred to as a pre-amp. An
important feature of the amplifier — in addition to
amplifying the signal — is to change the output impedance
of the sensor. It can take a sensor with really high output
impedance and provide a comparable signal level (or even
higher) with an output impedance of a few ohms. This
solves problem #3.
Among the three top suppliers of op-amps — Analog
Devices, Linear Technology, and Texas Instruments (TI) —
there are almost 500 different versions to choose from. I
February 2016 41
The Input Impedance of an Arduino ADC Pin
When the Arduino pin is read, the pin is switched into this
capacitance. The sensor driving this pin must charge up this 14 pF of
capacitance before it is read to get an accurate value. If it is still
charging when the pin is read, the value will be inaccurate.
If the source impedance of the sensor is 10K ohms, then the RC
time constant is 10^ 4 ohms x 14 x 10^- 12 F = 0.14 usec. If we wait for
six time constants, the signal will be within 0.2% of its final value. This
is 1 μsec — about the fastest possible acquisition time for an analog
If the output impedance of the sensor looks like a resistor of no
more than 10K ohms, then the voltage read by the ADC will have
settled to its final value before the voltage is actually read. If the
output impedance is larger than 10K ohms, there is a chance the
voltage will not have stabilized before it is read and the first
measurement may not be accurate.
This sort of problem is incredibly hard to debug. As risk reduction
in your design, just avoid the problem by always using a low enough
output impedance for the sensor.
This is the origin of the Atmel spec recommending the sensor
output impedance be less than 10K ohms to drive one of the ADC pins
and not lose accuracy even in the worst case.
R1 ) (