Raspberry Pi Photo Booth

A DIY photo booth for events that takes photos and uploads an animated gif to a Tumblr account.

Now Version 3.0

I recently updated this tutorial and code for a new version. It’s simpler and works more efficiently. Also, I added an optional second raspberry pi connected to a projector showing the event’s images.


If you are just looking for the nitty gritty, consider looking at the code on GitHub, the how to photos on Flickr, and the results on Tumblr. You will also need picamera, pyTumblr, and GraphicsMagick. Be sure to have a strong connection to the internet (wired is best) and good lighting. Set yourself up for success with the photos and posting.


This post begins with a story. My wife started grad school in the Fall of 2012 at the Cooperstown Graduate Program. We moved to Cooperstown, NY in the summer of 2012. Given the two-year program, it gave me a two-year duration for a photo project. I decided to use the iPhone app PocketBooth to take photo strips of people that we would meet in those two years. Of course this was before the word “selfie” was used all the time. It turned into a fun project. I printed the strips and hung them in our house as the number grew. Then, on the night of graduation, I brought the exhibit to their reception. It went over very well. I then posted the photos online on Flickr.

Overall I was happy with the project. I was constantly surprised at how easy it was to get people to smile and let loose in front of a camera when it’s a photo booth. However, the overall project was very time intensive. I had to take my phone out of my pocket, open the app, take the photo strips, save the strips to my computer, print out the strips, cut the strips, and then hang them on the exhibit. Part of the beauty of the original photo booths is they were automated.

So then I decided to make an automated photo booth for my wife’s graduation reception—a bit of a guerrilla exhibit. It sounded like fun. I had been playing around with the Raspberry Pi for a bit, so this seemed like a great use for the camera module.

The Plan

Original sketch of the idea
Original sketch of the idea

So the goal was to make an easy to use photo booth for guests at an event. Then turn the photos into an animated gif and automatically post it online for easy sharing.

I began with a notebook sketch of the idea, algorithm, and construction. See here. Then I researched other photo booths out there for inspiration. Then I started wiring, coding, and testing. Once I had the parts working, then I built the enclosure.

Here is the basic algorithm:

Idea Algorithm
Algorithm idea sketch
  • Setup
    • Set the device on top of a camera tripod and point it at a good location for guests to stand
    • Make sure there will be good lighting on the guests
    • Power up the device
    • Light up all the lights on the front for a bit to show that it’s running, then turn them off
    • Await a button press
  • Big button press
    • Once the button is pressed, blink the first light for a few seconds, telling the guests to get ready
    • Show the real time video preview on the screen
    • Take four pictures
    • Light up the “Pose” light (Note, in later versions, I removed the LEDs for the steps. It was a better user experience to just put images on the screen for the steps.)
    • Take a photo and save as a .jpg with a time stamp in the filename
    • Repeat four times
  • Process the images
    • Turn off the preview monitor
    • Blink the “Uploading” light
    • Combine the four jpgs into a new animated gif (consider adding a footer to all the pics)
    • Upload to Tumblr (since Tumblr natively handles animated gifs)
    • Stop blinking the light
  • Done
    • Light the “Done” light for a few seconds
    • Replay the images on the screen a few times for instant gratification of the guests
    • Await another button press
  • Shutdown
    • Have another button in the system, and if it is pressed shutdown the Raspberry Pi safely. Light all the LEDs first as a clue to when it’s safe to turn off the system. (Note, I removed the second button. It was working inconsistently. And adding keyboard interrupts was a lot easier to use when coding. It may be a bad habit to just turn off the raspberry pi instead of a proper shut down. But I have yet to have a corrupted card. Cross my fingers I don’t have problems. If you’re worried, just plug in a keyboard, hit escape to exit pygame, hit ctrl-c to exit python, and then type sudo halt to shutdown.)

The Parts

View from the rear showing the guts, including the Raspberry Pi
View from the rear showing the guts, including the Raspberry Pi

Here is a basic parts list without the enclosure:

  • Raspberry Pi computer ~$40
    • The newer pi’s work just fine too.
  • Raspberry Pi camera module ~$30
    • I’m using a version 1 camera, but newer versions work as well.
  • SD Card
    • I used a 32 GB card with a decent read/write speed
    • But an old camera card at least 8GB should be fine
  • 5V Power adapter with USB A to Micro B cable ~$10
  • 7 inch monitor
  • Video cable
    • Either HDMI ($6) or RCA ($7) depending on what type of monitor your use. The shorter the better. I ended up trimming down an old RCA cable for my purposes.
  • Video power adapter
    • You’ll need one unless it’s included in your monitor purchase. I used a variable adapter set to 12v that I had sitting around.
  • Keyboard
    • A standard USB keyboard you have laying around is just fine. You’ll only need it during configuration, not during usage.
    • I use at wireless keyboard/mouse combo, which is nice to leave plugged in even during operation at an event.
  • Mouse
    • A standard USB mouse is fine, as you’ll just need it during configuration.
  • An arcade button. I used one with a built in 5V LED ~$2
  • GPIO cables ~$10
    • Used to connect the GPIO pins to the button
  • A tripod mount
    • Originally I made one to fit my camera tripod, but it was a little too shaky.
    • On the latest version, I used a PA system tripod mount. It’s much more stable.

Here is an optional parts list, some things that are really nice to add:

Setup the Raspberry Pi

