Auto Photobooth W/ Music & Bubbles - Makey Makey + Arduino + Javascript + PHP + Magic

by AldoPadilla in Circuits > Art

3000 Views, 31 Favorites, 0 Comments

Auto Photobooth W/ Music & Bubbles - Makey Makey + Arduino + Javascript + PHP + Magic

IMG_9713-sfw.jpg
InstructablesDiagram.jpg

We made an installation for a Virginia Is For All Lovers project, http://VAisForAllLovers.com .

It is made up of a Makey Makey, Arduino, and Code primarily, with some supplemental parts like music and bubbles.

The installation is to celebrate the diversity and human connection between all people of Virginia. We are moving the installation from place to place around the Richmond area. It invites people to share a photo of themselves with another person without regard to ethnicity, gender, religion, sexuality, social class, or disability. It is triggered by making a connection with another person.

Below you'll find the code and tuts we used to make this happen. Maybe you might want to make a photobooth or an installation of your own.

By: Aldo, Max, and Joel

The Things You'll Need...

DiagramParts.jpg

1. Webcam with a long usb extension cable (at least usb 2.0)

2. Conductive handles of some sort (x2) with long wires that will reach your electronics

3. Makey-Makey + Library

4. WTV020 Music module. 2gb card. + Library + Audio Format program

5. Computer speakers (or other amplified speaker set) and a 1/8" audio jack

6. Arduino (We used an Uno), breadboard, gator clips, and jumper cables galore

7. Servo (We used a standard size one for it's stronger torque), 9v battery & plug + Library

8. Bubble Gun, twine, and a board

9. PC computer (we used a PC because it's inexpensive, the webcam works well with it, and we needed it to convert audio for the music module)

10. WiFi

11. Photobooth code (Our mod is here)

12. A domain server space (We're using 1and1.com)

13. BufferApp account (This allows you to email a photo to get queued for Twitter)

14. Twitter account

Tools: Soldering iron & solder, cutters, pliers, wire striper, dremel kit, and a helping-hand.

Plus stuff: Zip ties helped a lot and fearlessness.

Get a Photobooth Site Up...

Screen Shot 2014-11-29 at 5.21.26 PM.JPG
1419.jpg

We used the photobooth tutorial and code found on tutorialzine and made modifications to it.


Modifications:

-Take photo on keypress 'u' (arbitrary, but it has to coincide with the keypress code on your Makey Makey)

-Upload automatically without preview or needing the 'upload' button to be pressed

-Added phpmailer to code so that it also emails the photo to BufferApp (Buffer gives a unique email address for queuing via email) so that it can then be selectively Tweeted

Modifide code can be found here: https://github.com/AldoPadilla/ForAllLovers

Get Your Makey Makey Running...

Screen Shot 2014-11-29 at 5.20.39 PM.JPG
makey-makey-xl.jpg

Your modified photobooth will respond to a keypress (let's continue to use 'u'). The Makey Makey sends this keypress when the circuit is closed by two people (closing the connection between 'Click' and 'Earth'). That's when the photo is taken.

Your Makey Makey needs a modified library and code. Detailed instructions on modifying your Makey Makey can be found here: Upload.
- Modified sketch
- Modified library

This sketch+library sends the keypress 'u' to trigger your photobooth, then it waits for your photobooth to upload and email the photo before it lets you send another keypress. This prevents your photobooth from wiggin out and uploading blank images.

The Makey Makey also sends a signal to the Arduino when you close the connection; which, turns the servo and triggers the music shield simultaneously (This is in the next step).

Arduino Setup for Music and Bubbles

Screen Shot 2014-11-29 at 5.21.38 PM.JPG
IMG_9708.JPG

Let's set up the Arduino to receive a signal from your Makey Makey! This will let us trigger the servo and music module.

First we need to upload libraries onto your Arduino IDE
- VarSpeedServo // Variable speed servo control
- WTV020 // Music module control

This is the sketch we made for the Arduino. It triggers one out of sixteen random audio tracks from inside the micro SD card. It also makes the servo move 85ยบ triggering the Bubble Gun.

Have these libraries uploaded and the sketch handy, next step we start wiring it all up.

The Music Module

Screen Shot 2014-11-29 at 5.24.42 PM.JPG
VAforAll-Wiring.JPG

The WTV020 music module might be the most difficult to work with, but it's inexpensive. It requires a 2gb micro SD card, no larger and no smaller than this. Some 2gb cards just aren't recognized either... It's picky. You have to run some trial and error. Our Samsung 2gb card worked. It can only read AD4 audio formats, which can only be converted from WAV through a PC and a special program. Here are some other instructions on this music module.

At this point you should have the library and sketch in the Arduino (see previous step).You can find the tracks we used in our micro SD here or get sample tracks here. If you made WAV tracks this is the PC program you need to convert them and more instructions are here.

See Fritzing image above for wiring.

Servo and Bubbles

Screen Shot 2014-11-29 at 5.24.28 PM.JPG
IMG_9702.JPG

The servo pulls a twine that in turn pulls a trigger on our bubble gun. Very effective because the VarSpeedLibrary helps us control the speed so that the bubbles are shot out perfectly.

See image for our example

Set It All Up and You're Ready to Shoot

InstructablesDiagram.jpg
IMG_9706.JPG
IMG_9704.JPG
IMG_9705.JPG

Once everything has been tested individually and things check out:

-The Photobooth Webapp shoots with the keypress 'u', uploads, and emails
- BufferApp is receiving your image and pushes to Twitter
-The Makey Makey is sending the letter 'u'
-The Arduino is receiving from the Makey Makey and triggering both the Servo and Music Module
-The Bubble Gun is shooting bubbles
-The Speakers are set to 11 and play the track in the Micro SD

Now you're ready for a photo party.

The steps in this Instructable might be a little loose, that's because you can modify so much. We hope that we included enough external links to answer any of your questions. Have a fun building!!!

-Aldo, Max, and Joel