**** 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


12 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?

Leave a Reply to Jeff Hui Cancel reply