arduino adc delay

Hello All,

I want to start off by saying, if this question has been addressed I apologize and will gladly go and read the previous answers.

I have connected two (for now) FSR pads to analog pins a0 and a1 on my arduino mini. I have done this according to the tutorial I found on this sight and they seem to be reading ok. My question is about the necessary delay between the two reads. Right now I have been experimenting with values of between 100 and .25 for the delay.

At 100 I seem to get only one or two values returned. At .25 I have around 35. I understand that the number is dependent on how hard I strike the pad and the duration, so I have (unscientifically) attempted to be as consistent as possible. My concern is that if I am not getting all available values it might be possible that I am not getting the highest value. To put it another way, the values describe the usual bell curve and if I am not getting all the values the height of the curve might not be accurate.

To sum it all up, what is the minimum delay necessary to ensure proper use of the ADC on the arduino mini?

Thanks for pointing me in the right direction.

PS, I have done some research into the way the ADC works. For instance, I know that it supposedly can read 9600 times per second and that it has its own multiplexer that switches between the six available analog pins. I also know that the delay is necessary to allow the ADC to reset.

I don’t know that a delay is necessary for the ADC to “reset”. I have read that the code behind the AnalogRead() function doesn’t allow for any MUX settling time. I’ve not confirmed this on my own. So when switching between analog pins, the capacitances involved with the MUX and any SHA behind it may allow one reading to “bleed” into the next. Some residual of a big voltage in reading N may be leftover to corrupt a small voltage on reading N+1. W/o going beyond the normal Arduino commands you can’t control the switching of the MUX separate from the ADC sampling so what I’ve read (again I’ve not confirmed this) is that if you’re concerned the thing to do is read channel Ax and then toss the reading away. Read Ax again and keep it. Then go to channel Y, read channel Ay, toss it away, read Ay again and keep it. Do this every time you switch between analog pins.

It occurs to me that this is an easy problem to confirm or disprove. Wire 5V to pin A0 and ground to A1. Use a resistor that’s comparable to your sources expected output resistance. Write code to read A0, A0, A0 repeatedly to get it’s measure. Do the same for A1. Then write code that reads A0, A1, A0, A1 … back to back in quick succession. See what/if there’s any channel-channel interference.

Thanks for the quick answer, I will get this set up and see what I can tell from it.

It would be great if you can report your finds back here. Thanks!