• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crosstalk on Analog Arduino Ports

Mech_Engineer

New Member
I have been working on an automatic watering system using 3 capacitive sensors with G, Vcc and Signal wires. I have tried assigning these sensors to various combinations of analog ports on an arduino nano. No matter which ports I connect the sensors to, when I try to read each port, I find that the resulting values are affecting each other. I'm running on the 5 volt rail, common ground. Has anyone had similar problems and found a fix?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
I can't say if it happens on the Arduino or not?, but on PIC's it's highly dependent on source impedance feeding the analogue input pins - but I don't see as the AVR would be any different?.

Basically when you switch analogue inputs it takes time to charge, or discharge, the capacitor in the sample and hold - and that time depends on the source impedance.

So you either buffer the inputs with opamps, or you add time delays between selecting the input and actually reading it, to give the capacitor time to adjust.

The datasheet should specify the maximum source impedance, on PIC's it's about 1.5K - I would expect the AVR to be similar, as there intention was as similar device as possible, even including a three later name.
 

gophert

Well-Known Member
Most Helpful Member
I have been working on an automatic watering system using 3 capacitive sensors with G, Vcc and Signal wires. I have tried assigning these sensors to various combinations of analog ports on an arduino nano. No matter which ports I connect the sensors to, when I try to read each port, I find that the resulting values are affecting each other. I'm running on the 5 volt rail, common ground. Has anyone had similar problems and found a fix?
A watering system has a long time constant between watering events. You should be able to add a fat capacitor (0.1 to 1uF) to your signal, wait a reasonable amount of time for the sensor to change and stabilize (1 to 10 seconds) and then switch sensors and then read the other sensor the same way. Remember, it takes about 5 RC time constants for a capacitor to stabilize.
 

dr pepper

Well-Known Member
Most Helpful Member
Similar to gophers comments, you might be reading the ports too quickly, try a delay of 10ms between reads, the chiponly has one atod converter, the input is multiplexed, its possible the voltage hasnt had time to settle, though thats never happened with me unless the chips been running assembler.
 

Pommie

Well-Known Member
Most Helpful Member
As far as I'm aware, there's no way to preselect the analogue port (on Arduino). You select it by reading it, therefore I suggest read the port, wait 10mS then read it again and only use the second value.

Mike.
 

gophert

Well-Known Member
Most Helpful Member
You can also average 8 readings.

If you have a
I find that the resulting values are affecting each other.
Can you give some details? It's hard to speculate.

Is this the type of capacitive sensor you are using?
Notice that in his lab, the o-scope shows a very constant reading but the volt meter is bouncing all over the place in the garden.


automatic watering sensor capacitive
 

dr pepper

Well-Known Member
Most Helpful Member
Pomms there is a kludge way of preselecting, read the port twice, dump the first reading.
I like the way to moisture probe works, they'dve been better using a dual op amp, one oscillating and the other line driving, but I guess its made to a price.
 
Last edited:

dr pepper

Well-Known Member
Most Helpful Member
Yep I do that sometimes.
It was 5.30 am when I read it.
 

Reloadron

Well-Known Member
Most Helpful Member
Yep I do that sometimes.
It was 5.30 am when I read it.
Yeah, but somewhere it was 6:30 PM. :)

Whatever you connect to an Arduino Nano analog input should have a source impedance of about 10K Ohms or less or the accuracy and reliability begin to suffer. The common solution to what you are seeing is read the channel twice and toss out the first reading. Another solution is take 10 readings (more or less) and get the average. Keep in mind there is only a single A/D converter so the inputs are multiplexed. That's about it, what has already been mentioned.

Ron
 

Latest threads

EE World Online Articles

Loading

 
Top