Photo booths are fun! They can inspire goofiness in just about anyone.

For my first project with the Raspberry Pi I built a photo booth for a party. This was a great project for learning to tinker with photography and electronics on the Pi. People were happy with the booth, and curious how it was built, so I thought I'd share what I learned.

This project tutorial assumes a very basic knowledge of linux/bash and the ability to solder a simple circuit.

Overview: four main components of the booth

  • Camera, with USB connection and preferably with an AC power adapter and tripod
  • Photo printer
  • Controller, the user interface, with a start button and indicator lights, and a brain of Raspberry Pi, which controls the camera, assembles the photo montage, and drives the printer. This is what I will show you how to build.
  • Booth enclosure, not strictly necessary, but does provide the intimacy essential for maximum fun;¬†best when filled with beautiful women in fabulous dresses

Parts needed for the controller:
Raspberry Pi
Powered USB hub
Electronic components:
GPIO ribbon cable
Perma-proto-board Pi cobbler
LED-illuminated momentary contact switch
LED indicator lights
various resistors
wire for making connections
soldering iron and solder

During setup:
SD card reader
computer to set up the SD card
monitor/TV with HDMI
USB keyboard and mouse

Step 1: Setup RPi

Do you already have your RPi with Raspbian installed and can access it through SSH? Then skip to Step 2: Connect the Camera. Otherwise, grab your RPi, an SD card, an SD card reader, and another computer and:

1) Prepare an SD card with a Raspbian install

2) Boot up and configure
Enable the SSH server during configuration, so you can run your RPi headless, i.e., without a monitor or keyboard, via the command line from a remote terminal.

3) Set up a network connection
Open Midori to test if you are connected to the internet. Then, once you are successfully connected, open a terminal window and type "sudo ifconfig" to get your ethernet IP address; write down this number (something like

4) and lastly, set up SSH
Log in to your RPi from another computer on the network. Now you're ready for the next step.

