London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« on: September 14, 2011, 07:48:08 am » |
The idea of this project is to build a modular synth interface working with arduino. The idea is to connect DC sources with different voltages to the analog inputs. The inputs read the value and send it through serial connection to the computer. It is vital that when nothing's connected to the an analog input, it should measure zero voltage (I check the state of analog pins on the Arduino IDE serial monitor). Hence I connected the inputs to the ground. In practice the analog pins measure zero when nothing's connected. However, when I connect a voltage source, other pins start measuring random values. For instance, if pin 0 is connected, it measures 856 and other pins measure fraction of this value at the same time... Why? How can I isolate the pins from each other? It is paramount that all pins read correct values! I have a feeling that the problem is somewhere with the connection to the ground. Any help would be appreciated!  Moderator edit: duplicate posts merged.
|
|
|
|
« Last Edit: September 14, 2011, 01:54:45 pm by Coding Badly »
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #1 on: September 14, 2011, 07:54:02 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 108
Posts: 6615
|
 |
« Reply #2 on: September 14, 2011, 08:00:14 am » |
There is only one A/D converter in the ATmega and it's shared through a multiplexer and sampling capacitor. If the input signal has an impedance higher than 100k the capacitor doesn't discharge in time when you switch inputs. Try connecting all the inputs to ground through 100k resistors. That should not cause problems with a voltage source but should cause the unconnected pins to read 0.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 95
|
 |
« Reply #3 on: September 14, 2011, 08:08:46 am » |
In fact it is not correct that an unconnected pin always reads zero. In electronics, an unconnected analog or digital pin (which has no pull-up or pull-down) has an undefined state. The value may be any value, and it may change in time, either many times per second or just once every 10 years. Take the "undefined" word literally.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 76
Posts: 6852
Arduino rocks
|
 |
« Reply #4 on: September 14, 2011, 12:55:59 pm » |
Try something like 100k pulldown and 10nF decoupling to reduce noise - the input voltages are supposed to be basically DC so a capacitive load shouldn't be a problem.
Not only are the analog inputs high input impedance, they are effectively infinite input impedance at DC due to the nature of CMOS - thus e.ven a weak pulldown like 100k should have a dramatic effect. For AC the capacitor should reduce pickup substantially
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 270
Posts: 17059
Available for Design & Build services
|
 |
« Reply #5 on: September 14, 2011, 01:10:25 pm » |
Fast sampling might still cause an issue if adjacent pins have different levels on them - typical solution is to read the input twice & use the 2nd result. How fast do you need to sample?
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #6 on: September 14, 2011, 07:20:27 pm » |
Thanks for the answers! The sampling needs to be pretty fast since it's a modular synthesizer interface. When you make a connection with the patch cable (for instance, LFO to oscillator frequency), the user should hear the result instantly. I will try the pull down resistor and the capacitor! I also thought about adding a feature in the code that checks if the read value changes over time but that wouldn't help. Unfortunately the 'noise' on the other pins doesn't change. It's just appears as a different value. For example, if a DC source is 568 and is connected to pin 1, pin 0 and 2 will measure 57 and 129 (these ara not exact values obviously). Thanks for the help!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 76
Posts: 6852
Arduino rocks
|
 |
« Reply #7 on: September 14, 2011, 07:26:32 pm » |
The crosstalk between channels happens when switching between channels in a high-impedance circuit, shouldn't be a problem if low-impedance voltage source connected.
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #8 on: September 15, 2011, 06:53:50 am » |
Thanks but what does low impedance voltage source mean?
|
|
|
|
|
Logged
|
|
|
|
|
West palm beach, FL
Offline
Sr. Member
Karma: 0
Posts: 264
|
 |
« Reply #9 on: September 15, 2011, 10:32:15 am » |
according to my book : when output impedance is small a relatively large output current can be drawn from a devices output without significant drop in in output voltage.
When the output impedance is large a relatively small output current can be drawn from the output of a device before voltage at the output drops substantially.
A rule of thumb for efficient signal transfer is to have an output impedance that is at least 1/10 of the loads input impedance to which it is attached.
Now i do not know what half of that means or how one would go about measuring this impedance, it seems like in a very simple simple way its the resistance "outward" being that high impedance lowers current output.. so yeah maybe you can decipher that better then i. UPDATE: dam! i think it just clicked, so if i have a million things in a circuit all taking a chunk out of its current then furthermore if i try to output something it will be at a very low current since it is all being used up... interesting
|
|
|
|
« Last Edit: September 15, 2011, 10:38:34 am by eddiea6987 »
|
Logged
|
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"
|
|
|
|
West palm beach, FL
Offline
Sr. Member
Karma: 0
Posts: 264
|
 |
« Reply #10 on: September 15, 2011, 04:38:43 pm » |
It turns out to be pretty easy to measure source (or output) impedance. You need only a variable resistor (like a pot) and a volt/ohms meter. Measure the unloaded output voltage from the mystery source. Then attach a variable load (your pot) across the output and increase the load until it is 1/2 the open circuit (unloaded) voltage which you previously measured. Then disconnect the pot and measure the resistance. That resistance is equal to your source impedance.
The principle is that you are forming a voltage divider. The "top" resistor in the divider is the mystery source impedance, and the "bottom" resistor is your pot. When the voltage is 1/2, then the two resistors are of equal value.
Of course, if you are measuring something at the extreme ends of the spectrum, conventional parts and techniques don't apply. So measuring the source impedance of a guitar pickup or a car battery can't be done using this simple scheme.
if i could pay you for posting that i would, thanks for that.
|
|
|
|
|
Logged
|
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #11 on: September 16, 2011, 10:02:03 am » |
The voltage sources are trimpots (see the link I posted earlier) connected to the VCC pin.
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #12 on: September 16, 2011, 01:16:14 pm » |
Fantastic! Will give it a try! Thank you for all your help, guys!
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #13 on: September 20, 2011, 07:59:50 am » |
Wow, that worked! However pin 3 reads nothing, even when connected but I guess that must be a contact trouble or breadboard issue. Guys, thank you sooooooo much!
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #14 on: September 20, 2011, 08:00:38 am » |
BTW, 100 K potentiometer and resistor was the solution! Again, big thanks!
|
|
|
|
|
Logged
|
|
|
|
|
|