Using two analog inputs and occurs distortion on the measure

I’m using two analog inputs, the first with a LDR and a resistor of 10k Ohm, connected at P9_39 (AIN0), and the second connected at P9_38 (AIN3).
When the lights are down, the measure of LM35 works very well, with a low distorction, +/- 0.2 ºC.
But when the lights are on, the measure of LM35 starts to float, about +/- 1 ºC.
I have tried to put a 4.7nF between GNDA_ADC and AIN3, but the distorction continues.

I asking for help to diminish this distorction when the lights are on.

Ain3 has a maximum input voltage of 1.8v
the lm35 is being powered from a +5v supply
your going to need to do something a bit different with the output of
the LM35 so you dont damage the adc input.

I am using LM35 to read maximum of 40 ºC, max of 0.4V.
Am I right to think that problem is caused by the low impedance of LM35 output?

(I uploaded the original image on this post)

conection.bmp (5.2 MB)

The problem you are experiencing is due to the sample and hold of of the ADC input which is multiplexed to all analog inputs. If you don’t use a low impedance source, you will see bleed through from one ADC channel to the next. What you need is a opamp connected between the circuits you are measuring and the ADC input. The opamp will provide a low impedance source for the sample and hole (S&H) and prevent the bleed through from one channel to the next.


Oh, thank you for the explanation.
Are you talking about opamp as buffer or other circuit?

Não gracinha, tá falando da pqp

Yes, you use the opamp as a low impedance buffer and you can also use it to scale the input to a range suitable for the ADC. Have a look at Analog Devices, (, they have many application notes on how to use an opamp as a signal conditioner suitable for an ADC.


Thanks, John.

But I didn’t understand yet how the high impedance on the input may cause this error. The ADC input usually have a high impedance and the S&H have a capacitor, the problem is related with the time to charge the capacitor?

Yes, the problem is a combination of the multiplexor and the S&H. Let’s say ADC0 is 3.5V and ADC1 is 0.2V and ADC2 is 2V. The S&H must first charge the capacitor to 3.5V for ADC0 and then the multiplexor changes to ADC1 and discharges the cap to 0.2V and then the mux changes to ADC2 and charges the cap to 2V. Now, if the source impedance of the circuits that feed ADC0, ADC1 and ADC2 are not low impedance, then the S&H cap will not charge/discharge fully before the ADC does the conversion. The time constant T=RC where T is the S&H window, R is the source impedance and C is the S&H cap. So if R is not low enough, you will see the accuracy of your conversion affected by the voltage of the previous channel. Alternatively, you can slow the sample rate and conversion time in the device tree and that will improve your accuracy.


Thanks John, I will test the circuit with a opamp and post the result here.