Analog pin problems

alkopop79:
I wonder, is there a plug socket that breaks the existing connection between the pull-down while creating a new connection?

Yes. Many mono and stereo phone jacks (like for headphones) have a switch which opens when you plug in a cable. In normal use this disconnects the speaker(s) when you plug in headphones but can be used for your pull-down resistors.

Brilliant! Thanks!

Unfortunately, whatever resistor I use the connections effect each other.

That is because the values you are using are too large.
If the impedance of anything fed into the analogue inputs is greater than 10K, there is not enough time to charge the sample capacitor before the sample is taken.
So can you lower your impedance?
Your solution of shorting it out will only result in you not getting the right value the first time you take the reading although you might miss this.

I've tried 1 ohm to 1 M reistors and some in between. No succes. What are you suggesting, Mike?

Grumpy_Mike:
Your solution of shorting it out will only result in you not getting the right value the first time you take the reading although you might miss this.

I guess if I add a short delay, it would should be all right.

[quote author=Grumpy_Mike link=topic=72289.msg597190#msg597190 date=1321357387
That is because the values you are using are too large.
If the impedance of anything fed into the analogue inputs is greater than 10K, there is not enough time to charge the sample capacitor before the sample is taken.
So can you lower your impedance?
[/quote]

Sorry Mike but I'm still struggling with the idea of impedance. Can you give me an example? And what does that mean that the analog inputs have great impedance? What are the implications of these?

If the analog input has high impedance, what happens when you add a low and a high impedance source?

If an analog input has high impedance (whatever it means), does it mean it allows more current through than a low impedance input? Any help to shed some lights on this issue would be appreciated!

BTW, does it help if I set the internal pull-ups? Are they any better or reliable than the external ones?

Are they any better or reliable than the external ones?

No.

An impedance is like a series resistance to the voltage source. In your case the voltage source is a resistance so it means the value.

I guess if I add a short delay, it would should be all right.

No... the delay you need is between the switching of the multiplexer and the grabbing of the sample. This can only be acheaved by taking two readings of the same panel.

I've tried 1 ohm t

If you truly have then you have something else that is seriously wrong. Can you provide a schematic of what you have.

Sure!

[url=http://[]](Photobucket | Make your memories fun!)

Grrrrrrrrrrrrr, direct link here:

http://tiny.cc/hwg2r

Needless to say, I use multiplexers instead of the Arduino's analog inputs. I've been using 46 Ohm resistors lately. They seem to work fine up until I insert multiple voltage sources on the inputs. That's when the voltage sources start effecting all the pins. Also, pull-downs seem to reduce the sensitivity of the analog inputs dramatically. Normally the range of an analog input is 0-1023. With these pull downs it's about 0-20. What am I doing wrong?

220 Ohm is too low of a pull-down for your 0 to 10K output resistance voltage source. :smiley: It should be much higher than the maximum output resistance of your voltage source (at least 1:10), in order to not have a measurable effect on the voltage read.

If you pot is at, say, 60% from ground, that is like a resistor divider where you have an 4K resistor on top and a parallel of a 6K and 220 Ohm resistor below (I'm supposing you understand how a pot works). If you had only the pot, the voltage at the moving pin of the pot (the output voltage, the one you want to measure) is 5V x (10K x 60%) / 10K = 3V. With the 220 Ohm pull down, the parallel makes it as if the lower resistor of the resistor divider is 10K x 60% x 220 / (10K x 60% + 220) = 212 Ohm, leading the an output voltage of 5V x (212) / 10K = 0.106V . I wouldn't use a pull down (nor up) smaller than 100K.

Imagine you have a pure theoretical voltage source. Whatever current you draw from it, it's voltage remains unchanged. In real world voltage sources this doesn't happen, because all of then have some resistance in series, so the current being pulled from the source will cause a voltage drop at that resistance and the voltage you measure "outside" varies with the current you pull from it. This resistance is the "output impedance". The smaller it is, the higher are the currents you can pull from the source without significant change in its voltage. "Impedance" is a more general term than resistance which covers the fact that real world circuits have a resistance that varies with the frequency of the signal going through it. For DC signals, it's the same as just resistance. We usually just say "impedance", but we can say resistance (which would imply DC signals).

Input resistance is kind of similar, but now you have the resistance from the input to ground, internally in the device. This is measurable like if you plug the Ohm-meter directly at the input. If this resistance is small, you need to drive that input with a source that also has a small output resistance, otherwise, the current being pulled by the input will affect the voltage of the source (due to it's output impedance). High impedance inputs are more "sensitive", because they "can read" sources with high output impedance - let's say, like electromagnetic waves. Note that a source can have hundreds of thousands of V at the output, but if it has a very high output impedance, any tiny current you pull from them makes those voltages become very small. See the catch? That's why voltage-meters have high input impedance, otherwise they would change (significantly) the own signal being measured!

Although the ADC has an input impedance (resistance) of many MOhm, it is recommended that the output impedance of the voltage source being measure be at most 10K. The ADC has an input capacitor that samples the input voltage. This capacitor must be charged in a very small amount of time by the source being measured; if the source has an output impedance too high, there isn't enough time for the capacitor to charge to the source's voltage and you get erroneous readings. The more current the source can provide, the faster the capacitor charges.

Ups, sorry for the speech :slight_smile:

alkopop79:
Since my last post I've been experimenting with different pull-down resistor and pot values. Unfortunately, whatever resistor I use the connections effect each other.

If you are using an external multiplexer you MUST add a time delay between selecting an input and analogRead(). The Arduino does that automatically when you are using the INTERNAL multiplexer but doesn't if you use an EXTERNAL multiplexer.

I recommend a 100k pull-down resistor on each input and a low-impedance voltage source such as a 1k pot. Set up your multiplexer address, delay one millisecond, and do the analogRead(). If that works you can reduce the delay to hundreds of microseconds.

Are you sure that is what you have? If it is there is no need for that pull down resistor at all. You have the pot wiper going to the analogue input and each end to a rail.
With 10K that is right, so exactly what is your problem?

Ok now I have seen this page. Just what is the point of posting a schematic of what you haven't got. There is nothing wrong with your schematic of what you are not using. If you want help then post a schematic of what you are having trouble with!

Njay:
(...) for your 0 to 10K output resistance voltage source.

Actually not exactly 10K, but enough for the teaching purpose.

Apologies, I mad the schematics a while ago. The actual circuit uses 16 channel analog multiplexers. The problem is that for each multiplexer there are 16 pull-downs and 16 insertion points. When multiple pots are connected, the values measured on the analog inputs change (connected and idle as well, so the idle inputs will measure 5 or 6 instead of zero). Will post schematics of the actual circuit! Thanks for all your help!