Go Down

Topic: Analog pin problems (Read 7919 times) previous topic - next topic


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. :D 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 :)


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.  
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


Nov 15, 2011, 03:45 pm Last Edit: Nov 15, 2011, 03:53 pm by Grumpy_Mike Reason: 1
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!


(...) 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!


It's OK describing what you think are the salient points but nothing describes what you have done like a schematic. On that schematic would be the part number of the multiplexer used, and how you connect all of it up.
Armed with that information I can look at the data sheet of the part, assess the schematic and see if you were doing anything that would account for the results you are seeing. This is because you would not normally expect a analogue multiplexer to work like this.

Feeding a 10K pot with no pull up or down resistors should be sufficient normally but without knowing what multiplexer chip, and how you have connected it up we are all just wasting electrons guessing at what you may or may not have done.

So if you are serious about wanting help you have to be serious in providing information which allows that help to be deliverer.


The multiplexer is a TI CD74HC4067. Let me explain the aim of the project: the circuitry is for a modular synth interface for Max MSP. The hardware does not do any audio, just controls a synthesis software. Like modular synths, it will feature inputs and outputs that can be connected with patch cables. The idea is that when you connect voltage source to an analog input, the input reads the voltage and the software creates a connection between modules (such as oscillator to filter). With the trim pots I can set a different voltage to each voltage source thus the analog sensor reading will tell which output is connected to which input. Needless to say, there will be normal pots to control the synthesis, such as pitch/octave, volume, cutoff, etc. I created a breadboard view schematics in Fritzing:


This is actually how my test rig looks and works except the the arduino is powered by an FTDI cable. In this configuration the analog inputs will read the connected voltage if anything's connected. Normally this is what you see in the serial monitor with only one analog input (input 2, for instance)  loaded with a voltage source:

0 - 0
1 - 0
2 - 56
3 - 0
4 - 0
15 - 0

where pin 2 measures voltage, the rest of the pins of the mux are idle (zero). If you add more voltage sources, the readings change:

0 - 2
1 - 2
2 - 58
3 - 2
4 - 27
5 -2
In this case the idle pins measure some voltage. The more pins are connected, the more the values altered.


For the big picture, this is a modular synth with patch cables:


I created a breadboard view schematics in Fritzing:

No that is not a schematic.
If you are not going to play I am going home.


Cool, I draw you schematics. Th only trouble is, due to a bug I cannot rename the pins of the multiplexer.

Go Up