Create a Simple Solenoid Musical Instrument

By Carlyn Maw for

It's a busy day; you're in a hurry and in your own world. Suddenly, a crazy drumming beat is in the air, you stop, the music stops. You move, the music starts up again. What's going on, you wonder. Then you notice the keyboard chalked sidewalk you're standing on. Each step on the keyboard draws a musical plunk from the store front. The instruments are hanging pots, cans and bottles, being struck by drum stick rods on an electrical contraption. You are triggering the music to play with your movement.

You are standing in front of CRASH Space, a DIY focused community space in Los Angeles. It is part of the hackerspaces movement. There may be one in your home town. They converted their entire store front into a motion-sensor instrument of recycled objects. Read on to learn how to make your own instrument.

You can build a stand alone version of this programmable solenoid musical instrument made from recycled pots, bottles and plastic coat hangers and a Jameco Music Maker Kit (P/N 2137959).

This step-by-step covers:
• The flower pot bells
• The thwackers
• The solenoid circuit
• The Arduino code to drive it

Step 1- The Flower Pot Bells

The 5 notes for the bells are made by striking 3", 4", 5", 6" and 7" terra cotta pots from the local garden center. We used a 2' x 4' pegboard framed with 1" x 2" boards for strength as the platform for our instrument. When buying the armatures to slot into the pegboard, go to the garage-storage section of the hardware store. Those are sturdier than the general housewares style.

reinforced pegboard
Reinforced pegboard
  t-nuts for mounting bolts
T-nuts for mounting bolts
crisscrossed zip ties hold the bell support in placeCrisscrossed zip ties hold the bell support in place

To make the flower pot holders we used 1/4-20 threaded rods with washers, nuts and gaskets. Each rod has to be stabilized at the top and bottom to prevent the pots from swinging every time the thwackers strike. We cut them down on our horizontal bandsaw. You could also try using knotted cat-5 wire, nylon rope or paracord.

Crash Space

A. Eyebolt
B. 1/4-20 inch Nut
C. Coupling Nut
D. 1/4 x 1 1/4" Fender Washer
E. 1/4 x 1 1/4" Rubber Gasket
F. Turnbuckle with left handed eyebolt still in it

Step 2 - The Thwackers

We affectionately call the hardware attached to our solenoids "thwackers". The assembly is a mechanical linkage and striker that converts the small solenoid motion into a visually satisfying sweep which strikes the pots to make a musical clank. The original units are made from laser cut ABS, standard screws and plastic coat hanger parts for the actual striker.

Original style
Original style
  Pegboard style
Pegboard style

Alpha version for July eventsAlpha version for July events

Here is the alpha version of the thwacker we are building for our July events. The plans, by Nick Garcia, are on CRASH Space's Thingiverse account.

We changed the design because the original had a bit of wiggle and drag if not properly assembled. This caused the solenoid to work harder and draw more current. The new design removes all of the miscellaneous adjusting hardware. The whole unit is laser cut acrylic and #4-40 screws, except we're keeping the salvaged coat hangers, of course.

Here are the steps to make your own newly designed thwacker.

A. Download the files.

