Make your playground musical with this interactive project.
Musical Swings, Version 1
with Gemma Ward
and Melissa Norelli Hassan
For More on this Project
Cultural life in downtown West Palm Beach was considerably enlivened for a short period last year when a vacant lot on Clematis Street hosted a traveling exhibition titled The Swings. This interactive art project is a swingset with nine seats, each of which triggers a different set of sounds when a person swings on them. The result of nine people swinging at once can be a sort of a collaborative musical performance.
Inspired by this, a motivated student, Gemma Ward, and her teacher, Melissa Norelli Hassan, of Delray Beach's Unity School wanted to reproduce the project with their school's own playground swingset, and experiment with how cooperating to make interactive art can have an effect on those using the swings. Mrs. Hassan was one of my students in last year's Introduction to 3D Design class at Hacklab North Boynton and thought I might be able to help them realize their project.
They proposed that Gemma would create the software using the Scratch visual programming environment if I could figure out a way to capture the action of the swing and provide inputs to Scratch. I did a bit of research and discovered a project named S4A, or Scratch 4 Arduino, that uses an Arduino with S4A's firmware to act as an intermediary between the physical world and Scratch code running on a PC. The Arduino reads its inputs continuously and sends values up the USB connection to the PC, and listens for values sent by the PC with which it updates its outputs.
The original traveling installation was a custom-made set of rigid-arm swings, which simplifies sensing their motion somewhat. Since the rigid-arm swings are confined to moving on a plane, it's easy to detect angle by, say, optical or Hall-effect sensors without needing to worry about the arm crashing into anything. But at Unity School we had an ordinary set of eight identical swings on chains, which permit twisting and out-of-plane motion. So I decided to detect swinging with an old favorite of mine: solid-state accelerometers.
Given that I could easily read up to five ADCs using S4A, it made sense to buy some accelerometer breakout boards that provide acceleration signals as analog voltage levels. I chose Adafruit's ADXL335 board, using the Analog Devices chip of the same part number, which also includes a LDO regulator so that it can accept 5V power. Sparkfun has a similar product without the LDO.
We could measure eight swings at once with two Arduinos, each positioned on top of the swing beam in the center of the four swings it serves. Some simple tests with the ADXL335 and an eight foot length of flat four-conductor telephone cable revealed that the analog signal could travel the worst-case distance from the farthest swing to the Arduino. Then we would need two laptops, positioned at the opposite ends of the swingset, and communicating with an Arduino via a 20 foot USB cable and extender.
To attach the accelerometers to the swing chains in a robust way, I designed a small plastic pod with a boss extending through a link of the chain and secured with a 1/4-20 bolt. These pods were 3D printed on Unity School's Makerbots. Although I use Solidworks in my day job, to make this design more accessible to others I built it in Onshape, the free in-the-browser CAD system I taught in my Introduction to 3D Design course. Here are links to the public files and STLs:
I soldered four-conductor flat telephone cable to the ADXL335 board, passed this through a rectangular channel in the enclosure, and used small threadforming screws to hold down the PCB and a strain-relief block that also came from the 3D printer. Notice that we use only the y-axis measurement in this application.
Four pods connect to each of two Arduino Uno boards, via Cat5 ethernet cable and modular connectors. Short on time, and needing a at-least-somewhat-robust way to mount and protect the boards and associated connections, I turned to my laser cutter. I designed an enclosure, again in Onshape, to be cut out of birch plywood and assembled with tab-and-slot techniques. You can download that below, along with a 2D drawing to give to a laser cutter; please note that I made some modifications directly to the 2D drawing; this is the difference between front and back plates which I haven't captured in 3D.
I installed the Uno boards inside the plywood enclosures and wired them to bulkhead-style RJ-45 connectors that I had left over from another project. The USB and power jacks of the Arduino are accessible through rectangular slots in the back panel of the enclosure.
To mount this on top of the swingset, I made some plywood stands that bolt to the bottom of the enclosure and can be zip-tied to the round beam of the swingset. Those stands have a radius on the bottom that matches the five-inch diameter of the beam.
To connect the accelerometer pods to the RJ45 ports on the Arduino enclosure, I made some cables from Cat5 with a RJ45 plug on one end and a RJ11 plug on the other, which I'd plug into an inline coupler. Those couplers I attached with double-sided tape to cable mounts made from more laser-cut plywood. Like the enclosure stands, these were designed in Onshape and have a radius that engages with the swingset beam. Because the enclosure stands and cable mounts are identical except for height, I designed them in the same Onshape document, but the vector outputs are separate:
- Arduino enclosure stands and cable mounts, Onshape document
- Arduino enclosure stands, vector drawing
- Cable mounts, vector drawing
On the day of the conference I went to Unity School early and started installing everything. That meant bolting the pods to one chain on each of eight swings, zip-tying the arduino enclosures and cable mounts on top of the beam, and cabling everything. Laptops we placed on tables at each end of the swingset, connected to the arduinos via 20-foot-long active USB extension cables. I also extended the output cables of 12V 2A wall-wart power supplies to provide more than enough power to the arduinos. The laptops were connected to a powerful multi-channel audio amplifier and speaker for sound loud enough to fill a crowded playground.
The arduino enclosures were installed in the center of each four-swing cluster. Because the swingset beam is supported in this location via a sort of connector around the five-inch pipe, I made the enclosure stands tall enough so that the enclosure could sit above.
A Swinging Party