I'm planning to make a drum controller (something like arduino) for pc using a piezo transducer as sensor, some electronic circuit, keyboard PCB connected to usb and sampler for drums in pc. I found out that some people have similar plan, but they didn't finish it. So my plan may look like: I hit the piezo, signal will be amplified with OP amp, then I need something what basically connect two contact in keyboard (e.g. for letter "A") or just lower resistance between them under 40k with with the piezo signal. I used transistor as switch. Hope that you understand it. I designed scheme below, but it doesn´t working. Please help.


enter image description here

Keyboard PCB

  • \$\begingroup\$ You should take a look at the Arduino Leonardo. It's all you need. It will deal with the Piezo inputs as well as the USB keyboard emulation. \$\endgroup\$ – Majenko Jun 28 '15 at 12:15

The problem is that you haven't accounted for the saturation voltage of the transistor you are using as a switch. This is usually around 200 mV for a BJT. These types of transistor aren't good for switching very low voltages, like your 40 mV. To do that, use a FET instead.

However, are you really sure that your keyboard is looking for a switch closure, using only 40 mV to sense it? That voltage sounds low. I suspect the real problem is the keyboard doesn't work the way you think it does. Buttons may not be just mechanical switches. Some keyboards work on capacitive sensing, others magnetic, for example.

  • \$\begingroup\$ I will try replace transistor, but I don´t know much about FET transistor. Would you advice me what kind of FET transistor I should buy in my case? That voltage I measured on two diffrent keyboards so I think that´s right. Keyboard what I have works on mechanical switches and I think that normal pc keyboard also works so. Keyboard working I wanted to ask one more question. That op-amp must have symetric power supply or just single supply, that minus on op amp connected do groung? \$\endgroup\$ – Bonco Jun 28 '15 at 20:46
  • \$\begingroup\$ @Bonc: If you measured the voltage with just a meter, then it may not be valid. The controller is probably scanning the keys, so the actual voltage when reading the key is higher, but it happens such a small fraction of the overall time that it averages to 40 mV. \$\endgroup\$ – Olin Lathrop Jun 28 '15 at 20:48

I am working on a similar project. Using a piezo on a drum, so that when you hit the drum an arduino can detect the piezo signal. I have a couple questions: Is your amplifier circuit built exactly like that? Because that amplifier will not do anything without feedback. Look up a non-inverter op-amp circuit. You will probably want a microcontroller to do the switching. Because a Piezo, when hit, will cycle through positive and negative voltages. So the transistor will switch on and off a lot. You might be able to get around this by using an envelope detector. It is built with a capacitor and a diode allowing all positive voltages and a slow (exponential) decay.

Hope that helps. Let me know if you have questions.


  • \$\begingroup\$ My circuit is not built exactly like arduino, but I think that working similar. I don´t put there feedback on op-amp because I think it would cause decrase gain coefficient on op amp - maybe there is the mistake. That evelope detector is a good idea, but first a just want to circuit work. \$\endgroup\$ – Bonco Jun 28 '15 at 19:43
  • \$\begingroup\$ The gain of an op amp is ideally infinity. But this is obviously not possible, so the op amp will always be the voltage of +Vcc (the supply voltage). It would be a good idea to do a quick google search on non-inverting op amp circuits. They are very simple to build and calculate the gain. \$\endgroup\$ – Josh Jobin Jun 29 '15 at 2:46
  • \$\begingroup\$ The whole purpose of adding feedback is so that you can control the gain. \$\endgroup\$ – Josh Jobin Jun 29 '15 at 2:47
  • \$\begingroup\$ I found this circuit for amplifying the signal and it looks pretty sensitivy - for drums would be great. Do you think that I can connect base/gate of transistor just to output of op amp? - where is a led on circuit. circuit video \$\endgroup\$ – Bonco Jun 30 '15 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.