**** Cassettepunk ****

Technological Surrealism / Alec Nerds Out

Drum Lights: Triggered Drum Illumination


Happy New Year!

I’ve just finished surviving a New Years’ show masterminded by Bobbi-Jo Moore of The Elixxxirs. Let me briefly sing her praises first: she assembled and coordinated an army of volunteers to put together a “Back To The Future” themed party and Parkinsons fundraiser for 400, including the bar, decoration, promotion, lighting, sound, DJ, and endless loads of supplies. Not to mention actually playing the show. That’s a tremendous amount of work and risk to take on. She dug deep into her circle of friends to find help and they really came through. I’m impressed. It was a great night.

Since The Elixxxirs were representing 2015 (the future!) I thought it would be fun to do something interesting with the drums: a light show triggered by playing. Many have had this idea before — see, for example, Adafruit’s entry on the subject — but so far the examples have fallen a little short of the mark.

Here’s mine:

Like the above example, I used an Arduino-based controller (a Trinket) and Neopixel LED strips. For the trigger, I used a piezoelectric sensor, which is what most drum triggers use anyway, besides being cheap and easy to work with. Each unit was built into a small plastic chassis.

Assembly was basically trivial; a bit of dead-bugging, soldering directly onto the Trinket. I’ve long wanted to jump to working with AVR chips directly, rather than using the Arduino platform, but the Trinket is so cheap and easy to use that it’s simply not worth the trouble yet.

My first prototype had a couple of potentiometers mounted to adjust characteristics of the light show, but these proved unnecessary — it works well without any adjustment. (Not being able to use the USB connection to program the chip when you’ve got potentiometers connected to those AVR pins was a bit annoying. In the future I’d use a small connector to permit quick detachment of those pins.)

This was also my first experience working with Neopixels. These are great, if not all that cheap. It almost feels like cheating; these parts are basically snap-together.

I soldered directly onto the piezo pickup, which is the most fragile part of the whole affair. I hot-glued the wires down to help decrease the stress on the solder joints. Particularly when stuck down to the bass drum skin, there’s a lot of motion going on when I’m playing the drums. (See it in slow-motion.) Working with the bare piezo keeps the mass down, but even so, there’s a noticeable damping of the cymbals in particular. I taped the piezo into the underside of each cymbal fairly close to the bell to limit this.

The set-up worked flawlessly during the New Years’ show, with a little overzealous taping to keep the power cords in, the triggers attached, etc.; that won’t be a new requirement for a drummer, who will be used to surprise mid-song cymbal stand failure.

Source code on Github.

This would be a great project even for a drummer who has very limited experience with electronics or programming. The circuit and the code are both just about as easy as they can be.

More video to come, I hope!


Categorized as: Uncategorized