Raspberry Pi Graphical Interface -- Photo by Gary Higgins (https://www.flickr.com/photos/meccanohig/8104338921/)
Raspberry Pi Graphical Interface — Photo by Gary Higgins

If you are new to the Raspberry Pi, there are lots of good tutorials to get you started. But here are some quick links on what’s needed for this project.

Install noobs on the SD card.

Setup the WiFi.

If you are using the Bluetooth keyboard and mouse combo, here are some instructions for setup.

Somehow you’ll want to move files to and from the Raspberry Pi. If you have a Mac, this is the easiest way. This looks good on a PC, but I’ve never tried it.

I’d recommend doing most of the configuration using a large external monitor. When you’re ready to move to the small screen, note that I ran into errors getting the composite video working. I found that I needed to edit a config file.

sudo nano /boot/config.txt

Comment out the line

# hdmi_force_hotplug=1

I ended up figuring out some other settings to get the video looking decent on the low resolution monitor.


If you haven’t already, setup the Raspberry Pi to automatically boot into the GUI desktop.

Disable the screensaver by editing the GUI session autostart.

sudo nano ~/.config/lxsession/LXDE-pi/autostart

Make sure the following is in the autostart file:

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

GPIO, LEDs, and Buttons

Basic GPIO circuit
Basic GPIO circuit

One of the cool things about the Raspberry Pi is you can wire your own inputs and outputs. This is all done through the GPIO. I first worked out the circuit using a solderless breadboard. You can see the wiring diagram below. Then I got my wire cutters, soldering iron, and heat shrink tubing out. I used the gpio cables to connect to the button.

Taking Photos

Raspberry Pi Camera Module and laser etched front face plate
Raspberry Pi Camera Module and laser etched front face plate from version 1 of the photo booth

First, with the system turned off, plug-in the camera. Then boot it back up. You’ll need to follow the initial setup instructions.

I decided to use PiCamera to control the camera with Python. Install PiCamera.

Creating the Animated Gif

I first tried ImageMagick, but had some issues with the jpg delegate. I then used GraphicsMagick instead. It works great. Read the installation instruction here for Unix. But the following should work.

sudo apt-get install graphicsmagick

Once GraphicsMagick is installed, you can test it with the following code. It will combine all the jpgs in the current directory.

gm convert -delay 100 *.jpg joined.gif

Uploading to Tumblr

I used pytumblr and the tumblr API to get the photos from the pi to the internet.

To install pytumblr, follow these steps:

  1. If it is not installed on the pi, install PIP somewhere on your pi
  2. In the terminal, navigate to the pip folder you downloaded and moved to the pi. Then run the following code:
    sudo python get-pip.py
  3. Download pytumblr and copy the files somewhere on your pi. For instance, in the command line, you could navigate to your chosen file and then type:
    wget "https://github.com/tumblr/pytumblr/archive/master.zip"
  4. In the terminal, navigate to pytumblr-master folder (you un-zipped the downloaded file, right?) and run this command to install:
    sudo python setup.py install

The Final Code

Photo booth code
Download the photo booth code here

You can download the code at GitHub. If you have not used GitHub before, check out this link. There are a few values for variables that you will need to replace with your special information. Save the code wherever you want. I put it in the folder named /home/pi/photobooth/. If you are not comfortable using the command line, learn more here.

After getting the photobooth code on your Raspberry Pi, set it to automatically run the python code at startup.

sudo nano /etc/xdg/autostart/myscript.desktop

And save something like the following:

[Desktop Entry]
Comment=Start my script
Exec=sudo python /home/pi/photobooth/drumminhands_photobooth.py
Name[en_US]= drumminhands_photobooth.py

I found I need sudo at the beginning, otherwise the GPIO buttons and lights don’t work.


Photo booth enclosure, version 1
Photo booth enclosure
Case for Version 3 Photo Booth
Case for Version 3 Photo Booth

In the first versions, I built my own case out of wood. They were a little rough as I’m still working on my carpentry skills. I did laser cut the front and back plates.

In the latest version, I decided to re-use some existing items to make a cooler looking case. I found a small brief case at an antique shop. It was originally used for holding silverware. Then I also re-purposed an old camera I had. I took off the front plate and the lens. I used an existing hole in the front plate for the new LED arcade button.

If you design your own cover, you’ll need the dimensions of the camera, Raspberry Pi mount, the Ethernet mount, and the USB mount. Check the github site for my front and back templates.

Lessons Learned

  • It works best with internet access. When the users can instantly use their phone to share photos from Tumblr, it’s an overall better user experience.
  • Use wired access if possible. Wireless is sometimes flaky. And using a mobile hotspot is even more sketchy. Without a good internet connection, the experience is a little bit of a drag.
  • There is an option to not upload during the event. The replay of pics on the photo booth does give the immediate gratification to the users who just had their photos taken. But it does not show the rest of the guests,  nor friends not at the event. I did recently build another tutorial to have a second raspberry pi showing a slideshow of photos. That’s a good second if you don’t have internet access. And I also built a batch upload script if you want to put photos on Tumblr after the event.
  • Use LOTS of light. I mean LOTS. Set yourself up for success. Also, look into upping the ISO on the camera if you know light will be poor. At the last event I used this at, some of the photos were taken just before sunset. The ambient light combined with overhead shop lights made much sharper images. At night, with only the shop lights, there were still lots of blurry photos.
  • Consider the height of your audience. For many adult audiences, this works quite well on a strong tripod. But kids and other shorter individuals have a tough time getting their faces into the frame without a step, bench, or ramp. At the last event, I tried using a loveseat and lowering the camera. It worked fairly well, but when people were seated, they could not reach the button. If they stand, then they can step backward after hitting the button before the first shot.
  • I might look into using a version of Linux that boots up faster. If the pi looses power during the event, you need to explain what is happening during the reboot.
  • I might build a better power circuit so that there is only one power adapter.


See my final pics here: drumminhands.tumblr.com. If you build one, post your link in the comments below. If you have any questions about this, also post in the comments below. Have fun with it.

And if you make one similar, please send me photos or post them in the comments below. I’d love to see other iterations in use.


See what other folks have done:


Some folks have been talking about this project. Here are a few. If you have a post about the project, please let me know and I’ll add it here.


Join the discussion and tell us your opinion.

July 11, 2014 at 12:14 pm

It looks like I had a bug where no one could post comments. Ooops. I’ve fixed that, so go ahead an post comments below. A few folks emailed me, so I’ll add the details of their comments below.

July 11, 2014 at 12:16 pm

One person was playing with a different sized monitor and had some issues getting the preview to match the final output file.

I too has this issue. I found that I had an older version of raspian installed and there was a fix to the camera divers waiting for me to update.

Try this: http://www.raspberrypi.org/documentation/raspbian/updating.md

sudo apt-get update
sudo apt-get upgrade

July 11, 2014 at 12:17 pm

Another person asked if this only works in black and white photography.

I chose to do black and white. There is a line in the python code that states “camera.saturation = -100”. Comment this out or delete it and you should be good to go.

July 11, 2014 at 12:31 pm

Another person asked why I didn’t light up the big red button.

Originally, I planned on doing just that. I thought the light would turn on when the button was ready to be pushed, turn off when pushed, process the images, and then turn back on.

The problem is that the button actually has two circuits: one for the input and one for the light. The light uses 12 volts, much more than the Raspberry Pi produces. There is probably a way to build the circuit so that the GPIO pins can somehow control flow in the 12v circuit to light the button. But that is over my head right now. If anyone knows how to do this, please comment below.

For now, I just left the button off. Anyway, even with 12v, it never quite fills the button nicely unless you are in a dark room.

July 29, 2014 at 8:17 am
– In reply to: drumminhands


For mine I just swapped the 12v led for a 5v version in the link above and powered it from the pi.
Worked a treat

July 30, 2014 at 9:15 am
– In reply to: CongoJoe

Great call.

August 6, 2014 at 5:48 pm
– In reply to: CongoJoe

Amazing! Thanks – and that site will sell the buttons with the 5V LED just swapped straight in 🙂


Just got 2

September 10, 2014 at 9:17 am
– In reply to: CongoJoe

Did you use different resistors for those 5V LEDs?
I bought one of their buttons with a 5V LED, but can’t find any info on them besides the 5V part. I think I need to know the mA rating of the LED in order to pick the right resistor.
See http://led.linear1.org/myth-of-the-5-volt-led/
Any ideas?

September 18, 2014 at 3:37 am
– In reply to: CongoJoe

Hi Mike,
The one i used had an integrated resistor so i just ran it from the pi’s 5v.

It was from a button i had knocking around in a project box but i assume the one linked will be the same.

Ian Watsonreply
October 2, 2015 at 6:23 pm
– In reply to: drumminhands

You have a couple of options to light the button:

1) Just run it directly off 3.3V or 5V. Running an LED at a lower voltage than requested does not harm it. It’ll just be dimmer. There’s no need to add a resistor to that circuit either; one is built in to button.

