Problem reading values from multiple analog inputs

Hey guys,

I have a problem with multiple analog input values.

My first set up works fine. You can see it here: http://staging.rwichmann.com/sv16/setup1.jpg
If you touch the wires with your hand, the analog value raises from 0 to around 400. Depends on how wet your fingers are. If you connect both touch wires with a wire the value raises to 1023. All fine.

My second set up has the problem. You can see it here: http://staging.rwichmann.com/sv16/setup2.jpg
If you touch wire 1 and wire 2, the value of the analog input 0 raises to around 400 like in the first set up. BUT the value of analog input 1 raises too. It raises to around 80.
The same happens if you touch wire 1 and wire 3. Then the value of analog input 1 raises to around 400, BUT analog input 0 also raises to around 80. It does not stay at 0.

Do you have any idea what to do to make the other input value stay at 0?
My goal is to set up a circuit with up to 6 touchable interfaces. They actually should not influence the other values..

Thank you for every tip!
Raphael :wink:

Sounds like coupling between the inputs. An experiment to try would be using inputs 0 and 5, to see if the same thing happens.

Keep in mind that when Input 1 sees 2V, input 0 is seeing 40mV. In an analog world, that is practically zero. So in your code, you probably don't want to look for a value of "zero", but instead less than some value. (In this case, it looks like that value is ~80).

Ah ok, that means my circuit is ok, but the arduino board is not seperating the inputs very good?

I tried inputs 0 and 5 but it didn't make any change.

I guess I just need to consider everything below 80 as 0.

Thank you for your answer! :wink:

The A/D converter is indeed very sensitive to nearby signals. If you see section 21.6.1 of the ATmega328 datasheet you'll see that it says "The ADC is optimized for analog signals with an output impedance of approximately 10k or less". The "output impedance" of your circuit is much bigger than that (I think I see 1M resistors there?) and thus you will get large errors on "floating" analog inputs.

If you really do want them separated out I'd suggesting putting an op-amp buffer stage in front of each A/D input. Or look into Atmel's QTouch technology.

--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Thank you, very interesting!
I just read some lines about OpAmps at Wikipedia. I guess they are the solution for my circuit. But to be honest I don't have a clue how to implement them.

Do you guys may have a tip which OpAmp would be suitable for my circuit? Or do you guys might have a circuit diagram where I can see how to implement them?

And yes, my resistor is a 1M :wink: And it makes sense why my setup doesn't work.

Raphael :wink:

Here's a starting point:

Not tested, but if your previous circuit worked reasonably then this one should too. You can duplicate this for each separate input. Note that multiple op-amp packages like TLV2372 and TLV2374 can be used to save space.

--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Using an opamp it a little bit of overkill.
A Darlington transistor (or any two coupled 2- cent-transistors) can do the same trick.Darlington transistor - Wikipedia

Note that you will then no longer need the analog inputs, the darlingtons (or the opamps) easily switch between logical LOW and HIGH.

Edit:
They say also a 4049 will work (sixpacks for 20 cents...)

Hey Rugged, thank you for the diagram! I just wonder where I get this TLV2371. In Germany they might sell the same opamps under a different name..

@deSilva: Does it mean that I dont get analog values then? Actually I need the analog values. A logical on off wouldn't suit my needs..

Raphael :wink:

Hey guys, I just wanted to let you know that my setup is working now. I'm using a LM348 module with 4 opamps inside.

You can see the setup here: http://staging.rwichmann.com/sv16/setup3.jpg

RuggedCircuits thank you very much! You gave me the essential tip and your circuit works perfectly! :wink:

The only thing I'm curious about is that all inputs have a base value from about 390 now. Thats not a big thing because I can just crop the values and the much more important thing is that they don't influence each other anymore. However you might know if I can fix that too?

Cheers,
Raphael :wink:

sigh
LM348 = 4x 741
Those beasts are everlasting. They deserved to die 20 years ago.. They are the grand-grandfathers of low cost opamps and they show all the bad behavior of old age... Never use them!!
But you have now... sigh

Opamps were made to be used with a symmetric power supply, e.g. +/- 12 volts. They have however problems coming to that extreme values at the output: Their so-called voltage swing is often much lower than the supply voltage. More friendly devices are called rail-to-rail opamps.

Those old beasts would mostly only move between 1volt and 4 volt, if ever. When you see 300+ this it what they make of grounded input :slight_smile:
Note: It's not their fault. Times just have changed...

N.B.: We had a discussion about opamps the other day; can't find the thread now...

sigh
LM348 = 4x 741
Those beasts are everlasting. They deserved to die 20 years ago.. They are the grand-grandfathers of low cost opamps and they show all the bad behavior of old age... Never use them!!
But you have now... sigh

What a drama queen you are. Hell, we won the cold war with such chips, give them their credit due.

Lefty