There are a few up on the Thwacker Thingiverse page to choose from, but what you really need is:
  • Overview File
  • File for 1/8 inch thick parts in your preference of format
  •          20110707_thwacker_1-4in_parts_cropped.pdf

  • File for 1/4 inch thick parts in your preference of format
  •          20110707_thwacker_1-8in_parts_cropped.pdf
  • (In case you want them we also have posted one-shot PDF or DXF files as well)

  • B. Cut the parts get the hardware

    The parts
    The parts
    We are using a laser cutter to cut these pieces. If you have a scroll saw/drill press you can try cutting them in wood. Maybe even an exacto knife and foam-core. We'd love to see other versions. The hardware is listed on the Thingiverse entry and the Instructable written to help.

    C. Assemble the parts

    Assembled thwacker unit
    Assembled thwacker unit
    Nick, the thwacker designer, has created an Instructable on How to Make a CRASH Space Store Front Music thwacker that is the assembly instructions for the Thwacker unit.

    D. Mount on Peg Board

    Using the 1/4-20 hardware listed on each corner of the thwacker plate you'll need the following assembly:
      • A 1.25 inch 1/4-20 machine screw
    • Rubber Washer
    • Thwacker Plate
    • Round Washer
    • Hex-Nut
    • Round Washer
    • Pegboard
    • Fender Washer or Round Washer (2 fenders on opposite corners)
    • Lock Nut

    Mounting Assembly
    Mounting Assembly. This was done on a 1" machine screw. I recommend using a 1.25".

    BackBack (don't use the lock nuts yet, those go on once the thwackers are fully adjusted).

    The longer slots make it possible to slide the thwacker into place. Tighten everything down very well once it is in place.

    Step 3 - The Solenoid Circuit

    We improved the circuit by adding a third terminal block for the Jameco Music Maker Kit (P/N 2137959). Now there is one for data and ground from the Arduino board, one for the solenoid, and a block for both leads from the solenoid power supply. This makes each board more useable on its own. I also changed the TIP120 to a 12A logic-level MOSFET, RFP12N10L.

    Below is a new schematic. I put C1 in the schematic but not in the kit since it isn't always needed and the value might change depending on your whole circuit.

    Solenoid circuit
    Solenoid circuit

    D1 – 1N4007, Flyback or Snubber Diode. It protects the circuit from changes in the inductor (solenoid) causing a backwards flow of current the wrong way through sensitive parts.

    L1 – A pull-type solenoid with a spring return. It is designed to be pulsed intermittently with a maximum duty cycle of 10%. It provides 3.3-4.2Ω internal resistance and is designed for operation at 22-26V, though 12V still works. I measured it's inductance at 440µH. At 12V, my calculations lead me to believe we need 98 Amp/hr, or 9.8 with a 10% duty cycle. Another number to keep in mind: At 12V it's should be pulling around 3.6A and at 26V, 7.9A (Ohm's Law: 26 V / 3.3Ω).

    BT1 – All this leads to why the power supply for our system is a lawn mower battery. This lets us source a lot of current at once. We left the battery attached to a charger at all times when we were running this last summer and at Maker Faire. If running a number of solenoids, this is probably the cheapest way to go. If running just one or two, this AC/DC power supply looks like it could handle it. The more of these beefy solenoids that need to fire at once, the more robust of a supply needed to meet the challenge.

    Q1 - RFP12N10L 12A, logic-level MOSFET

    MOSFET Board
    MOSFET board with parts from Jameco kit. (by Carlyn Maw, July 2011)

    Front Of Board
    Front Of Board
      Back of Board
    Back of Board
    Example Set-upExample Set-up (black elastic hair band is holding solenoid plunger in place)

    There are a number of options for how to attach the solenoid to the circuit.

    Option 1
    Front Of Board Solder and heat shrink. This is what you see in our photos with this tiny high-gauge wire. Don't do that. Use a thicker gauge, line it up flat; use heat shrink.

    Option 2
    Front Of Board The pitch on the solenoids is 5.08 mm. Conveniently; many ATX power supplies and leads from things like floppy drives and optical drives use 2.54mm spacing. If there is a computer waiting for e-waste at home, pirating its cables is a solid way to go.

    Option 3
    If you have the crimp tool and parts on hand, you can make your own connector. Any 2.54mm female connector with 3 positions should work. (P/N Molex 234712 for use with Molex 2759, Molex 6459 or Molex 41572)

    Option 4
    Or there is always co-opting a new cable assembly for your own purposes. Jameco sells 4" interconnect cord cables, 18" interconnect cord cables and 24" interconnect cord cables that will work.

    Step 4 - The Code

    We used an Arduino board to control our solenoid system. Some of our code has gotten fairly complex, but I've written three simplified examples to help get things started. One just tests one solenoid, the second plays scales up and down and up and down, and the third plays one of three "tunes" depending on what button is pressed.

    The patterns are created by byte arrays. We are using the fact that every byte has 8 bits which can be examined separately to control the solenoids in our instrument. This is especially valuable in scenarios where the solenoids are being controlled serially, or if they are all in a register together. For the five notes, I'm only using the 5 bits to the right, what are known as the least significant bits. This means that bit one, the one all the way to the right, is the 7 inch baritone. For example the scales array looks like this:

    scalesArray[0] = B00000001;
    scalesArray[1] = B00000010;
    scalesArray[2] = B00000100;
    scalesArray[3] = B00001000;
    scalesArray[4] = B00010000;
    scalesArray[5] = B00000000;
    scalesArray[6] = B00010000;
    scalesArray[7] = B00001000;
    scalesArray[8] = B00000100;
    scalesArray[9] = B00000010;
    scalesArray[10] = B00000001;
    scalesArray[11] = B00000000;

    This tune is 12 notes long, with the 6th and the 12th notes being rests. It is a good one to use for testing all the solenoids. Feel free to edit them and make them your own while being sensitive to the limitations of your power supply (how many at once) and the limitations of the solenoid (how often any given one can fire).

    The Whole Shebang

    Jameco Music Maker Kit

    The Jameco Music Maker Kit (P/N 2137959) makes assembling the solenoid electronics easy. It includes enough parts to make two solenoid thwacker boards.

    Part No.* Qty Description
    Prototype builder,1.6 x2.7, brotoboard
    RFP12N10L, 12A logic level MOSFET
    Terminal blocks 2 position 5.08mm solder straight thru-hole 15A (blue)
    Terminal blocks 2 position 5.08mm solder straight, 10A (green)
    1N4007 diodes
    10kΩ, 1/4 watt, 5%
    Heat sink passive TO-220
    4-40 x 3/8 pan head screw
    4-40 hex nut

    *part numbers for datasheet reference, not quantity information

    To build the entire project above here are the additional products you'll need:

    Picture Key
    Part No. Qty Description
    Solenoid kits, see above


    Switches for triggering tunes: Use momentary for playing once, toggle for repeating. Link is to the giant grab bag, because they're awesome.


    All-purpose Power Supply For the Arduino if it isn't coming off of USB. The power for the solenoids I mentioned above. (7-12V recommended) I would keep it off the supply for the solenoids.



    8 Position Barrier Strips.
    - One is to common the grounds,
    - One is to divide out the power supply to each solenoid.
    - One is to isolate the leads from the Arduino so we could switch it out easily. Also because stranded wire works better over the longer distances to the solenoids than solid core and the block lets us transfer over to it close to the Arduino



    8 Position Barrier Strip Jumpers
    - One for Power, One for Ground



    16 Gauge Hookup Wire Black, Stranded (18 will work if you have it, double up to the battery connection if you can.)



    16 Gauge Hookup Wire Red, Stranded (18 will work if you have it, double up to the battery connection if you can.)
    22 Gauge Hook Up Wire Yellow, Stranded
    22 Gauge Hook Up Wire Yellow, Solid
    22 Gauge Hook Up Wire Red, Solid (only if you have none)
    22 Gauge Hook Up Wire Black, Solid (only if you have none)

    The Store Front Instrument was conceived and created by the VIMBY/Scion Hackerspace Challenge.

    VIMBY Hackerspace Challenge CRASH Space Episode 1 (5:43)

    VIMBY Hackerspace Challenge CRASH Space Episode 2 (5:47)

    About the Author and Crash Space

    Carlyn Maw is a founding board member and a principle cat herder for CRASH Space. She is a graduate of and was Adjunct Professor and Resident Researcher at NYU's ITP program, one of the origins of the Arduino platform. With a background in Human Factors, she consults on building interactive systems for consumer products, the movie industry, museums and others. She has taught Arduino, microcontrollers, and electronics seminars at CRASH Space, Machine Project in Los Angeles, ITP and other institutions. is a hackerspace in Los Angeles, CA. To paraphrase our flyers, it's a place where people who are interested in a wide variety of topics can get together to see how things work and discover new things to build. Topics range from silk screening t-shirts to building Geiger counters for Japan.