2) Switch out the built-in resistor and run it off 3.3V. If you look down on the LED you can see the resistor below it. Switch it out with a lower resistor.

3) Use GPIO to control a relay for a 12V circuit.

July 12, 2014 at 9:00 am

See @jspotproduction’s iteration using a cnc machine. It looks beautiful.


July 15, 2014 at 12:21 pm

If you set one of the GPIO pins as an output of 5v you can power a 5v relay to close a 12v contact. This would temporarily enable the button to light when the pin is high.

July 16, 2014 at 4:51 pm
– In reply to: Sean

Thanks a lot. I’ll have to try that sometime.

July 16, 2014 at 2:25 pm


I’m the guy playing with the different size monitor..
I tried doing the update and upgrade commands. Nothing happend.

Then I tried tweaking with the resolusions (camera) and found out that the problem arises when the camera resolution exceeds the screen resolution. Then the preview is full-screen(ish) but the preview only shows the center part of the picture.

I am certainly no hero with python nor Raspberry Pi as I’m new to this world.

Does anyone knows how to fix this?

I would really appreciate all help because I need this to work in September when my brother is getting married.

I hope to hear from you soon!

Kind Regards,


July 16, 2014 at 4:52 pm
– In reply to: Robbert

How about backing down the resolution of the output monitor. Say if you currently have it set at 1024×768, try using 800×600.

August 18, 2014 at 8:20 am
– In reply to: drumminhands

I have consulted a friend of mine, who was able to fix the screen resolution, without compromising on the camera resolution.

The photobooth is nearing completion. When it is done I will e-mail you my code and some pics/vids.

Greetings and thanks for this amazing tutorial!


May 30, 2015 at 12:02 am
– In reply to: Robbert

I’ve been stumped by this very problem for the past few days. I tried Drumminhands’ fix posted above (updating) and it didn’t work. Would you mind posting the code that fixed this for you?

July 27, 2015 at 7:41 pm
– In reply to: Collin

For anybody that runs into this same problem re: not matching resolutions during preview, the following code fixed the problem for me:

camera.resolution = (1944, 2592)
camera.framerate = (15)

Not my code. Source: https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=75899

Full camera module resolution and a preview that works.

July 16, 2014 at 9:40 pm

Have you had a problem with the pi locking up after a couple of photos? I’m dealing with that right now and have no idea why.

July 16, 2014 at 11:55 pm
– In reply to: RH

Only once, when the internet connection was lost. The python app quit, but I didn’t build in much error detection. I tried to fix that one by checking to see if there was a connection before uploading.

When in the process does it freeze?

July 17, 2014 at 11:11 pm
– In reply to: drumminhands

I’ll press the button the first time and it’ll take pics and upload them no problem. Sometimes I can do it 2-3 more times and it’ll take the pics and upload them. But sometimes, it’ll take the pictures, say its all done, and itll be frozen. I won’t be able to use the mouse or keyboard. All the GPIO buttons will stop working, except strangely enough, the big button will continue working.
I can press it while everything else is frozen and it’ll go through the process of taking photos and the script will say it is finished and uploaded like nothing is wrong, but no picture is uploaded. The jpgs and gifs are created too when it is in this “frozen” state.

July 18, 2014 at 7:59 am
– In reply to: RH

It sounds like most of it is running, but the uploading is inconsistent. Try exiting python (with one of the other button pushes in the circuit). Then launch a terminal window and use that to run the script. You should be able to see messages display as it walks through the code. See if you get an error message. Add your own messages in the code to help narrow down the exact spot that is having trouble. Once you isolate that, post it here and see if you can research it.

You could also try resetting your tumblr secret email address. You’ll get a new address and need to update the code accordingly.

July 21, 2014 at 1:42 pm
– In reply to: drumminhands

I’ve been trying to narrow down the problem. It seems like everything works fine separately, but when thrown together it breaks. The connection test seems to be at least part of the problem. It gives me the error “Temporary failure in name resolution.” However, if I run is_connected at the start of the script, it works fine. It breaks when it runs after picamera starts taking pictures for some unknown reason. So it might be some issue with picamera. I’m gonna more fully investigate the issue.

July 21, 2014 at 2:06 pm
– In reply to: RH

Keep me posted. If you find it’s the camera or the script, I’ll update the tutorial and code as needed. Good luck.

July 21, 2014 at 8:27 pm
– In reply to: drumminhands

Sigh, so I think I figured out the problem…and it was something stupid (of course). I had a wireless usb keyboard hooked into the pi, and I think it was drawing too much power. As soon as I moved it to a powered usb hub, the problem was fixed.

July 21, 2014 at 10:40 pm
– In reply to: RH

Glad that you figured it out.

Julian Engelreply
July 28, 2014 at 4:56 pm

Hey. I tried to contact you via E-Mail but it didn’t quiet work out. Thanks for the idea. It was great. I tried your code, but that unfortunately didn’t work and set my pi on fire… no idea how…. Anyway. i rewrote the code and used new lines for the buttons. No falling edge… and the gip… Now it works fine. Thanks for the idea!

July 28, 2014 at 5:30 pm
– In reply to: Julian Engel

FIRE. That’s scary. I’d be curious to see your changes to the code. Did you change the circuit at all?

And your comment made me think of this: https://www.youtube.com/watch?v=1EBfxjSFAxQ

Julian Engel
July 30, 2014 at 6:42 am
– In reply to: drumminhands

I can forward you the code after the wedding where the Photo Booth will be working. Yes. I did change the circuit. When I will take the Photo Booth home, I can send you some pictures. And yes, the code was changed in that way, that the leds didn’t work and the buttons. But thanks anyways.

Ryan Barnesreply
July 29, 2014 at 12:24 am

Great tutorial! You’ve done an amazing job at providing so much information, and the end result is a work of genius! I do have a couple of questions though, just due to this being my first project involving GPIOs with the Pi’s and I’m wanting to get this together for our church’s inauguration party on Friday. If you can help with these, I’d really appreciate it!
1) I bought the Big Button as well (blue though – I love blue!) but don’t see how you have the LED wired. Is the wiring for the button press the same a for the light? If not, how to you have the light wired?
2) Looking at the diagram (again, because I’m new to this), it appears that 11, 15, 18, 21, 24, 27, and 29 aren’t terminated. However, they’re all black, so can I assume that means they’re connected to the GND?
3) With your code, can you specify which button (orange on 13 and white on 31) does which function?
Thank you for making your design available and for all your work in helping others be able to replicate it. I apologize if my questions are too noob, but I really look forward to finishing the project!

July 30, 2014 at 9:25 am
– In reply to: Ryan Barnes

Item 1, see the pics on Flickr. You only need two wired to the pi. The other two are a different circuit using 12v to light the LED.

Item 2, yes, they go to ground.

Item 3, Pin 18 is shutdown and 16 is exit python. But you can change as needed in the code. See lines 30 and 31.

July 29, 2014 at 7:19 am


thanks for this inspirational article. I am now building a photobooth for a marriage in october. Only thing i am changing is that i want to print the pictures directly after they have been taken.

But i have one question: If i want to light up the massive button’s led, how am i supposed to do so? Is there anything i can use to get the 12V output? I am a software engineer, so i’m not really into electronics 🙁


July 30, 2014 at 9:18 am
– In reply to: Florian

See some comments above. You could supply 12V in the circuit with the monitor, just keep it separate from the pi. You could control the light turning on and off with a relay. Or you could replace the button LED with a 5V led and supply from the pi. All will work.

July 31, 2014 at 7:13 am
– In reply to: drumminhands

Thanks for the answer. And what relay do i need? As i said, i am no electrician 🙁

August 1, 2014 at 4:53 pm
– In reply to: Florian

That too is over my head. I would ask a local person at a hackerspace near you. Unless someone else can post on this blog, please.

Jenny Levinereply
July 29, 2014 at 10:23 pm

Thanks so much for sharing such detailed instructions! I’m a total newbie at something like this, but I want to try to make this photo booth for my wedding.

Because I don’t have any experience beyond hacking existing stuff, I’m just going with your design and materials, so I have a couple of questions.

1. The link to the Mouser site for the DC power jack doesn’t work anymore, and it looks like the site is gone. Any chance you have a link to the item elsewhere? I want to make sure I get the right piece.

2. Do you have the dimensions of the enclosure you built? I downloaded the faceplate designs and even ordered them from Pokono, but I want to make sure I get the right size wood and the correct materials to put it together.

Thanks again!

July 30, 2014 at 9:15 am
– In reply to: Jenny Levine

The mouser link is working for me just fine. Basically when you get your power supply, just get a matching socket. You can change the tips of the Radio Shack power supply as needed. Radio Shack may even have a socket for you that you can test in the store. Or a different local electronics store. I’d just go in and ask. It’s good to make friends at your local store.

For the enclosure, its really up to you. I chose my face plate to be 13″ x 14″. Then I used 0.5″ thick boards on the outside. The result is a box 14″ x 15″ x 5.5″. It could be a thinner box, except for the big button on top. Good luck. Have fun. Post photos and I’ll link to them.

Antti Roosreply
July 30, 2014 at 7:35 am


Setting the Pi on fire got my attention too. I also am curious about the changes made to the source code.

I just received all the necessary parts plus some extra goodies to build my version of the photobooth. Thanks for this great resource!

August 1, 2014 at 2:46 pm

After lots of googling into how I can make myself a photobooth, I stumbled across your amazing guide. I hope you dont mind answering a quick questions before I get stuck in to create my very own for our wedding next year (hopefully I don’t set fire to the RPi !).

I’ve already purchased an RPi B+ and the camera module (mainly because I know I will want to have a play either way). Apologies in advance for my limited knowledge of what the RPi can do (just getting started). I understand the fundamentals of coding (develop a few websites with wordpress and a bunch of plugins / basic script edits).

Is it going to be rocket science for me to modify your project to be able to work like this:

– a group hits the button
– the screen activates, showing a preview of what its going to shoot
– a delay allows them to move into the field of view
– a timer light sequence gets going
– it takes the shot
– displays it on the screen
– then saves it on a USB stick attached to the Pi (instead of uploading to tumblr as there wont be any possibility of a internet connection where its going to be).

August 1, 2014 at 4:57 pm
– In reply to: LaithMarmash