31 Comments

  1. Damon Buchardt says:

    Thank you. I followed your instructions and put one on my sons kick drum. It works awesome. Adafruit should be paying you. I bought the trinket and neopixel from them. I stole a piezo from a broken guitar hero
    drumset. Picked up some glow in the dark drumsticks too. My son took 1st place in his talent show. You Rock!

    • admin says:

      Damon, tell your son that you two just made my week! That’s fantastic, thanks so much for letting me know.

  2. Federico says:

    Dear, this project (and this blog theme) in fantastic! 🙂
    One question: how many piezo and led i can attach to one Trinket? I want to light up my percussion (5 cowbell and 1 bongos), so I ask you before waste money 🙂
    — i’m italian and this is my english 😀 —

    • admin says:

      Hi Federico! Rather than using trinkets, consider using a single ATTiny85 chip for each of your drums. I’ve tried this and it’s pretty easy and very compact, and these chips are much cheaper than trinkets. I programmed them to use internal oscillators (8mhz) to keep the parts count small. You can program them using an Arduino.

      • Federico says:

        Fantastico! 🙂 2 more question, if you can (want) reply…
        – the sketch to use is always the same?
        – I must use only “neopixel led”, isn’t right?
        I’m not so skilled in programming, so…you know! 😀

        • admin says:

          Hi Federico! I’m glad this might be useful, so I’m happy to help.

          The only thing you’ll need to change, I think, is the length of each strip. In my .ino file I have several #define constants for this (BD_LENGTH, SNARE_LENGTH, etc). Then before I flash the sketch I make sure I’m using the right constant in the constructor for the Adafruit_NeoPixel object:

          Adafruit_NeoPixel strip = Adafruit_NeoPixel(HH_LENGTH, STRIP_PIN, NEO_GRB + NEO_KHZ800);

          If you like, you can get rid of HH_LENGTH above and just use the number of lights in the strip instead.

          This should work for anything the Neopixel library supports, but I’ve only used this one:

          https://www.adafruit.com/products/1138

          Cheers,
          Alec

  3. Jeff Hui says:

    hello , i am not sure the connection of sensor.
    why the source code
    #define PIEZO_DIG_PIN 2 // The digital pin # for the piezo input
    #define PIEZO_ANALOG_PIN 1 // The analog pin # for the piezo input
    however, the schematic picture. the pin 1 did not connect anything.
    if i use this sensor
    http://www.dfrobot.com/wiki/index.php?title=Analog_Piezo_Disk_Vibration_Sensor_(SKU:DFR0052)

    how to connect it with trinket?

    thank you so much

    you can email me by tsunfaihui@gmail.com
    as i have other question 🙁

    • admin says:

      Hi Jeff! Digital pin 2 is the same as analog pin 1, and should be labeled “#2” on the Trinket. See e.g. the pinout diagram on the Trinket page: https://learn.adafruit.com/introducing-trinket/pinouts

      • Jeff Hui says:

        Thanks a lot!!! That is useful!!!
        Yesterday I successfully completed the circuit. However, I want to tune the sensorbility of the sensor. I try to change the program code that is
        strip.setPixelColor(0, Wheel(n++, analogRead(PIEZO_ANALOG_PIN)/1024.0));
        I change the 1024.0 to 30.0 or 1024.0 to 5000.
        I find that 30.0 is more brightness than 5000 but more sensitive than 5000.
        How can I keep its brightness but less sensitive?
        What is the coding for tuning brightness?

        Actually, I am not fully understand the coding such as what is the meaning of
        “WheelPos” and “intensity”???
        Thanks a lot!!

        • admin says:

          Hi Jeff,

          The WheelPos is the colour (which just rotates, and doesn’t depend on the piezo sensor), and the intensity (brightness) comes from the piezo sensor.

          For the intensity, you’re reading an int value from 0 to 1023 corresponding to the voltage coming in from the piezo sensor. You need to convert that to a floating-point number between 0 and 1 for the brightness to change corresponding to that value. (As you’ve noted, smaller means brighter, larger means dimmer.)

          To calibrate your sensor, I’d suggest sending the value you get from analogRead to your serial monitor to get a sense of the range. Then you can adjust the 1024.0 value accordingly. (Note that the .0 is important as it tells the compiler that you want a floating point number, not an integer, as the result. Otherwise rounding will probably be a problem.)

          If you want to increase the brightness but not the sensitivity, try adding a number, e.g. for the Intensity variable:

          (analogRead(PIEZO_ANALOG_PIN)/512.0) + 0.5

          …but of course that’ll mean the lights only go down to half-brightness, no darker than that. Other approaches could be e.g. using 0 for intensity if the value from analogRead is below a certain, and adding a baseline number above that threshold, etc.

          • Jeff Hui says:

            Let me try it later. As I just wake up 😀
            In hardware problem, I find that after I use the drum light device then turn it off. Wait a while, I turn on the device again, the light will turn on automatically even I do not touch the sensor. And after about 30s – 60s, the brightness will decrease and it work correctly. Is it the problem about I use a capacitor 1000uF with 16V and 1M ohm?
            Sorry, I have a lot question haha.
            You are so nice!
            Thank you

          • admin says:

            I think something around the resistor R1 might cause a problem like that. Sorry if this is a silly question, but are you sure you’re using a capacitor for C1 and a resistor for R1?

  4. Mike says:

    I cannot get it to work, Using a gemma. Do I need a different pinout? Code went in as far as I can tell.

    • admin says:

      Mike, I’ve never worked with Gemmas before, but if I were debugging this I’d start by testing the piezo element (e.g. by reading from it and writing the result to the serial connection, testing by prodding it liberally), and separately test the lights by running one of the demos.

  5. Mike says:

    OK got it working on arduino uno, but only half of the leds are lit 30 out of 60.
    Mike

  6. Mike says:

    ok got it , set snare in length. What are the resistor and cap for? seems to work fine without it.

    Mike

  7. Mike says:

    During long rolls, it locks up and goes pink.

    • admin says:

      Mike, time to add that capacitor, I think 🙂

      If you get a sufficient voltage sag when lots of lights are being driven, it’ll cause the processor to lose its tiny mind. If a cap doesn’t do it, make sure your power supply is rated for enough current.

  8. Mike says:

    I’ll try a 1 MF? I have a 4.7 MF too. I’ll try em both and see which one works. Its on a Pearl Pipe band snare so the rolls are intense. Thanks again. Nice project!

  9. Mike says:

    Wow. This project exceeded my expectations. Incredible, thank you so much.

    One question, as I am new to addressable leds. How do I make them pulse from the center out,or ends in?

  10. Mike says:

    line 37: for (int i=strip.numPixels(); i>30,i<30) {

    line 42: strip.setPixelColor(30, Wheel(n++, analogRead(PIEZO_ANALOG_PIN/1024.0));

    something like this?

    • admin says:

      You’ll have to tinker with this a little, I’m afraid — if I start throwing pseudocode at you I’ll probably just confuse things.

  11. Mike says:

    Well it looks like i’ve blown the neopixel strip. I think it may have gotten a transient voltage surge. I was powering it off the 5v output on the Uno. I ran a strand test and only the first 3 will light now.
    Back to the drawing board.

    • admin says:

      Sorry to hear it, Mike! I’ve been running mine off decent-quality power bricks (about the size and shape of laptop power supplies) — I was using fairly long LED strips and wanted to be sure I wasn’t testing the supply’s limits. I’ll bet lower-power supplies are inherently crappier… maybe it’s worth spending a few extra bucks on a better supply, even if it’s overkill. (Rechargable) batteries would also be a lot safer, plus mobile.

  12. Moe and Ana says:

    Ok, Drummer here. Ive no clue how to do this, but wow this looks exceptional wehn compared to the others. I saw the Adafruit version but it was way too sensitive and kind of flat. Live would get repetitive for me. This circuit looks simple for a drummers mind, and I rather like the circling effect.. Ill only want to make one. For a snare will I have to adjust any code?

    • admin says:

      All you’ll have to adjust is the length of the Neopixel strip (e.g. HH_LENGTH), otherwise you should be set. Let me know if you get stuck — and likewise when you get it done!

  13. Nicholas Phillips says:

    Hey!

    This looks awesome! I want to hook this up to a cigarbox ukulele and maybe see it light up when I strum. However the issue I am having is that the lights turn off when vibration is detected and are otherwise always on. Any advice?

    Thanks!

    • admin says:

      Hi Nicholas! I’m afraid I can’t provide much help beyond suggesting double-checking the circuit. Make sure you corrected the string length in the source code for your particular light strip. You can also distinguish between light-related problems and piezo-related problems by trying out one of the NeoPixel test sketches. Good luck, and please consider linking to a video or something once you’re done!

  14. Federico says:

    Dear admin, finally I did it! It could work!! 😀
    Now I will try with an ATTiny85 and other led strip (similar to neopixel but cheaper)

    Thanks a lot!

Leave a Reply