Using piezo as knock sensor with medium length cable produces noise on the input

Hi there,

I'm trying to set up a simple knock sensor for a project where I'll later use about 20 of them. I'm running into a weird issue where the length of the wire connecting my piezo to the breadboard is affecting the fidelity of the signal.

Here's my simple circuit:

The problem arises when I lengthen Wire 1 or Wire 2 (I'll get into exactly what's wrong further below). I've done this by soldering some stranded wire that I have (probably about 18 gauge) to the wires already soldered onto the piezo, and then soldering jumpers to the other side so I can connect it to my breadboard. This wire is only about 3 feet. The wire was part of a power cable where the plastic sleeving had both wires stuck together, so I thought it might have been some weird reaction they were having to being so close, but I ripped them apart and tried lengthening each wire independently with the same results.

I'll go through the symptoms here:

  • This is only an issue when I've got a 12v power source plugged into the Arduino (which I will need to have for the rest of the project). 5v from USB doesn't create this affect.
  • I have a program set up to show me what the analog input is reading at any given time (above a "1" value). Using just jumpers soldered to the piezo, I get zero noise - meaning it's not giving any signal above "2". When the wire is lengthened, I get a rapid peaks up to about 20, and even hire peaks when I move the wire.
  • I've even tried isolating other connection issues by soldering both a small jumper and the large wire to the the piezo and switching off between them. Same results.

What's weird is that this only happens on 12v, but it still works fine with the small jumpers. I have no idea what's going on.

Any thoughts? I appreciate the help!

Thanks,
David

I think you've simply created a magnetic loop aerial!

The two wires to the piezo sensor should be twisted tightly together, or alternatively use a shielded cable. Any large loop of wire will pick up magnetic and radio interference.

Also you might find noise can be reduced by adding a little capacitance across the wires at the Arduino end (around 100pF) - this will short out radio-frequencies without affecting the frequencies you are interested in.