Most of what you want to do should be pretty easy. You’ll just be tweaking my python code. The kicker is the USB drive. Drives don’t mount into linux as easy as they do in Windows or OSX. You’ll need to fiddle with some prompts or buttons to make things happen. It’s do able, but a little tricky. I’d do some googling for some code others have made. As an alternative, you could prompt the users to enter their email address and send it to them via email. You’ll need a keyboard or touch screen keyboard to make that happen. Good luck. Have fun tinkering.

August 2, 2014 at 6:54 am
– In reply to: drumminhands

Thanks! I’ll have to look for the code to be able to save to a USB stick (or the sd card, depending on how big the images will be) as there is no internet where this will be headed. If I do manage to figure out how to do it I’ll be sure to post a link to the code I used here to help you/your visitors out.

August 6, 2014 at 5:20 am

Hi again,

i have a small problem with the camera taking the photos.
i didn’t changed your code there, but the camera takes a picture when the preview starts, so there are 5 pictures for each time the button is pushed.

And later, when generating the gif, the program is using this preview picture as one of the 4 pictures. so the last picture is not used in the gif.

Anybody out here who can help me with that?


August 6, 2014 at 11:16 am
– In reply to: Florian

That’s a curious one. I would try to isolate the problem. Try using my cameratext.py code to see what it does with just one photo. Try the GPIO test to see what the buttons are doing. Maybe there is a bounce triggered in the button? If you can narrow what the code is doing, and the problem is still evident, then you can focus your attention there.

August 6, 2014 at 6:08 pm

Amazing! Thank you – I’ve had a great time following your instructions, making do without buttons and a soldering iron – I’ll be using this at my own wedding (along with a few others above I see) in Sept and the photos will be here: zimchaa.tumblr.com – thanks again.

I think I will be tweaking the code to have two big buttons: 1 to take a big colour photo and the other for b&w gif frivolity – and share the code on github.


ps. – now I’ve found some buttons that come with 5V LEDs built in I’ll be attempting to light those up too – thanks to congojoe

August 18, 2014 at 9:27 am

I’m noticing a problem where Tumblr is only showing some of the images. I can’t find the pattern yet, but I’m working on it.

Has anyone made a queue system on a different thread in the raspberry pi? It might be nice to switch over to using the official Tumblr API, but we’ll need to add items to a queue to upload so that another user can hit the button and not have to wait.

August 18, 2014 at 9:03 pm
– In reply to: drumminhands

I’ve seen that too. I’ve tested with just sending the GIFs to my gmail and they are reliable. Are the GIF names all supposed to be “noname,gif”? I may be that Tumblr detects the same name incoming and flags it as spam or a duplicate posting? Just speculation. Thanks for the code and build!

August 18, 2014 at 9:06 pm
– In reply to: Geoff

Ah, nice find. I noticed the noname part, but can’t find out what is making it happen. Right now I’m working on learning about the MIME objects. I bet we have something in the email creation that is wrong.

August 18, 2014 at 9:31 pm
– In reply to: Geoff

Got it. I had a typo in line 181 of the python code. The email sent an unnamed attachment. Tumblr wants unique filenames for each email attachment. Seems to be working fine for me. Let me know if anyone else sees any issues.

August 23, 2014 at 10:15 pm

Thanks so much for posting this. I made a decidedly less attractive version for a maker event today at the library where I work. I could never get the LEDs to work, but I will keep at it. Our teen librarian wants a permanent photobooth build for her events, so I plan to move beyond the breadboard and make a permanent board. I would also like to add the ability for patrons to add their email address so the photo can be sent to them immediately.

Brett Thorsonreply
October 3, 2014 at 8:30 pm

I think there is an error on your schematic. The green pin coming off the top middle of the pi is labeled as 32 (I’m assuming pin 32). Probably should be something else like 25.

October 3, 2014 at 11:36 pm
– In reply to: Brett Thorson

That’s just a ground wire. The schematic needed to be split like that so it would be readable. Take a look at the other diagram to see all of the ground wires plug into one gpio pin.

Dave Horsteinreply
October 4, 2014 at 6:40 pm


I’m creating a photo booth for my wedding using your instructions. Everything is coming together very well, except my cycling of the LEDs. I’ve got 3 LEDs (with labels for “Get Ready,” “Pose,” and “Smile”) that are supposed to cycle for each image taken. Right now, they cycle, but the image is being taken just before the “Get Ready” LED lights rather than when the “Smile” light goes on.

My current code is here: http://pastebin.com/WhYxCATf

Any idea of what I’d have to do to my script to have the photo taken when the third LED lights up and then have it cycle through again?

Thank you!

October 21, 2014 at 3:28 pm

I didn’t see any mention of printing the pictures directly. Is this something that is supported? I am looking to print to the Epson PM-200 series of photo printers to provide that instant gratification.

October 21, 2014 at 3:32 pm
– In reply to: Sam

Currently it is setup to be paperless–animated gif only. You could probably set it up to print, but you’ll need to modify the code and find the right printer drivers.

November 9, 2014 at 11:26 pm

You did a great job documenting the project. Well done. Thank you. I got up and running pretty quick with your documentation and code.

One problem I had was with false falling edge detection which caused the program to repeat the start_photoboth() function without the button being pressed. I’m guessing it’s caused by EMI.

My solution for this:
1) Removed the pull up setting from GPIO.setup (line 65) and replaced it with a physical pull down resistor.
2) Changed the loop (line 259) to:
while True:
if (GPIO.input(button1_pin)):

Not sure if that’s the best solution but it worked for me. Thanks again!

November 10, 2014 at 9:10 am
– In reply to: Rockey

Ooooh. Thanks. I’ll try that out too.

January 2, 2015 at 1:01 am
– In reply to: Rockey

I am having the exact same issue as you. I tried what you suggest but now my program doesn’t even wait for the first button press.
Here’s my line 65: GPIO.setup(button1_pin,GPIO.IN)
Here’s the physical pull down resister I built: http://www.bit-101.com/blog/wp-content/uploads/2013/05/circuit_5.png
Here’s my lines for 259:
while True:
if(GPIO.input(button1_pin) ==1):
print “Waiting for button press…”
# GPIO.wait_for_edge(button1_pin, GPIO.FALLING)
time.sleep(.2) #debounce
print “Button pressed, moving to start program”