<p>I plan on using this for my wedding next year, but decided to test it at my future stepson's birthday party. I started last minute and ended up running into some issues with the wiring / gpio portion, so for this test run I ran the commands manually. </p><p>I found that using mogrify sample instead of mogrify resize saved a bit of time on the resizing of images. It also makes a huge difference in processing time if you start with a smaller image, so I set the camera (Nikon D5000) to take smaller images.</p><p>I added a command to copy the original files before resized so they are available for prints at a later time.</p><p>For the stand I bought a Cube storage shelf (2 cubes x 2 cubes) from Target and removed the middle divider on the top shelf. This gives me a place for the printer to sit, and with a tablecloth over it allows all the electronics to be hidden.</p><p>I tried a mirror for the preview but it ends up being too close / doesn't show as much as is actually in the picture. I had a handheld camera laying around with RCA video out, and a handheld TV and combined those to give a good preview. Another idea I had played with would be a cheap android tablet, put it on the front facing camera, and leave it running. I already had the camera/tv so I did not pursue this.</p><p>I attached a little basket to the shelf the printer sits on and the photos fall into it once they are printed (Canon Pixma iP2702). Since I was running this manually, I decided to push the limits a bit - I noticed that CUPS had no issue queing print jobs up for me. At one point I had a job printing, a job qued, and was in the process of taking 4 new photos. At this point the commands to take the photos were running a little slower, but I wonder if the rPi 2 would handle it better. Perhaps making it wait for the printer to be idle isn't necessary?</p><p>I did this test run to find ways to optimize it so it's ready / smooth at our wedding. I still need to get the button functioning, and need to figure out how to get the printer to print at a lower quality for faster prints. All I see in CUPS is print quality : Normal or Manual. Manual doesn't seem to make a difference.</p><p>Overall, even though I was running the show and had a few hiccups, it was a hit and the birthday boy asked if he can have it again at his next birthday.</p><p>What I think I will work on in the future is A - reformatting the layout to use landscape images instead of portrait - it was difficult at time to fit everyone into the frame - and B a way to secure / hide the camera and make the whole project look more finished - without losing the flash on the camera.</p>
<p>&quot;I added a command to copy the original files before resized so they are available for prints at a later time.&quot;</p><p>As I am a noob in this field, can you please give me a copy of this command ? I think it would be very interesting for me !</p><p>thank you !</p>
<p>Perfect tutorial! Everything worked as described. Thanks! I made my photobooth with a built-in printer (Canon Selphy CP800). I got some troubles with finding a working driver at first, but in the end the Gutenprint driver for the Canon MP550 did it for me.</p><p>(P.S.: Attention when connecting GPIO on Raspberry B+ or newer, as the tutorial is written for Raspberry Pi A/B which only got 26 ports. So you have to find the correct pins on model B+.)</p>
<p>Pin numbers are the same, as the header counts the same way. Of cause you have to start with pin 1 which is the only one with a square on the pinout. I also used a Pi2 with 40 pin gpio connector.</p>
<p>Thank you for sharing your build, that looks like a sweet setup.</p>
<p>If you want to use a Pentax DSLR these are not working with gphoto2, so i wrote a pentax version of safay's script. Could be downloaded from </p><p><a href="https://github.com/thedarkman/RPi_photobooth/tree/pslr-shoot" rel="nofollow">https://github.com/thedarkman/RPi_photobooth/tree/...</a></p>
<p>Didn't bother with the printer, so I removed those lines from the script. And changed it to copy the original photos before they are resized. I will upload the photos for enery to retrieve later and I'm now trying to get a slide show to display the pictures. I'm also trying to add a random sound to play just before the camera takes a picture. </p><p>It works great so far, my biggest problem is the camera doesn't charge from the USB port so I have the change the batteries every so often. </p>
<p>I was wondering about the need to print. I wanted it to save to an external HD to upload to a Flickr account or something like that. How would I do that?</p>
<p>Great idea!</p><p>Here's a python package that you could use to modify my script:</p><p><a href="https://github.com/ept/uploadr.py" rel="nofollow">https://github.com/ept/uploadr.py</a></p><p>It uses the flickr API, if you're curious about learning more:<br><a href="https://www.flickr.com/services/api/" rel="nofollow">https://www.flickr.com/services/api/</a></p>
<p>Cool! I'm glad this worked for you.</p>
<p>Excellent tutorial - everything worked as described. My 'Vintage Camera' box and tripod houses everything. Added a 'vintage' LED light. Used an illuminated button from an old desktop PC case. Wiring a bit messy but it all works. Camera: Canon EOS 1100D Printer: HP Photosmart. Setting the camera to a lower resolution, setting the printer to high (not Photo) quality and using A6 cut photo glossy paper gives great results and returns the booth to ready status in 90 (ish) seconds. Access via SSH is great but I find the easiest way to change printer settings and get images off the SD card is to use a second Rpi. Also I solved the live view issue - I use a mirror!!</p>
<p>Exactly what I'm going for! Do you have more pictures of the construction process, by chance?</p>
Slick! I love it. Such a cool project!<br><br>Do you use a handheld mirror? A mirror is way superior to a video screen for feedback; the latency, especially, is just awesome. I wanted to try to implement a one-way mirror in front of the camera like in the old photographic-paper-style photo booths, but never got around to it. Next time!<br>
<p>Thanks. Yes the latency is way fast and the resolution is beyond 4K! Truth is I dual screen; hand held and freestanding (on a pole).</p>
<p>Be sure to check that gphoto2 supported camera page lists &quot;image capture&quot; for you camera, otherwise it won't work. </p>
<p>Great point! Edited accordingly; thanks for the tip.</p>
<p>Any idea why I can't print it correctly ?</p><p>Every image made by this scripts has the same problem, it is printed with a big blank under it and on the right side and the top of it is cut.</p><p>It's not a driver or a printer problem because I can print correctly other pictures, I even try with a different printer and the same problem happened...</p><p>The result is the same from the script or if i use the lp -d command in the terminal...</p><p>Please help !</p>
<p>Dear Safay, my compliments for the great work, this looks amazing!!! i'm building it right now for my wedding. I have an issue which i kindly ask you and anyone willing to give me an hint to resolve it. Issue: after installing gphoto2 i go to remove the 4 files which prevents the camera detection (eg. sudo rm /usr/share/dbus-1/services/org.gtk.Private.GPhoto2VolumeMonitor.service) but i can't find them. the same goes for the other 3 files. I can't understand what's wrong. I updated the system to latest version with apt-get update... anyone has an idea? Thanks a lot Emanuele</p>
<p>it seems the latest version of gphoto2 works fine without deleting any file ;)</p>
<p>HI and thanks for a great tutorial! I have a Makey Makey laying around at home so I was hoping to skip GPIO all togethe instead making the script/Gphoto listen for a keystroke, is that even possible? </p>
I haven't used the Makey Makey, but this sounds like a fine idea. To detect a keypress you might try the approach described in this Python docs FAQ here:<br>https://docs.python.org/2/faq/library.html#how-do-i-get-a-single-keypress-at-a-time
<p>So I dropped the Makey Makey idea and instead went for the GPIO pins. Using Drumminhands python script to take the photos since I'm using the picam but using your bash script to assemble and print, seems to be a lot quicker than using python. My question is: Any idea why the graphics (and images) are 90 degrees off from what you have? :) <br>Printer is Canon Selphy 910: </p><p>http://40.media.tumblr.com/d06993fcdd9c222f06f5ccc7317e26c4/tumblr_nsu2jfaQO51uch3afo1_1280.jpg</p>
<p>When i look at your picture from tumblr, i see you are using your camera in landscape mode. The script expects portrait mode, so you have to turn your camera 90 degrees.<br><br>Do you use the cp910 with USB? If so, what CUPS driver did you use? I could not get the cp910 working with usb, only WiFi.</p>
<p>Hi there and thanks for the reply. I realized that myself as well and did some minor changes. I never got the printer to work with Wifi and decided to go with wifi. Works fine. The booth is really fast at assembling and printing pictures. I guess its down to the smaller size files from the picam. Will do some experimentation with DSLR. I also had a screen to display the pictures and instructions in addition to four leds in the front, around the lens, to keep peopling looking in the direction :) <br><br>Attached is a nice shot of me and mylady the morning after our friends wedding. </p>
<p>Where'd you get that shirt?</p>
<p>Hi MikalV. I'm trying to change the script to print in landscape mode, like you have done here. Can you give me some pointers please as I'm really struggling to get it to work.</p><p>Many thanks, Steve.</p>
<p>Hi MikaIV, I see you had it in landscape mode with the banner on the bottom <br>(and use the design from the Knot... I have the same plan :D but how did you realized it ? What kind of changes did you make?</p>
<p>It was supposed to say: <br>Never got the printer to work with USB... and went with WIFi :) </p>
<p>Excellent instructable :)</p>
<p>Great guide! I made it with a twist.</p><p>RPi photobooth automatically uploads photos to Google Drive with Google URL shortener for quick, direct guest access to each set of pictures using my fork: <a href="https://github.com/sojojo/RPi_photobooth" rel="nofollow">https://github.com/sojojo/RPi_photobooth</a></p><p>Using: Raspberry Pi, USB WiFi, controller described in this instructable, Nikon D3100 camera (compatible with gphoto2 - other models will work as well). </p><p>Requires use of a monitor to retrieve the link to the photos, as is. Someone fork mine and make a proper GUI!</p>
<p>Hi. Firstly I found that this was a good tutorial to follow with. I managed to build the photo booth according to your tutorial, and I am very happy that it was work. But what come to my concern is, is there any way that we can display the live view of the dslr on the monitor by using the same concept as your tutorial?</p>
<p>Thanks for sharing this Project. I changed my former Photobooth from an Arudino+iPad solution to an Raspberry with Touchscreen option. No printing option.</p><p>The setup is simple, push the button, photo will be made and displayed. And this is my problem at the moment? How can I display the last photo taken on the display? I use a CLI Python script at the moment. Any idea?</p>
<p>Thanks for a great and well-written tutorial! Here is my version of the Photobooth.</p><p>I made some tweaks, the biggest change was to add one extra button + led. It is used to restart the Photobooth if the camera goes into sleep mode. You can read about it here:</p><p><a href="https://github.com/johols/RPi-photobooth" rel="nofollow">https://github.com/johols/RPi-photobooth</a></p>
<p>This is brilliant. Well documented, extremely clever, and fun. Also had issues with the printer which was the Canon CP910, but finally got it going. Camera is a Nikon D50. Everying works great. </p><p>Can't thank the author enough. This was a huge hit at my in-laws 50th wedding anniversary.</p><p>Can</p>
<p>I'm trying to make this but running into some issues on my Pi2. I got everything connected, tested the camera and printer and they worked. Wired everything up. LEDs don't work....hmmmm. Pressed the button and it takes a picture..... and then it hangs. Not sure what else to try, I posted more details on reddit below. Any help is appreciated!</p><p>https://www.reddit.com/r/raspberry_pi/comments/4og7os/help_trouble_with_photobooth_and_gpio_breadboard/</p>
Hi all! <br><br>This project looks awesome! <br>I'm trying to show the photos using fbi command, but I cannot set the correct filename due to fbi does not recognize %H%M%S.Jpg<br><br>How can I implement this? <br><br>Sorry for my bad English :(
<p>Hello Safay! Great tutorial. I'm having a weird problem with printing.</p><p>It will print fine in all the tests. But when the script is running it will only print the yellow layer and then quit. </p><p>It doesn't even spit it out. Could it be something where the printer doesn't have enough time to print before the script resets?</p><p>It is a Sony up dr200 dye sub printer.</p>
<p>Did you ever get your DR200 working? I have one and I'm not getting anywhere.</p>
<p>and, I waited a week, and now it works Great&hellip;</p><p>Oh well, I guess it was just &quot;le tired&quot;</p><p>I made it! very excited.</p>
<p>Glad to hear the problem ironed itself out!</p>
<p>Is it possible to change the output to be more like a photobooth .. ie 1x4 pics? I modified the assemble_and_priint code a lot and nothing ever seems to change.. even after rebooting... i went through your python code as well. </p><p>Sorry for all of the questions.</p>
<p>Do you have special paper for 1x4 pictures? I tried it with 1x4 but it would waste much of a normal selphy printer paper.</p><p>If you want to use it as 1x4 you have to change the assemble_and_print script and recalculate the singe picture sizes and of cause the 1x4 collage. If 4 pictures are in one row the size used for mogrify needs to be much smaller. Then the montage command needs to be adapted as well to accumulate for the smaller pictures.<br><br>If you still have not managed it, perhaps you can answer here so we can get it working together.</p>
<p>Is it possible to change the output to be more like a photobooth .. ie 1x4 pics? I modified the assemble_and_priint code a lot and nothing ever seems to change.. even after rebooting... i went through your python code as well. </p><p>Sorry for all of the questions.</p>
<p>This is a cool project. I did most of this, and it all tested fine. What I am having a problem with is the wiring. I tried following the schematic,, then your picture but i can't follow the wires in that pic, Do you have any others? So far every time i hit the button to take the pic it reboots my RPi.</p><p>In the top of the pic, are you wiring all of the Orange/Whites together? Then out to the LED? </p><p>Thanks for any help.</p><p>Dave</p>
<p>Glad you enjoy the project! Unfortunately I don't have the project any more, so I can't advise you about the orange and white wires other than to say that it's not safe to assume anything about the wire colors. Follow the schematic only.<br>As to why you're getting a reset when pushing a button, the only hardware reset I know of uses the P6 header:<br><a href="http://elinux.org/RPi_Low-level_peripherals" rel="nofollow">http://elinux.org/RPi_Low-level_peripherals</a><br>So there's probably a problem with the software. I'd add some debugging code to the script to see exactly what is happening when you push the button.</p>
<p>Thanks for the quick reply and link. I meant to delete my comment this morning. I was able to actually get the electronics to work. Yay me!</p><p>However now I am stuck on getting it to print. All of tests worked fine. It takes the four pics but I get the folliowng error for printing:</p><p>sudo: /home/pi/scripts/photobooth/assemble_and_print: command not found.</p><p>Grrr. But that's what makes it fun and challenging.</p>
<p>Never mind, I mistakenly loaded the files into the main Pi directory. This has definitely giving me some experience with the Pi. I will post a pic once complete. I need it for my daughter's bday party this weekend.</p>
<p>Hello there,</p><p>thanks you very much for this very useful tuto. I'm planning to build a photbooth, but I have a raspberry pi2 (B model) with a 20 pin &amp; 20pin GPIO cable. Is it possible to have the electronic scheme for this model ? As I can see, in the tuto, there is only 13 pin and I'm confused...</p><p>by the way, I'm from France and was not able to find the same permaproto circuit, so I buy a &quot;Raspberry Pi Proto Breadboard PCB&quot; from nulsom, not sure if it's the same ... </p><p>any help will be welcome!</p><p>thanks</p>
<p>oops, sorry, should be 40 and 26 pin... As for I understand, I can use the 40 pin cable as the couting is the same... thanks!</p>
<p>I used the Raspberry pi camera and printed using my Canon MG2120 printer</p>

About This Instructable




Bio: scientist, educator, maker, and member of Ace Monster Toys
More by safay:Commute on BART with your bike like a BOSS Raspberry Pi photo booth controller Make a 3D print from a 2D drawing 
Add instructable to: