Pages: [1]   Go Down
Author Topic: Interference in a multiplexer  (Read 1595 times)
0 Members and 1 Guest are viewing this topic.
London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have recently finished a PCB with 16 channel analog multiplexers. When I connect a voltage source (pot as a voltage divider) to any of the mux's pin, they measure the value however other pins nearby show voltage as well. In other words, when pin 0 is connected to a voltage source, other pins like pin 1 and 2 measure voltage (even though nothing's connected to them). is it possible that there's some sort of interference between the pin? If so, how can I stop it?
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All pins are connected to the ground. Any other ideas?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All pins are connected to the ground.
Then how are you measuring a voltage? smiley-confuse

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 So basically there's a resistor between every pin and the ground. This way the pins won't measure noise when they are no connected. W
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So basically there's a resistor between every pin and the ground. This way the pins won't measure noise when they are no connected. W

You haven't yet answered the key question made to you. Why would one read a input that has nothing wired up to it? Please take a sec and respond.


Lefty
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, here's the thing: it's gonna be a modular synth interface. Analog inputs are for actual banana plug inputs of the 'synth'. Every time you plug a jack in the input, it should measure the voltage. When nothing's connected, the analog input should measure 0 volts, meaning that nothing's connected:) Once a connection is made, the arduino prints a serial message.

Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been trying to add a picture with no success. I draw a diagram:

https://picasaweb.google.com/lh/photo/W6GJ_fHJjIJ09PtOB-bj6g?feat=directlink
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, here's the thing: it's gonna be a modular synth interface. Analog inputs are for actual banana plug inputs of the 'synth'. Every time you plug a jack in the input, it should measure the voltage. When nothing's connected, the analog input should measure 0 volts, meaning that nothing's connected:) Once a connection is made, the arduino prints a serial message.



Ok, that's a good reason, your application program doesn't know how many inputs will be active at any given time, so it will read all the inputs and if other then a zero reading it will assume that it's a valid input signal for that channel input. So the easiest solution is to wire a 10k pull-down resistor from each pin to ground. The cavet is that whatever signal that is sending that analog voltage must be able to drive into a 10k ohm load.

Lefty

Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks! I've used 1M resistors to ground them and it works fine. Still don't know why the other pins read voltage when only one is connected... Check this pic of the arduino serial monitor:

https://picasaweb.google.com/lh/photo/PuxLYScMxY5Xacmd9q0RzQ?feat=directlink

Here it's only pin 0 connected and measures 685 yet other pins read voltage (they totally shouldn't!). Why? Is it interference?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Here it's only pin 0 connected and measures 685 yet other pins read voltage (they totally shouldn't!). Why? Is it interference?

No, its the nature of the ADC circuitry inside the AVR, it has just one ADC converter and uses a sample and hold capacitor method. When you select a channel to read the mux connects that channel to the sample cap to charge to the voltage at the pin, and then later disconnects from the pin and lets the ADC hardware 'sample' the voltage on the cap. So when you switch to read a disconnect pin, the cap doesn't get to charge to any valid voltage, but rather just kinds of drifts around depending on the last valid voltage level it read from.

A 1 megohm resistor is kind of a large value to use as a pull-down, but if it solves your problem, so be it.

Lefty
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 192
Yes, we can (solder)!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But that's the thing, it does not help. All the pins are connected to the ground through the resistor. Still, any time a single inputs gets voltage and is read, at least four or five other pins show voltage. Please help, if it's impossible to get accurate readings for each pin, I might just give up the project. I need to know if there's a way to sort this out!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
any time a single inputs gets voltage and is read, at least four or five other pins show voltage.
By a volt meter or the ADC?

If volt meter I don't know. If ADC I think it's just a case of the resistor being too large and/or you are reading the inputs too rapidly. Either way I suspect the internal capacitor is not getting enough time to discharge.

Try smaller resistors or longer delays between readings.

______
Rob
« Last Edit: August 21, 2011, 09:24:21 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All the pins are connected to the ground through the resistor.


But 1 meg ohm resistors are most likely not appropriate to solve that, have you tried 10k ohm as I suggested?

Lefty
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33321
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use a 1M pull down then it is the same as not using a pull down at all. It is far too high to do any good.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When you make analogRead calls for two different pins in succession, the input to the first pin interferes with the reading you get from the second pin if the resistance of the source supplying the second pin is greater than about 10K. I have suggested that the library be modified to alleviate this and I took some measurements, see http://arduino.cc/forum/index.php/topic,69675.0.html.

The simple workaround is: when reading an analogue pin when the previous analogue pin you read you read from is a different one, take 2 readings in succession and discard the first one. For source resistances greater than about 100K you also need to insert a delay between the two calls.

Therefore, your 1M pulldowns are too large unless you read each pin twice with a delay between the analogRead. I found that 150us delay was the minimum needed when the source resistance is 1M.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1]   Go Up
Jump to: