PDA

View Full Version : Drum Trigger



Avi Harel
07-07-2015, 09:17 PM
Dear all,
First let me say thanks to paul for this wonderful project.
I honestly do not know if I would get so much into electronics
(as a hobbyist) without this project.

My aim this summer is to build an electronic drum set for my 4 year old son.

My current set-up so far is this :

* For the drum pad I followed the construction in this great video https://www.youtube.com/watch?v=N4gyULfb55A

* The piezo in the drum pad is connected to DFR robot's http://www.dfrobot.com/index.php?route=product/product&product_id=399#.VZwxXPmqpuA

which is basically just a 1M resistor and a diode in parallel

* I am connecting the DFR piece output to ground and analog input A2 of teensy
and I am using PeakMeterMono code to see the effect of the beating on the pad.

Basically all works fine but the only problem is that the pad is much too sensitive
(and I am afraid way too sensitive for a 4 year old) : a really gentle tap of
my finger is already half of the scale and the hardest bash (with a drum stick)
is only a few notches above that. So the pad is not scaled properly.
My question is how can this be scaled reasonably ? Is it a software problem
or do I need an additional circuit between the piezo and teensy (apart from the DFR one I mentioned above)
Thanks so much in advance

robsoles
07-08-2015, 01:25 AM
Assuming the piezo is currently attached to the skin of the drum; is it possible to move the piezo to a surface of the body of the drum so that it does not touch the skin directly? (am at work, trying to watch the video would be too obvious here now so I apologise if not seeing is making my assumptions that much poorer).

If so; it is my hunch that this change will give you a better proportionate signal for beating the drum - please post your result, especially if result is no real improvement or piezo already not touching skin etc etc.

DaveB
07-09-2015, 08:55 PM
Assuming the piezo is currently attached to the skin of the drum... The piezo is taped to a metal disc and sandwiched between two pieces of foam.

DaveB
07-09-2015, 08:58 PM
Hi Avi, you need to add a potentiometer to the circuit. That will let you adjust the output from the trigger. Have a look at the circuit at the very bottom of this page: http://www.nerdkits.com/forum/thread/2445/

Avi Harel
07-11-2015, 10:29 PM
Hey Guys,
Thanks for your replies.
I tried robsoles's suggestion and it did make the piezo somewhat less sensitive,
I also tried DaveB's suggestion but I only added a 0.1uF capacitor, the other components
did not seem to be necessary. Basically the picture I now get (recall I am using PeakMeterMono from the library)
4664
from a typical hit on the drum. The typical "burst" is about 3 to 6 lines for each hit.
I am wondering how each such "burst" should be converted to a number which corresponds best
to the power of the hit. I am thinking about computing some kind of a moving-average
constantly but I am not sure if this would be the most efficient way. Any ideas ?
Thanks again, Avi

Avi Harel
07-16-2015, 10:56 AM
Hey guys,
I would like to report on my progress for the benefit of anyone else trying to
conduct a similar project (or even just use a pressure sensitive sensor) :

After some searching in the web I realized it would be better to use
an "active peak detector" circuit, see for example : https://www.circuitlab.com/circuit/y453h7/precision-active-peak-detector/
I am using a 10kOhm resistor and a 1uF capacitor which should be suitable for the frequency of the piezo output.
The outcome is very clearly visible in an oscilloscope : a hit on the drum makes a very distinct peak followed by an exponentially decreasing curve. This should
make it easier to read by the teensy.

To sum up, my layout is the following : Piezo in drum --> DFRobot piezo vibration(diode+1MOhm resistor in parallel) --> Active Peak Detector --> Teensy A2

(I am powering the opamp in the active peak detector with the teensy, i.e. connecting it to gnd and Vin, not sure it's ok)

I am using the following code, which is a slight variation of PeakMeterMono :

4707

The basic idea is to cycle through a burst of readings of peaks and average over that
(the numbers 5 and 3 were found by trial and error)

This gives somewhat reasonable result but on occasions it is unreasonable :
for example a very slight finger tap could be anything between 3.0 and 6.0
while a real hard whack of the drum stick could be anything between 9.0 and 12.0,
more disturbingly it sometimes happens that a slight tap after a hard hit produces
still a high number ! So as a sensor it seems I have only 3 degrees of sensitivity
which are not so accurate at times. I wonder if I am missing some vital elements
here, and if I even understand correctly the function Peak(),
perhaps I should use another code altogether ? any help would be highly appreciated

jbliesener
07-16-2015, 12:38 PM
Avi,

have you checked what happens with the INPUT signal on analog pin 2 when you have the "unreasonable" reading? It might be helpful to track the problem to either the analog circuit or the software.

Paul has designed a similar peak holder circuit some time ago (http://dorkbotpdx.org/blog/paul/peak_holder) and the page has some comments about timing and resistor dimensioning in the comments section. Maybe this helps.

Avi Harel
07-16-2015, 06:10 PM
Avi,

have you checked what happens with the INPUT signal on analog pin 2 when you have the "unreasonable" reading? It might be helpful to track the problem to either the analog circuit or the software.

Paul has designed a similar peak holder circuit some time ago (http://dorkbotpdx.org/blog/paul/peak_holder) and the page has some comments about timing and resistor dimensioning in the comments section. Maybe this helps.

Hey,
I am actually not quite sure about that circuit, I did try it out but the values specified did not seem to work.
I am also not clear about the lower circuit in the drawing (with the LMC7660), its purpose and
how does it fit in with the upper circuit. In any case I am beginning the audio testing now
and the outcome is not as bad as I expected. One important note is that RobSoles advice above
turned out to be quite important : adding an extra layer of foam does seem to make the
sensor somewhat more sensitive. I am not completely sure about this current state
and I promise to update when I manage to build a better version. Again, any advice would be appreciated.

jbliesener
07-16-2015, 06:13 PM
Avi, check the text below the picture on dorkbotpdx:


Edit: After more testing, it turns out the LM324 can work perfectly fine without the -5 volt supply. I was initially concerned it may not work very well near zero volts and be able to charge the 0.1 uF capacitors. But the forward drop on the 1N4148 diodes means the LM324 is actually working at about 0.7 volts when delivering those tiny outputs to the caps. I did quite a bit of extra testing with small signals, and it works great. So the LMC7660 chip can be left off, and pin 5 (the -5 volt output) just shorted to ground. It's best to attach the wire from pin 5 directly to the ground pin on the connector (as opposed to nearby resistors), but even that's probably more analog paranoia on my part.

fms1961
01-10-2016, 11:00 AM
Even it's an old thread though, may be this helps understanding the OpAmp power supply (http://www.ti.com/lit/an/sboa059/sboa059.pdf)