Create a Simple Solenoid Musical Instrument

By Carlyn Maw
CRASHSpace.org

Programmable Fun From Re-Purposed Objects

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. The Store Front Instrument was conceived and created by the VIMBY/Scion Hackerspace Challenge.

Crashspace StorefrontCRASH Space's Store Front

You can build a stand alone version of this programmable solenoid musical instrument made from recycled pots, bottles and plastic coat hangers and some electronic components.

Jameco Music Maker Kit
Compont Name Qty. Part Description Mfr. Part No.
A 2 Solenoids SH-T2551
2 Prototype builder,1.6 x 2.7, brotoboard G/S(PCB228)-R
2 RFP12N10L, 12A logic level MOSFET RFP12N10L
4 Terminal blocks 2 position 5.08mm solder straight thru-hole 15A (blue) OSTTA024163
2 Terminal blocks 2 position 5.08mm solder straight, 10A (green) OSTYC022150
2 1N4007 diodes 1N4007
2 10kΩ, 1/4 watt, 5% CF1/4W103JRC
2 Heat sink passive TO-220 577102B00000G
2 4-40 x 3/8 pan head screw 28643
2 4-40 hex nut 36012
B 1 Arduino A000066
3 Switches for triggering tunes. Use momentary for playing once, toggle for repeating. Link is to the giant grab bag, because they're awesome. GB165LB
1 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. DDU120100H4480
C, D 3, 2 8 Position Barrier Strips and Jumpers
- 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.
- One jumper for power, one for ground
8-140
E 1 16 Gauge Hookup Wire Black, Stranded (18 will work if you have it, double up to the battery connection if you can.) 824-0
F 1 16 Gauge Hookup Wire Red, Stranded (18 will work if you have it, double up to the battery connection if you can.) 822-2
G 1 22 Gauge Hook Up Wire Yellow, Stranded 818-4
H 1 22 Gauge Hook Up Wire Yellow, Solid 9313-4-R
1 22 Gauge Hook Up Wire Red, Solid 9313-2-R
1 22 Gauge Hook Up Wire Black, Solid #9313-0-R


Step 1: The Flower Pot Bells

The five 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 pegboardReinforced Pegboard
t-nuts for mounting boltsT-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" nut
C. Coupling nut
D. 1/4 x 1 1/4" fender washer
E. 1/4 x 1 1/4" rubber casket
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 styleOriginal Style
Pegboard stylePegboard Style
Alpha version for July eventsAlpha Version
PlansPlans

Here is the alpha version of the thwacker. 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
         20110707_thwacker_overview.pdf

File for 1/8 inch thick parts in your preference of format
         20110707_thwacker_1-4in_parts_cropped.pdf
         20110707_thwacker_1-8in_parts_cropped.eps

File for 1/4 inch thick parts in your preference of format
         20110707_thwacker_1-8in_parts_cropped.pdf
         20110707_thwacker_1-4in_parts_cropped.eps

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 partsThe 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 a precision cutting knife and foam-core. We'd love to see other versions. The hardware is listed on the Thingiverse entry and as an Instructable.

C: Assemble the Parts


Assembled thwacker unitAssembled 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:
    • a 1.25" 1/4-20 machine screw
    • Rubber washer
    • Thwacker plate
    • Round washer
    • Hex-nut
    • Round washer
    • Pegboard
    • Fender washer or round washer (two fenders on opposite corners)
    • Lock nut

Mounting AssemblyMounting Assembly (this was done on a 1" machine screw. I recommend using a 1.2").
FrontFront
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


Solenoid Circuit SchemeSolenoid Circuit Schematic
Click here to enlarge

We improved the circuit by adding a third terminal block. 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 used a 12A logic-level MOSFET, RFP12N10L.

You'll need the following components:

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 its 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 should be pulling around 3.6A and at 26V, 7.9A (Ohm's Law: 26V / 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, a 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

Front Of BoardFront of Board
Back of BoardBack 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, such as the Molex 234712 for use with Molex 2759, Molex 6459 or Molex 41572.

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 serial, 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" 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).

Carlyn Maw is a founding board member and a principle cat herder for CRASH Space. She is a graduate of and was an 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 various institutions.

If you have an electronics story you'd like to share, please send it to [email protected].