One of my colleagues is a member of the Adelaide Samba drumming club - SaSamba. I guess he was a bit jealous of the feathered samba dancers getting all the attention during a gig. So he brought up the idea of a sound/drumming activated light system for the band.
We aimed to get the set-up ready for the Adelaide Fringe parade. The parade takes place at night with plenty of opportunity to show off different sorts of lights.
For the first prototype I used an electret microphone with a pre-amplifier. With the right threshold, taps and claps would activate the LED strips I had hooked up to it. There were only 5 RGB LEDs on the test strip, but I was pushing my luck driving them directly from an Arduino Nano GPIO. An n-channel Mosfet is needed for safely sinking the current required for meter long strips. The other trouble with this approach was the cross-talk between drums. Without fancy FIR filters identifying particular drums, there was no reliable way of lighting only the drum being hit. In a band surrounded by screaming crowds, an omni-directional electret microphone is definitely not the way to go.The Solution
After a conversation with Pix at the Adelaide Hackerspace I decided to switch to a contact-mic based approach, using a piezo as a knock sensor. Piezos can produce very large voltages in open circuit conditions, so I loaded this one with a 1M Ohm resistor tacked directly onto the disk. Soldering on piezos is tricky; you have to use flux, a hot iron and be quick. The disk acts as a heat sink and cools down pretty fast.
The piezo outputs only a few millivolts with this load (16-20 out of the 1024 max on the Arduino ADC range). This could be improved with pre-amp (opamp configured as a charge amplifier); however, it is sufficient for thresholding and briefly flashing the LEDs on drum hits.
My drummer colleague tested this with the whole band, and it shows pretty good isolation, as well. We went on to make 10 of these on protoboard and incorporated an overkill DPAK Mosfet (30V, 58A). These were covered in heatshrink and used with a LiPo at the fringe parade in front of around 70,000 people. I wonder how many appreciated the fudging that went into making them.Video DemonstrationMaking life easier with a PCB
I designed a PCB using KiCAD for this project as an Arduino Nano Shield using the template provided to work with my Drumlights project. I took the PCB design as an opportunity to add a battery charger and piezo charge amplifier using a TLV2771 opamp. You can get this PCB via oshpark or PCBs.io. Even though the hand made prototypes were fun and got us through the fringe parade deadline they are diffcult to make in a reliable and reproducible manner. We had numerous dry joint issues and soldering errors. Hopefully the PCB will make this easier. It is also much more compact due to SMD components and as noted above has extra functionality which I am looking forward to testing.