January 31, 2015 at 11:06 pm
– In reply to: Rockey

In order to fix the issue with it continually taking pictures add a 10K pull-up resistor from 3.3V to pin#22. See article below. if the other buttons are giving you problems same applies there.


Then change line under “Other config” section from
GPIO.setup(button1_pin, GPIO.in, pull_up_down=GPIO.PUD_UP)

GPIO.setup(button1_pin, GPIO.IN)

Then change at the very bottom of the code to read as follows…

while True:
if (GPIO.input(button1_pin) == False):
time.sleep(0.2) #debounce

This seems to work like a charm. Allows for a much more robust debounce circuit as we actually added a pull-up resistor. Hope this helps some folks out!!

January 31, 2015 at 11:09 pm
– In reply to: lemonlimepi

Also Remember to indent the two lines after the if statement. For some reason my post did not show the indents!!

March 11, 2015 at 9:05 am
– In reply to: lemonlimepi

Great stuff. I’ll play with this soon and maybe update my code.

Lee Miklesreply
November 15, 2014 at 5:29 pm

Great code! I am trying to have it add a watermark when it takes the picture, but I can’t seem to get the filename variable to pass over. Here is what I tried:
for i, filename in enumerate(camera.capture_continuous(file_path +
now + ‘-‘ + ‘{counter:02d}.jpg’)):
GPIO.output(led2_pin,True) #turn on the LED
watermark = “gm composite /home/pi/photobooth/watermark.png
filename filename”

But it errors saying that it can’t find the file named ‘filename’. Any ideas?

December 31, 2014 at 12:50 am

Hi…awesome project. Actually i’m just a beginner and would like to know if I can store my photos on dropbox instead of posting on tumblr

January 5, 2015 at 3:06 pm

great project! i now have most of the parts to build a similar photobooth. where did you find the screw mount to connect it to a tripod?

March 11, 2015 at 9:03 am
– In reply to: nick

The threaded insert was at Home Depot.

January 6, 2015 at 9:15 am

Great project, I’m using it to create a photo booth with Piface CAD and maybe different photo effects
You could remove the files when they’ve been successfully uploading to tumblr.

January 29, 2015 at 11:40 am

HI, as a total noob, I can assure that your instructions rock!!! So far, I followed them step by step, once I get it all together, there are few things I’d like to add/change.
Thanks for doing this. I added your tumblr to the description of mine, should I add any other link to it?

March 11, 2015 at 9:04 am
– In reply to: Carla

That’s entirely up to you. Thanks for any link you provide.

Ryan Barnesreply
March 25, 2015 at 8:55 pm

Alright – I finally got it up and going (-ish)! Thanks for the tutorial!
Have you tried using other services such as Twitter or Instagram?
I’m trying to figure out in your code how to modify it, but I’m drawing a blank and thought I’d ask you 🙂

March 29, 2015 at 10:53 am
– In reply to: Ryan Barnes

I have not tried a different photo service myself. But if you look in Github, under the forks, karnold has a version working with Flickr.

May 22, 2015 at 5:13 pm
– In reply to: drumminhands

I just happened to make a Flickr version. See the code here: https://github.com/drumminhands/drumminhands_piFlickr

Rudolf Pietersma
July 2, 2015 at 9:52 am
– In reply to: drumminhands

Are you working on a Instagram version or Twitter/Facebook?

July 2, 2015 at 10:00 am
– In reply to: Rudolf Pietersma

Sorry, not right now. I do have a Flickr version. Really, anything that has an API or accepts email to post item would work. Feel free to adapt. If you get it working, I’ll share the code.

Mark Heinis
January 20, 2016 at 3:43 am
– In reply to: drumminhands

You could use IFTTT to copy posts from Tumblr also to Twitter, Flicks or Facebook 🙂

April 5, 2015 at 1:23 pm

Thank you for your efforts in putting the code and this tutorial together! I’ve learned a great deal getting this setup for myself. My only issue is the two smaller buttons (to shut down, and the other to exit python). They will simply not work for me. I have even tried to close the circuit manually (to factor out any problems with my soldering skills), but the program stays running and the pi never shuts down (just continues to show the ‘Press the button take a photo’ graphic.) The program works, but just cant use these two button functions, it seems. Is there something I missed in your code that enables these two buttons to work?

April 6, 2015 at 7:13 pm
– In reply to: mrjmwalker

Quick update: I re wired everything again. Same problem, except, I noticed that upon boot and load of your program, the ‘shut down’ and ‘quit python’ buttons work perfectly, BUT they will NOT work when pressed AFTER i successfully take/view/upload photos successfully. I can take as many photos as I want, but can then never shutdown or exit python. I’m rather stumped. Is there a way to exit python from the keyboard? Just wondering if I’ll always have to just pull the power out to shut it down. But many thanks again, killer project, looking forward to the fun either way!

Marcus Porter
June 4, 2015 at 3:23 pm
– In reply to: mrjmwalker

I had the exact same problem with my current work in progress. I never figured out why, but I fixed it by having it unset and reset the interrupts on the button pins at the end of each loop.

June 20, 2015 at 2:30 pm
– In reply to: mrjmwalker

I’m having the same problem myself.

Marcus, how did you go about unsetting and resetting the interrupts on the button pins at the end of each loop?

July 27, 2015 at 7:37 pm
– In reply to: mrjmwalker

Me too! Exact same problem as Marcus Porter and Lauren. Would really love to see the code for the fix you mentioned, Marcus.

Bruno Santosreply
May 26, 2015 at 11:34 am

Hi !Thank you for sharing your project. Just one question that i couldn’t find any info on that…

Are you running the graphical display to show the preview of the image or only command line ?

Cheers and thank you again !

May 26, 2015 at 12:13 pm
– In reply to: Bruno Santos

Great question. I’m using pygame via the python code. The code is run automatically when the pi starts up. See the section in my tutorial about editing the /etc/rc.local file. However, the desktop is logged in via the GUI. Check out the tutorials for pygame to get started. Tweak as you need. I always planned to add some sort of footer at the bottom of the images with the event date/info. But I have not implemented that yet.

