I hope this is the right place for this, go ahead and tell me to go away if it's not.
I'm using four piezo buzzers as "knock" or "impulse" sensors, sending each into a different analog pin. I've attached a wiring diagram.
The goal is to be able to detect which buzzer, of the four, gets hit. Unfortunately, when I hit one of the buzzers, a signal appears in multiple of the analog pins.
I wrote a snippet of debug code that pulls analog values from all four pins (A0-A3) every 10 ms and displays them. Most times the correct pin has the highest value but not always, and sometimes a different pin will go higher initially before the correct pin hits its peak 10ms later. I've written down some characteristic readings to the right of the wiring diagram. These are representative only, it varies with how hard you hit and a variety of other factors.
It looks like cross talk, anybody have any idea why it's happening? It happens even when I disconnect one buzzer entirely, making me believe that the signal leakage is happening on the board somewhere. Thoughts?
I'll confess that I don't know exactly how much voltage is popping out of these buzzers when I smack them, but since the analog pins aren't pegging out at their max value and tend to vary between 30 and 400 I'm assuming I'm not shoving too much voltage into anything.
How long are the wires between piezo sensors and Arduino? With impedance levels of 1M or so it doesn't take much stray capacitance for strong crosstalk, the signals should be individually screened if any significant cable runs.
Look carefully at your set of measurements. They confirm what you described as cross talk to be a ground that isn't grounded. A3 and ground are reversed. If you re-arrange the measurements... they make sense and what you see as cross talk is coupled mechanical energy, sound or vibration transferred mechanically. Not IMO crosstalk. The 2 sets of 0 measurements agree and point at the measurement error.
SHIELDING. By tapping the piezo device you are sending a voltage pulse down the wire to the Arduino. This pulse will induce a pulse in ANY parallel wires. A shield is a metal tube or mesh around the individual wires that is grounded at 1 end and shields the signal wire. You also may be seing some effect on the ground wire as it will also change in voltage depending on size and length. Run a seperate ground from each knock sensor back to ground and put it inside the same shield as the signal wire going to the analog input.
The shielded wire is a must but unless those wires are twisted together you don't really have cross-talk issues. The voltages you report don't make sense unless signal and ground wires are transposed on your drawing. I seriously doubt that you connected the piezo's together and then twisted all the wires together. the "normal" ones I an used to have shielded cables from the factory (Piezo's for car burglar alarm's) and those don't cross talk at all. Spacings of a half inch or 12 - 3 mm would drop the levels by 10 db and I don't see in the data anything that resembles cross-talk in your measurements at all.
What most people thing of as "crosstalk" is actually the S&H buffer of the ADC not emptying properly between sampling subsequent inputs.
Remember - the Arduino only has one ADC, and it switches the input that is routed to it.
When reading from more than one ADC channel you should always read one dummy result and throw it away after changing from one channel to another. Yes, it's a little slower, but it makes for better readings.
majenko:
What most people thing of as "crosstalk" is actually the S&H buffer of the ADC not emptying properly between sampling subsequent inputs.
Remember - the Arduino only has one ADC, and it switches the input that is routed to it.
When reading from more than one ADC channel you should always read one dummy result and throw it away after changing from one channel to another. Yes, it's a little slower, but it makes for better readings.
To put concrete figures in here, the internal ADC sample and hold circuitry can be modelled as some series resistance (value between 1k and 100k) leading to a sample/hold capacitor of 14pF. If driving from a resistive source 10k is the recommended max input impedance (this will have negligable affect on capacitor charge time, in fact 50k or so ought to work fine). If from a capacitive source (like a piezo transducer you need to have about 1000 times the drive capacitance to get 10bit accuracy, meaning 14nF. For cross talk of less than 1% between successive readings would mean needing 1.4nF or more (if I've got my maths right). Piezo transducers are highly capacitive, I've just measured one of mine as 46nF.
That would suggest that for directly connected piezo sensors this won't be an issue.
That would suggest that for directly connected piezo sensors this won't be an issue.
Yes it will because the high impedance of the load can't discharge the sample and hold capacitor fast enough. Try connecting another analogue input to ground, then read this input between reading each of the sensors. What ever is left is mechanically coupled energy between the sensors.
1M in parallel with 46nF isn't high impedance at timescales of 10us...
However I've just realised there will be cross coupling at lower frequencies because the piezo elements and the S/H cap form a switched capacitor filter!