London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« on: August 20, 2011, 11:13:47 pm » |
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
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #1 on: August 21, 2011, 10:24:24 am » |
All pins are connected to the ground. Any other ideas?
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6977
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #2 on: August 21, 2011, 11:51:46 am » |
All pins are connected to the ground. Then how are you measuring a voltage?  ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #3 on: August 21, 2011, 01:27:22 pm » |
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)
Online
Brattain Member
Karma: 283
Posts: 15443
Measurement changes behavior
|
 |
« Reply #4 on: August 21, 2011, 01:36:36 pm » |
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
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #5 on: August 21, 2011, 02:10:52 pm » |
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
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #6 on: August 21, 2011, 02:12:59 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 283
Posts: 15443
Measurement changes behavior
|
 |
« Reply #7 on: August 21, 2011, 02:59:39 pm » |
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
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #8 on: August 21, 2011, 03:16:34 pm » |
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=directlinkHere 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)
Online
Brattain Member
Karma: 283
Posts: 15443
Measurement changes behavior
|
 |
« Reply #9 on: August 21, 2011, 07:19:23 pm » |
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
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #10 on: August 21, 2011, 07:30:07 pm » |
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
Tesla Member
Karma: 75
Posts: 6977
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #11 on: August 21, 2011, 07:54:33 pm » |
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
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 283
Posts: 15443
Measurement changes behavior
|
 |
« Reply #12 on: August 21, 2011, 07:59:42 pm » |
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
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #13 on: August 22, 2011, 03:10:27 am » |
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
Online
Faraday Member
Karma: 146
Posts: 4910
|
 |
« Reply #14 on: August 22, 2011, 09:17:01 am » |
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. http://www.eschertech.com
|
|
|
|
|