Part 3: Audio & Assembly Awesomeness
I wrapped up March with this cool little project – it’s a little late on the calendar, but there were some tweaks to be made. Last time, I successfully programmed the Arduino to accept the accelerometer input to trigger audio files, and recorded some WAV files. I tried the cardboard hand from Part 1, but it essentially exploded (due to the inherent awesomeness of my high-five, maybe..). I decided to just bite the bullet and print it on our Objet printer, I may do another with flexible filament after all.
Once the files were cut and loaded on to the SD card, I finished the assembly of the hand with a base that could support a bunch of slaps. I used the shear at TechShop San Francisco to get some 3-inch strips of mild steel, then a vise and a hammer to bang it into a 90-degree shape (I’ll let you figure out how to get the other side).
A quick trip to the hardware store netted a spring, some threaded rod, a bushing/spacer and some locking nuts. Basically, the hand/dowel will rotate around the threaded rod – which is locked in place with the nuts – a spring at the base will provide the tension for it to return to neutral. I just used a C-clamp to secure it to a desk and watched my co-workers smack away. A small USB-powered speaker with a headphone jack provides the sound, and I just picked up a dual-USB-plug to power it and the arduino board.
The random clips are pretty funny, I may do something similar soon with microphones. The folks upstairs at Instructables have some pretty heavy feet, we’ve been scheming to provide them some ‘feedback’ when footsteps reach a certain decible level.
It’s a pretty cool little thing to have on your desk – most people can’t resist a high-five. And that’s good, because it’s rude to leave someone hanging.
Bonus: Here’s the raw footage of us recording the audio samples.
(I only had a small speaker on hand, please forgive the audio)
I started working on the electronics component to the HighFiv3D machine this week. In my previous post, I went from using a piezo senseor to an accelerometer; then this week I decided to do a tilt sensor before getting frustrated trying to debounce it. So ACCELEROMETER it is…!
The first step was gathering parts. After a bit of advice from Gian Pablo and Rob, I figured I’d need an Arduino Uno, a Wave Shield and the accelerometer to start. We have some Arduinos on hand at Pier 9, but you can get everything from Adafruit, retailing for about $60.
The Wave Shield is basically another circuit board that sits directly on top of an Ardiuno and allows for .wav files to be played from an SD card. Now I can record the audio with my laptop, convert to the proper file type (.wav) and store them on an SD card for random play when prompted; in this case, when the accelerometer is moved.
I used Adafruit’s Wave Shield Kit, v.1.1, for which they have a great tutorial on soldering and building the actual board. If you can solder, it’s very simple. You’ll need a 2GB SD card (it can’t use anything larger) that is formatted – I used the SD formatter that Adafruit suggested, but Mac’s Disk Utility will work. Once the board was built per the instructions, I only added some female headers to make testing easier.
For the accelerometer, the only soldering that’s required is the wire leads that will run from the Arduino to the Shield/Arduino. I chose Yellow/Blue/Red for my X,Y and Z motions, black for power and green for ground (my electronics aptitude has been dictated by motorcycle wiring). Just leave a foot or so of wire slack to test the sensor.
Once the shield was finished, I started working on the coding. My programming experience is pretty limited (I once made a light blink with an Arduino, but that’s about it). Fortunately, there is a HUGE community with pre-written codes (Sketches), so you can get away with not having to completely write it yourself. I pulled from Adafruit’s example sketches for the Wave Shield and the accelerometer. The Arduino forums are a good resource too. But, since I sit next to him, I asked Gian Pablo to help me with the shield code first.
From Gian Pablo:
The great thing about using the Arduino for DIY projects is that it is so widely used that you can almost always find an example or project that to get you started. For this project, we used the WaveShield from Adafruit (https://www.adafruit.com/products/94) to provide audio output. It is a simple Arduino shield with an SD card slot and audio output. We connected an accelerometer, an ADXL335 on a breakout board.
For programming, we just used one of the examples from Adafruit as a starting point, in this case the Play6_HC example (http://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino/play6-hc). We wanted to modify it so that instead of reading a button press to trigger the audio response, it would respond to sudden motion of the accelerometer, and allow for some time for the hand to settle down each time (if someone gave it a good whack). This only required 3 lines of code, and then we had to make some slight changes to the rest of the program so that it would choose a random response each time.
After a couple of hours we were good to go!
The only .wav files I had on hand were from Star Wars and Nacho Libre (don’t ask), so I put them on the SD card, followed some directions, and voila… my little shield was talking to me. Incessantly.
Then, with the accelerometer tuned in – I was eventually able to activate random files by hitting the sensor. I was frustrated for 2 days because I kept getting an error, but we eventually realized that the file names were too long!! With just the shield, the file names didn’t matter, it just played whatever is on the card. However, with the accelerometer and randomization, the same files wouldn’t play because they were over 8 characters. Once I abbreviated them, it would play perfectly.
Next: Building the contraption with electronics.
During the month of March, there are a few different music-themed things happening: SXSW and more festivals you can shake a stick at (it’s even Music in our Schools Month!), so we’re thinking about sound and music here at 123D. There are tons of great related models in the 123D gallery that we’ll be remixing and playing with for the next few weeks, and a couple of us have been focusing on sound-related projects using 123D Circuits – look for #LISTEN3D
As an at-best-novice with electronics, I decided to step lightly and integrate Circuits with some other projects I’ve been wanting to try. The first is, naturally, a High-Five machine. While it has nothing to do with music, per se, I think I’ll learn a lot about the audio/electronics side and 123D Circuits.
The idea is this: a free-standing hand that you can interact with for a bit of reassurance when walking to get a cup of coffee. When you give it a healthy palm smack, it will generate some positive words of encouragement – think “You’re Awesome!” or “Oh Yeah!”. Within a cardboard-stacked hand, a sensor would register impact and trigger the audio. My first thought was a Piezo sensor in the hand, but after some words of wisdom (and a high-five) I decided to go with an accelerometer that would determine when the hand was moved, thus activating the audio output.
The first step is building the physical hand and then we’ll figure out how the passerby will interact with it – table mounted seems the easiest, but wall-mounted would be a little cooler. I considered using 123D Catch to create a model of my own hand and arm, but while messing around on 123D Creature, I found a really great model by Mark Dollar! It’s a bit cartoonish and big, so it should be perfect.
I downloaded the model and opened it in MeshMixer to open up the fingers a bit more for a proper high-five. Then took it into Tinkercad to work on the cut out. I think a 1″ dowel is a fine way to make the ‘arm’. I also made a little hollow for the accelerometer.
Once I was happy with the cutout, it was on to 123D Make to generate the slices for the laser cutter. I wanted to keep it close to human scale, so I made it about 9″ tall. Once cut, the only tedious bit was the fingers (hopefully they’ll withstand some trauma).
Now I need to go shopping, look for next steps and more Sound & Music posts soon.
Here’s a quick little project with Tinkercad and a 3D printer – a letterpress block for custom hand-printed Valentine’s Day cards!
Reversing the Tinkercad logo was a bit tricky, but as with most things in Tinkercad, figuring out how to model with vector objects is half the fun. It’s pretty amazing what you can do with the Hole function if you think about it as a subtractive element.
This block was printed on an Objet Connex, using a Vero Clear for the base and Tango Black for the stamp part, but I’m trying some on a Makerbot using flexible filament.