Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: multiple drum-trigger piezos seem to be interfering with each other

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    9

    multiple drum-trigger piezos seem to be interfering with each other

    Hi all,

    I'm attempting to make a drumset with piezos and a teensy 3.2, using the piezo-wiring diagram that kpc posted here: https://forum.pjrc.com/threads/27796...ll=1#post65150 Instead of diodes going to 3V3 I have them going to AGND. I am a total newb and this is my first major electronics project, though I have been working at it a while (my first approach was using a 555 timer before I learned about the joys of polyphony...long story ) so I understand some of the basics, just not many.

    Wiring things up as kpc diagramed (as well as in several other ways) have all worked pretty well for one piezo. I'm able to pick up the signals using analogRead, and to translate that signal into a midi signal that I pick up in Reaper w/VSTi and make drum sounds with. I do get a somewhat noisy signal, of a constant "30" reported by analogRead(), which just appears to be a function of the strength of the resistor (1M) I put in parallel to the piezo, but it's pretty easy to work around just by setting a minimum-reading constant in my code. So basically, my drumset works great for one piezo/drum.

    However, once I wire up a second piezo (so now I have one on A0 and one on A3) and connect it to the same AGND like the first one, I start getting weird readings from my piezos. They're not terribly consistent readings... usually striking a piezo causes the value reported by analogRead() to drop to 0 from the "noise value" of 30, though occasionally I get positive readings up closer to 1000. It seems like they must be interfering with each other over AGND, because disconnecting one of the piezos from AGND makes the second piezo work perfectly, and vice versa. (As I was writing this I decided to try with a 10k resistor in parallel instead of a 1M resistor. There still seems to be interference, though instead of going from 30 [noise] to 0 it's usually going from 3 [noise with less resistance/sensitivity] to 30, but still inconsistently, and unplugging one piezo makes the other much more sensitive and consistent still)

    Can anyone help me wire up multiple piezos? For what it's worth, I am using "switching diodes" instead of zeners, does that matter? (again I'm a total newb sorry haha)

    Thanks in advance!

  2. #2
    Member Revalogics's Avatar
    Join Date
    Dec 2016
    Location
    Philippines
    Posts
    78
    Hi, I think the diode is placed that way (reverse-biased) and connected to 3.3V to protect the Teensy pin which connects to the INPUT of the schematic you cited from kpc. Any excess voltage generated by the piezo will be dumped to 3V3. Just a guess, I never fully understand what is going on haha.

    Zener diodes and signal/switching diodes are two different beasts. Zener diodes regulate voltage (in the case of the schematic, it regulates piezo voltage output). Switching diodes, on the other hand, does its work: to switch on when it is forward-biased (anode [the triangle] is positive and cathode [the line, also the physical mark on the diode] is negative) and switch off when reverse-biased.

  3. #3
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Thanks for the quick response! I ran out and got a few zeners, and replaced the switching diodes, but it didn't seem to change anything :/ It seems like I must be missing something to keep the pulse from one piezo from going through ground and into the other one? I tried putting some diodes and a couple of caps in between the negative of the piezo and the AGND line but neither had the desired effect either. These are the values I'm using... not sure if I am using incorrect values here or not?

    Parallel Zener: 12V, 21mA
    Parallel Capacitor: 10nF, 1KV
    Parallel Resistor (Rp): 1M ohms
    Series Resistor (Rs): 1k ohms

  4. #4
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,899
    How are you triggering the piezo's? If they are next to each other might be worth making sure tapping one isn't triggering adjacent sensors physically.

    That Parallel Zenier won't be doing much at 12V, Teensy is 3.3. The right tool to hunt this one down is a oscilloscope, assuming you don't have access to one?

  5. #5
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    I'm just tapping the laser discs I have them taped to with my hand or a drum stick, but they're soldered to some long wires that go to a breadboard and I have them pretty spread out, so I don't think they'd be interfering due to the tap.

    I don't have an oscilloscope, but I might be able to find one! What should I look for once I find one?

  6. #6
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,899
    Idea with using a scope would be finding if your cross talk is via the Agnd lines because your transducers are spiking below 0volts, by the 3.3V connections or some other mechanism. Idea would be to connect each of the two channels to matched points on two sensors and see what waveform was cross talking.

    Should be possible to get working without it, but if you had access to one would be faster.

  7. #7
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    It looks like it's going to be a bit of a task for me to get an oscilloscope, is there anything I can try without one? I do have a cheap multimeter if that helps

    Do I need to get zeners with a different voltage rating for this to work at all?
    Last edited by adavea; 03-12-2017 at 10:38 PM.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,593
    This may be silly question, but have to considered simple mechanical coupling between the sensors? If they're connected to semi-rigid plastic and all those discs are anchored to the same solid material, perhaps the other sensors really are picking up mechanical vibration coupled through the rigid materials?

  9. #9
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Hi Paul! That's not a silly question at all! I did think of the vibration hitting multiple discs though. My current setup is each of my two piezos is taped to a laser disc, and soldered to some 2-ish foot long wires, which are then connected to a breadboard. I keep the laser discs on separate surfaces when I tap them

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,593
    If you're totally stuck, and if you have a 2nd Teensy, perhaps something to try might be setting up 2 completely separate systems. Maybe even run each from its own battery and use a display or LEDs or sounds (but not a USB cable to a PC) to show status, so each is completely separate from the other with no common wires. Such a test could at least give you some idea if the problem is electrostatic or electromagnetic or other strange non-contact coupling. If the 2 separate system don't interfere with each other when absolutely no wires are shared, maybe gradually make them less separate until you discover the things which cause them to interfere.

  11. #11
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Rather embarrassingly, I just realized that the code I was using to debug the situation, was not setting a variable after a hit was registered, which was creating the illusion of a linkage/weird behavior between my piezo inputs

    After increasing my sample rate and eliminating that bug, everything appears to be working fine. Thanks for your help guys, and sorry for the false alarm!

  12. #12
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Hi all. It turned out to not just be code... I wasn't seating my Teensy deeply enough into the breadboard. For any other n00bs out there--make sure that the pins of your Teensy almost completely disappear into the breadboard when you attach it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •