If you use reference voltage of 3.3v but have a situation where the sensor voltage goes higher (4.7) at 200 uA could this damage the ADC circuitry? It’s a sensor circut that checks the switch states based on switches. For fault circuitry.

Also if you go from A1 to A2 both reading voltages with approx 100k total resistance (50-200 uA) on the voltage giving readings of 500mV to 3V how long does it take to do a good DC reading? I need higher impedance to protect certain low impedance devices on the circuitry.

What is the processor supply voltage?

It’s the 328P fed at 5v

wolframore:
If you use reference voltage of 3.3v but have a situation where the sensor voltage goes higher (4.7) at 200 uA could this damage the ADC circuitry? It’s a sensor circut that checks the switch states based on switches. For fault circuitry.

Not a problem. Pin voltage is only limitied by supply voltage of the MCU, not by Aref.
You just get 1023 if you feed more than Aref in the pin.

wolframore:
Also if you go from A1 to A2 both reading voltages with approx 100k total resistance (50-200 uA) on the voltage giving readings of 500mV to 3V how long does it take to do a good DC reading? I need higher impedance to protect certain low impedance devices on the circuitry.

Ghost charge from the previous channel reading could be a problem with high impedance sources.
The solution is to read the new channel twice. The second reading should be used.
Waiting (delays) between channels doesn't help.
Leo..

Thanks Leo I will have to test it. Ives got the test circuit modeled in proteus and how high can you go on the impedance if you read twice. I could get better separation in voltage if I can raise the resistance in parts of the circuit while using less power.

wolframore:
how high can you go on the impedance if you read twice.

If you go beyond 100k, then you should add a 100n cap from analogue pin to ground.
That capacitor gives the A/D something 'solid' to sample from.
1 Megohm shouldn't be a problem with a cap. 10Megohm, might still be ok.
An RC circuit like that gives ofcourse some settling delay.
Leo..

Capacitance of the ADC is 14 pF so 1-2 nF should be ample - 100 nF is really generous.

The RC time constant of 100 nF/100k network is 10 ms, too long for fast changing signals (10 Hz or more). A 1 nF cap would give a 0.1 ms RC which is not too bad, about the same time it takes to read the port itself.

Thanks guys 4 days on a simulator to get this circuit out of my head and biased correctly. Just need to get off my butt and breadboard something before I keep adding components.

wvmarle:
Capacitance of the ADC is 14 pF so 1-2 nF should be ample - 100 nF is really generous.

No, in fact 15nF is the bare minimum value you can use. 100nF pushes the cross talk well below
one LSB and is a commonly available value.

The ratio of charge on the sample cap to charge on the new analog pin should be < 1/1024
ideally, otherwise you inject more than one LSB of error when switching ADC channels, since the
error proportion is simply the ratio of the two capacitors.

With a 1nF cap you’d get upto 14LSB’s of error on switching for worse case voltage differences
on pins. That means your 10 bit ADC is now only 6 bit accurate.

Your numbers and arguments only make sense if you assume one channel is at 0V and the other at Vcc; and if the output impedance of the source is infinite.

100k output impedance of the source does contribute a lot to charging the port.

Awesome - breadboarded it out... it works amazingly enough... all readings within 10mV.

Question... is it possible to change internal ref to external 5v ref between readings? Since it will be similar in voltage would it take long to settle?

I would like to use internal for sensing balancing based on the 5v supply so it self balances...

then for battery voltage it would be more accurate to use a ref like LM4040 for accuracy.

wvmarle:
Capacitance of the ADC is 14 pF so 1-2 nF should be ample - 100 nF is really generous.

The RC time constant of 100 nF/100k network is 10 ms, too long for fast changing signals (10 Hz or more). A 1 nF cap would give a 0.1 ms RC which is not too bad, about the same time it takes to read the port itself.

But that means intolerable crosstalk (this is only an issue when using multiple analog pins remember) -
either put up with reduced bandwidth or buffer the signals to a low impedance.

wolframore:
Awesome - breadboarded it out... it works amazingly enough... all readings within 10mV.

Question... is it possible to change internal ref to external 5v ref between readings? Since it will be similar in voltage would it take long to settle?

Check the datasheet, it may be you have to take a reading and discard after every reference change,
just like at power up when the first reading isn't guaranteed to be correct. Its not "external 5V", its internal 5V (aka Vcc)

You also have to wait enough time for the decoupling cap on AREF to settle to the new voltage,
checkout the details in the datasheet.

I would like to use internal for sensing balancing based on the 5v supply so it self balances...

then for battery voltage it would be more accurate to use a ref like LM4040 for accuracy.

If you connect an external reference voltage to AREF then you must called analogReference(EXTERNAL)
before the first call to analogRead(), and leave it that way, otherwise you'll fry the chip. Either
the 5V or 1.1V references when selected drive the AREF pin and fight the external voltage source
(perhaps to the death)

Hmm might have to kill a couple chips to try

Didn’t need any capacitor for ADC input with ~ 100k circuits. It’s quick to switch between pins with no noticeable lag and quick to go from 0 to 3v between the two.

Ooh found this:
Alternatively, you can connect the external reference voltage to the AREF pin through a 5K resistor, allowing you to switch between external and internal reference voltages. Note that the resistor will alter the voltage that gets used as the reference because there is an internal 32K resistor on the AREF pin. The two act as a voltage divider, so, for example, 2.5V applied through the resistor will yield 2.5 * 32 / (32 + 5) = ~2.2V at the AREF pin.

5v ref through 5k resistor is about 4.3v. Full power for lipo will read as 1023. Empty 2.9 should read around 690.

The datasheet suggests accuracy will start to degrade above 10k impedance. This is worst case,
remember the variability between individual chips across the entire temperature range may be
fairly large, so 100k may be almost perfect on one chip at one temperature, but it won't be consistent
across all chips at all temperatures and supply voltages.

MarkT:
The datasheet suggests accuracy will start to degrade above 10k impedance. This is worst case,
remember the variability between individual chips across the entire temperature range may be
fairly large, so 100k may be almost perfect on one chip at one temperature, but it won't be consistent
across all chips at all temperatures and supply voltages.

Thanks Mark... great point!

Few things going for me

I spent 4 days designing to get 20% separation (1vdc) between the states.

I'm not concerned about the supply voltage since it's a closed system. If the supply voltage sags to 4.5v (eek...hypothetical example) The voltage sensed will also go lower at same ratio (using the same resistor dividers) so that in ADC reading should be the same within the same tolerance.

10k impedance makes more sense for AC readings which need quicker response to see the waveforms. In my case it's DC steps which equate to faults and status logic. I just needed more than binary on two areas of the circuit. I'm not trying to sample music - which wouldn't be great for the onboard ADC or the Arduino in general.

Don't forget:
Impedance is a measure of the opposition to AC current flow in a circuit measured in Ohms.