When pranking, it can be hard to find a good balance between humor, price, and not pissing people off too badly. How do you create something that will draw people’s attention while at the same time not causing a significant disruption? I decided I wanted to create a device to accomplish such a task.
The first iteration of prototyping for this device began about a year ago with me gutting out the insides of a USB flash drive and soldering in an ATTiny and a very small piezo element. When it was plugged into a computer, it would play a tune. It was miserably quiet though.
My second iteration involved using a ‘differential drive’ for the piezo (using two io pins and alternating between high and low on each to double the amplitude). This made the USB device considerably louder.
After all this, I left this project behind for a few months until one day I read about low power sleep modes on the ATTiny. I realized if I used a coin cell battery I could make my device self-contained.
In my project's final phase, I use a larger piezo (a 30mm piezo from Adafruit). I then hot glued the ATTiny and coin cell snugly onto the back and soldered all the connections together. This resulted in a small, easily concealable, and cheap ($2) pranking device. I then proceeded to make about 15 of these and hid them around my university's campus in various lounges and public spaces.
Even though it looks like (and is) a mess of solder, flux, and hot glue. It gets the job done for cheap!
Would it be possible to create a solid beep like you would get with an active piezo buzzer using a piezo speaker instead? I'd like to use your 'differential drive’ technique to keep the higher volume. I played around with creating a new tone that was just a long note, but I wasn't able to get the sound I'm after.