Marcus Porter
June 4, 2015 at 3:30 pm
– In reply to: drumminhands

My version is running without X (the gui) and pygame displays the images just fine. The previews from the camera image also show up without X.

This saves a little overhead (256mb pi!) and I don’t have to worry about setting the background screen for a gui that will never be used.

May 26, 2015 at 4:35 pm


you did a great job! Thanks a lot.
I have strange error since a few days. The booth was running smoothly but since some days the upload stucks. I’ve figured out the line

client.create_photo(config.tumblr_blog, state="published", tags=["drumminhandsPhotoBooth"], data=file_to_upload)

to be the one which doesn’t work any longer, have you an idea, what to do?

May 26, 2015 at 4:47 pm
– In reply to: Can

Hmm. I have not seen that before. It’s possible that Tumblr changed their api a bit. I can look into it in the next few weeks. If you find it before I do, please let me know what you find out.

May 27, 2015 at 12:03 pm

Would you have any recommendation or guidance on how to switch the output from a 2×2 photo, to a 1×4 strip twice?

I’m looking to do something like this (just grabbed off google images)


I’ve actually got everything up and running, now comes the fine tuning! Also, thanks a ton for your guide, I absolutely couldn’t have gotten this far without you. I’ll send over pictures when I’ve got it in a spot that I’m proud of.

Instead of creating a box, I put the whole thing into a suitcase with the monitor and camera mounted on the outside. The whole thing mounts onto a tripod, or can sit on a table!

May 27, 2015 at 12:12 pm
– In reply to: Nick

Nice trick with the suitcase. It bet it looks sweet. Please send me pics or links. I’ll add it to the post above.

Per the image manipulation, I would do all of that with Graphics Magic. Take a look at their tutorials. You should be able to adjust placement of images as it combines into one. If you get something working, I’d love to see the code.

May 27, 2015 at 12:43 pm
– In reply to: drumminhands

I’m still working my way through the code, and frankly I’m amazed I’ve made it this far. Apologies for the not that great photos.

View post on imgur.com

June 20, 2015 at 10:06 am

How about building one of these in so that it always connects to the same wifi network, and you can then use the Hootoo to connect to a local ethernet or wifi network. Would take away the need to reconfigure the network on the Pi overtime you take it somewhere. The Hootoo can be configured via a pad or smartphone. The Hootoo could be powered via the USB port on the Pi.


June 23, 2015 at 6:08 pm

This is great! The only thing that doesn’t work for me are the two smaller buttons that are supposed to shut down or exit the program. They just aren’t working and I have to pull the plug every time. Any thoughts?


Stuart Cookreply
July 3, 2015 at 2:27 am


Firstly, massive thank for the great tutorial. I’ve never used python before and this was a great project to get me started. I’ve got it working beautifully, but I’m trying to make a few alterations and getting stuck.

I want to take the photos at a higher resolution and then scale/resize using gm convert -geometry before creating the gif from the resized pics. I’ve altered the resolution no problem, and sorted the preview to match, but I can’t get the resize to work properly.

My step 3 looks like this currently:

print ("Creating an animated gif")
if post_online:
show_image(real_path + "/uploading.png")
show_image(real_path + "/processing.png")

GPIO.output(led3_pin,True) #turn on the LED
"gm convert -geometry 500x300" + "/home/pi/photobooth/pics" + now + "-01" + ".jpg " + config.file_path + now + "-01" + ".png"
"gm convert -geometry 500x300" + "/home/pi/photobooth/pics" + now + "-02" + ".jpg " + config.file_path + now + "-02" + ".png"
"gm convert -geometry 500x300" + "/home/pi/photobooth/pics" + now + "-03" + ".jpg " + config.file_path + now + "-03" + ".png"
"gm convert -geometry 500x300" + "/home/pi/photobooth/pics" + now + "-04" + ".jpg " + config.file_path + now + "-04" + ".png"
print ("Converting to .png")
graphicsmagick = "gm convert -delay " + str(gif_delay) + " " + config.file_path + now + "*.png " + config.file_path + now + ".gif"
os.system(graphicsmagick) #make the .gif

But I’m not getting any .png files for GM to then use to create the gif. Have I missed something fundamental?

Thanks in advance if you can help! Stu

John Galbraithreply
July 6, 2015 at 1:32 pm

So I love the setup, I did some modifications of my own for design, but one issue with the code that I just can’t seem to work consistently are the shutdown buttons. The big button works like a charm every time, but I have had very intermittent results with the other two buttons. Do you have any suggestions that might help resolve this problem? Do the switches all need to be on the same ground? Is the bounce rate maybe the problem? I’ve tried two different type of buttons, one that came with my pi in a kit and another that I bought from another seller. Both buttons test as working with an electrical tester, when you press the button, the line becomes continuous and when you release it goes back to closed. Am I missing something simple here?

July 6, 2015 at 1:42 pm
– In reply to: John Galbraith

Other folks have mentioned issues with the other two buttons. I have to admit, that I have not had the photo booth up and running for a while and have not checked it out. Early in the process, one person changed the buttons from pull_down to pull_up. Maybe try using the internal resistors instead of wiring your own. I suggest trying that and let us know what happens.

August 11, 2015 at 8:11 am
– In reply to: John Galbraith


Do you have resolve your problems ?. I have similar case (the 2 switchs don’t act when I press them).

I try to reset Gpio, change UP to DOWN state but unsuccessfull…

Best Regards.

Christian Unserreply
July 18, 2015 at 7:54 pm

Hey there – I just wanted to thank you for this AMAZING tutorial. I got it up and running without a lot of effort and your instructions were fantastic.

I wrote up a blog post about my photo booth on my website: http://techytenor.com/diy-photobooth/

And you can see the pics it’s taking here: twincitieslive.tumblr.com

Anyway, thanks again – it was much appreciated!

July 28, 2015 at 3:21 pm

I love your code, I am almost done making a booth of my own. Have you noticed (or might you know why) after playback of the snapped images the full screen pygame drops out for about half a second, showing the desktop, before the “Press the button” image is displayed again? This occurs on both the Model B+ and the new RPi 2 model. Is there a way to prevent this glitch? Thanks!!

August 2, 2015 at 8:40 am

