I had this idea of making an interactive fixture for giving high-fives. Sometimes you need a little dexterous pick-me-up, but actually getting someone to commit to a slap up top and follow through with a heartfelt "You're Awesome!" is pretty hard to come by. Think the double slap popularized by Goose and Maverick in Top Gun. Wouldn't that be great, like, once a week??
I had the excuse to do this last month, during LISTEN3D - a theme loosely based around music and sound on 123Dapp.com.
Here's how it went down:
Step 1: 123D Creature > Tinkercad
The hand was pulled from the 123D Gallery - from a user called Mark Dollar. I considered using 123D Catch to use my own arm and hand, but Dollar's big, bulky Creature model seemed spot-on. I downloaded the STL from its 123D Gallery page, imported it to Tinkercad, where I created a 1" hole for the dowel 'arm' and a smaller cavity that would house the sensor.
Tinkercad is great for this kind of stuff. If you basically model the thing that is going into the hand, just turn it into a Hole, and it creates the cavity. Voila. It's the same process I used for the Skullpilepsy project.
The first iteration of the hand was actually in cardboard - I just imported the Tinkercad STL into 123D Make and defined the settings for 1/8" cardboard. (It actually exploded later, read on..)
Step 2: Arduino All the Day.
I began with the idea of using a piezo sensor for the activation, but decided on an accelerometer - it just seemed more controllable and consistent.
So, the first step was gathering parts. After a bit of advice from my 123D-mates 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 by a certain amount of force.
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.
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.
After successfully programming the Arduino to accept the accelerometer input to trigger audio files, we recorded some WAV files.
Step 3: Assemble the Hand.
I tried the cardboard hand from earlier, but it essentially exploded with a half-hearted smack (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 on the Makerbot.
I changed the plan of the hand with a base that could support a bunch of slaps. The original design used a big spring shoved on to the end of the dowel arm, but after a few hits, the spring started to flex and look sad.
I just 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 90 degree. (hint: clamps, steel tubing and a solid table). A quick trip to the hardware store netted a spring, some threaded rod, a bushing/spacer and some locking nuts.
Basically, the hand/dowel pivots around the threaded rod - which is locked in place with the nuts - a spring at the base will provide the tension for the hand to return to neutral. I just used a C-clamp to secure it to a desk and watched my co-workers smack away as they walk by. 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 with a single outlet.
Step 4: OHMYGODTHATISSOAWESOME.
It's a silly little thing, but i's pretty interesting to see people walk by and have what I can only imagine as some inner monologue about whether or not to hit it. There's a natural aversion to leaving someone hanging when they throw up their hand. Think about it: if you've ever refused a high-five, it was deliberate and decided. You had to consciously refrain from participating in one of the most bro-iest actions ever.
Well NO MORE! Let yourself bro out!
At the very least, don't leave him hanging.