I got something working using Webiopi after some tinkering to make it work with Pi2. I dont have suitable wires at home right now. The system display instructions.png and then takes a photo. But shortly after it returns to the desktop. I’m able to restart the program but something is not right here..
I had troubles with the Tublr thingy so I commented that part out. Other than that most of the stuff is left alone.

August 2, 2015 at 8:51 am
– In reply to: Mikal

Oh, here is the error from Terminal via SSH:

Get Ready
Taking pics
Traceback (most recent call last):
File “drumminhands_photobooth.py”, line 284, in
File “drumminhands_photobooth.py”, line 192, in start_photobooth
for i, filename in enumerate(camera.capture_continuous(config.file_path + now + ‘-‘ + ‘{counter:02d}.jpg’)):
File “/usr/lib/python2.7/dist-packages/picamera/camera.py”, line 1842, in capture_continuous
File “/usr/lib/python2.7/dist-packages/picamera/encoders.py”, line 1543, in start
super(PiCookedOneImageEncoder, self).start(output)
File “/usr/lib/python2.7/dist-packages/picamera/encoders.py”, line 819, in start
File “/usr/lib/python2.7/dist-packages/picamera/encoders.py”, line 774, in _open_output
output = io.open(output, ‘wb’, buffering=65536)
IOError: [Errno 2] No such file or directory: ‘/home/pi/photobooth/pics/2015-08-02-12:50:12-01.jpg’
Ended abruptly

August 2, 2015 at 9:00 am

I’m such an idiot! I forgot to make the initial folder 🙂

Rudolf Pietersmareply
August 6, 2015 at 3:44 am

Is it very difficult to change the code to use gphoto2 instead of the raspberry pi camera?

August 6, 2015 at 6:35 pm

So everything is working fine on the breadboard I think. But I’m having problems with posting to Tumblr.

How should the lines:

# Setup the tumblr OAuth Client
client = pytumblr.TumblrRestClient(

Look? Or is everything in the “config.py” file?

August 10, 2015 at 8:21 am

First of all thanks for this great tutorial. I already used my photobooth at a children’s party. I have not copied your code entirely but used it as an inspiration instead 🙂
However, i’ve been trying to get pygame running to show some images (instructions, intro,etc.). Somehow it does not work for me. When I call show_image(image), the application just stucks and I need to hard-reset my raspberry.. Also tried to implement the SIGALRM hack, but just getting error:

2015-08-10 13:39:13,602 ERROR signal(SIGALRM, alarm_handler)
2015-08-10 13:39:13,605 ERROR TypeError: ‘module’ object is not callable

Thanks in advance…

Brett Nemeroffreply
September 16, 2015 at 3:11 pm

I’m looking to build something like this for my kiddo’s elementary school library. Is there anyone that can prefab an enclosure for something like this? I sadly don’t have those skills 🙂

Great article! I look forward to trying it out.


September 29, 2015 at 9:14 am

Is there a way to add a flash module?

April 23, 2016 at 6:58 pm
– In reply to: Graeme

A bit late but did you figure out the flash module as I’m trying to do the same.


October 21, 2015 at 12:35 pm

Cool tutorial. I am trying to modify the code to include a countdown that overlays on the preview. I think it would help people know when to hold their pose. Not working 100% if anyone is interested in the code (perhaps you are smart enough to get it working) let me know. I would like to see this function added to project code once it actually works.

February 28, 2016 at 9:48 am
– In reply to: Jeff

Hi Jeff

Care to share the overlay code? This sounds awesome!!


November 13, 2015 at 2:46 am

Just came here to say – this project has helped me so much! I’ve built a photobooth based off this code for a friend’s wedding I’m going to today, and it’s working really nicely.

I’m using a Pi2, so I could get away with a bigger image size. What I’ve just done though, is to append ” &” to the cmd to run graphicsmagick, making it run in the background. I start it before displaying the images, then after the images display I put a 10 second processing delay to let grapics magick have a chance to finish, and then I display “all done” and go back to the start. At this point gm is still running, but by the time you’ve taken another four photos, it’s done, so you’ll never have two gm processes at the same time.

Doing it like this on a Pi 2 B, I’m taking 4 1600×980 colour images, and the whole process from button press to “all done” takes 45 seconds.

One more thing, instead of tumblr (the venue has poor reception), I’m using a PHP photo gallery (https://sye.dk/sfpg/) to serve the content via a wifi hotspot (TPLINK MR3020). I’ll probably do a full writeup later and put the link here

January 7, 2016 at 9:35 am
– In reply to: John

Nice tweaks

December 31, 2015 at 10:58 pm

Hi. That is a very fantastic photobooth you’ve made.

If I wanted to use a printer instead of tumbler, how would I go about that?

Also, are your codes for LX Terminal or Python 2 or Python 3 on the raspberry pi?
Sorry, I’m new to the raspberry pi.

Thanks in advance.

January 7, 2016 at 9:35 am
– In reply to: junkyardhunter34

It currently does not print. Others have asked for that, and there are other examples out there. It is not something that I am interested in making. I like the social aspect of digital sharing.

January 7, 2016 at 4:46 am

I plan to build a Photobooth for my brother´s wedding. One question to your booth – does it save the pictures on a local HDD or is it only possible to load it on tumblr? Just want to have the pics saved locally….
Thanks a lot
Greetings from Germany

January 7, 2016 at 9:34 am
– In reply to: Chris

It does save a local copy. Just tweak the code to make sure it doesn’t delete the pictures the next time you boot up the machine. Then you can manually delete as needed.

Good luck.

January 27, 2016 at 3:22 pm

hello, nice achievement
I own a Canon 450d camera which is controllable via gphoto2 software.
I found several realization booth on internet but your pleases me.
Do you think we can replace the PiCamera by my 450d using Python code with Gphoto command ?
Thank you beforehand

January 27, 2016 at 3:46 pm
– In reply to: Loic

Very possibly. Getting the GPIO to tell the camera to take a photo should not be too hard. You could access via the remote trigger (wired) or wireless (infrared). The bigger issue is getting files off your camera to the Raspberry Pi for automatic posting to Tumblr. Or can you have the RPi control the camera and transfer via USB?

Let me know what you find out.

Reply to Antti Roos Cancel reply