Introduction: Raspberry Pi Photo Booth Controller

Picture of Raspberry Pi Photo Booth Controller

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

Picture of 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.

Step 2: Connect the Camera

Picture of Connect the Camera

After getting your Pi initially set up, get a camera hooked up. You can control most cameras with the RPi using Gphoto2, a well supported, actively updated, free, command-line digital camera controller for *NIX operating systems. Using scripts you can thus automate your camera's controls.

First check to see if the camera you intend to use allows "Image Capture" (under Additional Abilities) by gphoto2

Install gphoto2 from the command line (via SSH on your other computer, or LXTerminal from the RPi desktop)

1) Update the system:

sudo apt-get update

2) Download and run this script, which installs and updates gphoto2:

sudo wget

sudo chmod 755

sudo ./

3) To ensure your camera mounts properly to be controlled via USB (see this thread), remove these files:

sudo rm /usr/share/dbus-1/services/org.gtk.Private.GPhoto2VolumeMonitor.service

sudo rm /usr/share/gvfs/mounts/gphoto2.mount

sudo rm /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor

sudo rm /usr/lib/gvfs/gvfs-gphoto2-volume-monitor

4) Restart

sudo shutdown -r 0

5) Attach your camera to the RPi with USB and test it out


gphoto2 --capture-image-and-download


Do you see a new file in the home directory? This is the photo that was captured. Yay!

Step 3: Connect the Printer

Picture of Connect the Printer

Now you need a printer. A dye sublimation printer makes decent quality photo prints fairly quickly. I used the Canon Selphy CP900, which I randomly bought at Best Buy for this project without doing much research. Luckily it worked out.

Use CUPS to drive the printer. You can check to see if CUPS supports a particular printer. The Canon Selphy CP-900 is not on that list. I got it working using the SELPHY-CP770 driver (this was the lucky part), which, though it was available through the actual CUPS installation, I do not see on the list linked to above (as of Feb 2014).

1. Install CUPS from the RPi command line (for further guidance/troubleshooting, see here)

sudo apt-get install cups

Add the user (pi) to the group allowed to print (lpadmin)

sudo usermod -a -G lpadmin pi

2. Connect your printer and setup CUPS from the RPi desktop
Attach to the RPi by USB and power up your printer.

Open Midori and type into the URL line
This will open up the CUPS setup.

Click "administration" and "add printer;" enter your username and password (e.g., the defaults "pi" and "raspberry").

You should see your printer listed under "local printer;" select it and click "continue."

Set the name and location of your printer as you like, and click "continue."

Select the driver for your printer. For me, there was no CP900 driver, but the CP770 driver worked just fine.

Set the default options.

Now you should be done with printer setup.

3. Test printing
Check for active printers

lpstat -p

Do a test print. "lpstat -p" will give you the name of the printer, in my case "Canon_CP900," which was designated during the CUPS setup above. List the files in your home directory by typing "ls." "capt0000.jpg" is the photo previously captured by the camera. Substitute your own printer name and photo capture name into the command to print, "lp"; the -d argument determines the print destination.

lp -d Canon_CP900 capt0000.jpg

Step 4: Build the Electronics

Picture of Build the Electronics

There are three parts for the user interface:

  • start button, lights up when ready for shooting and starts the photobooth process when pressed
  • pose LED, tells the subjects to pose, flashes faster just before the shot
  • please wait LED, lights up while the photos are being processed and sent to the printer, lets the next subjects know they need to wait; necessary so the print queue doesn't fill up and crash the Pi

To me the most exciting thing about the RPi is the GPIO (general purpose input/output), which lets you work with electronics with your Pi.

1) Set up the GPIO as described here.

2) Get the electronics. I used LEDs that came with the RPi starter pack. The lighted momentary pushbutton switch is also from Adafruit. Not very fancy but it all works just fine.

3) Wire the circuit. See the circuit diagram. After breadboarding it up and trying it out to your satisfaction, solder everything together using a PermaProto for Pi. I made the "pose" light a green LED and the "please wait" light a red LED. The "ready to start" LED in the diagram was wired to light the pushbutton switch.

4) Mount it all in a box. I ended up using a cheap enclosure from Radio Shack. I wish I had spent more time on this part of the project, making it look more fancy. I bet you can get more creative.

Almost ready to go! Now we just need to do a bit more prep of the RPi.

Note: the button is based on this useful tutorial.

Step 5: Set Up Full Rig, Download Scripts, Test

Picture of Set Up Full Rig, Download Scripts, Test

1) Connect the printer and camera to the RPi using a USB hub.

2) Make a label for the montage. Name the file "photobooth_label.jpg" and put it onto your RPi in the home directory.
I used Illustrator, exporting a ~110x1100 pixel .jpg, oriented vertically. The words read from bottom to top. I guess you could also use Photoshop, GIMP, or Inkscape.
Upload the photobooth label file to your RPi by opening a local terminal window, change to the local directory where this file is and transfer the file:

scp photobooth_label.jpg pi@

Alternately you could email it to yourself and use the RPi GUI to get the file. Or, with a windows machine, use WinSCP.

3) Get the scripts. On the RPi make a directory for and download three scripts; make them executable.

mkdir -p ~/scripts/photobooth

cd ~/scripts/photobooth

sudo wget

sudo wget

sudo wget

sudo chmod 755 *

Edit the "assemble_and_print" script. Change the "lp" line to include your printer name.

sudo nano assemble_and_print

^X to exit, save the changes

4) Make directories for assembling the montage and archiving shots.

cd ~

mkdir photobooth_images

mkdir PB_archive

5) Install ImageMagik

sudo apt-get install imagemagick

6) Test: try it out and run the script (ctrl-C to quit).

sudo python ~/scripts/photobooth/

If it's glowing, push the button.

7) Set script to run automatically.
If the step above works, then make the script run automatically at startup. This will be allow the booth to operate without an external computer or network.

sudo nano /etc/rc.local

Now, add the line
/home/pi/scripts/photobooth/startup_script &
above the "exit 0" line
^X to exit, save the changes

Restart the RPi

sudo shutdown -r 0

The script should automatically run in the background.

You can get archived photomontages off the RPi by scp'ing from your local terminal:

scp pi@* .

Step 6: Have Fun!

To fully deploy the photo booth, you're going to need a party.

As for building an actual booth?  Here's an opportunity for you to get crazy creative.  You can hang some fabric in a corner.  Or here's a good description of how to build one out of PVC:  
Don't forget to supply props.
Please comment and let me know how it goes.
Be sure to have fun!

Thank you to Daniel B for inspiration and clueing me in to dye sublimation printers and ImageMagick code.  And thank you to HK, TK, and MM for helping make the booth a total success.


Lanzaboy made it! (author)2014-06-28

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!!

GregT90 (author)Lanzaboy2017-09-11

I am starting to design a booth myself. I love the look you went with and am considering something very similar. I am curious what you used for the flash and if you had it connected to the Raspberry Pi and how. Most of the setup seems really easy but I am strugling with how to power and control a flash of some sort due to the limitations of the Pi.

Lanzaboy (author)GregT902017-09-14

Actually it isn't a flash just a bank of LEDs on a simple line switch. I have found it better to prelight the scene before taking the picture. Having the lights on attracts people to the photo booth. Though as, a mentioned, it would be easy enough to add a relay to simmulate a flash. If so I would have it have it on through pose up to taking the picture and may be lengthen the time between poses. The other option might be to connect a flash to the camera (the type that has an extension cable) and build a suitable retro surround for it.

GregT90 (author)Lanzaboy2017-09-14

My fiancee and I were talking about this. The spot in the venue we plan to set up the photo booth is going to be a little darker so using a video light that just stays on might not be a bad idea.

I have been debating on the other option you mentioned as well, just turn the light on when the button is pressed and keep it on until the series of photos is done. I still struggle with how to wire it up because it would have to have its own power source and the Pi would just trigger a switch. Sadly being a novice with electronics I am having a harder time figuring out how to set this up. Everything else, the button, indicator LEDs, camera, and screen all are much easier to set up and control.

darkman77 made it! (author)GregT902017-10-19

Hi GregT90, i don't know if you still need informations about this, but i build a second photobooth doing exactly what you want. I'm using a litte chip, an uln2003a to switch die LED "lamp". Just connect it to a spare GPIO pin and it will switch. You will find a lot of chematics via google. I use it also for the button and pose led, as i use 12v led strips for them. So you can't connect them directly to the raspberry pi gpio ports. See the first image, i draw a qick connection diagram for myself to not mess up. I use only one AC to DC brick that gives me 12v and some small converter modules to create the needed 5v for the Pi and 9v for the led lamp

safay (author)GregT902017-09-12

Greg, you could wire a relay as the switch for the LED lamp, and then use one of the other GPIO pins to control the relay. Turn on the LED lamp at the beginning of the picture-taking routine, back off afterward.

zide (author)Lanzaboy2014-12-08

Exactly what I'm going for! Do you have more pictures of the construction process, by chance?

safay (author)Lanzaboy2014-06-30

Slick! I love it. Such a cool project!

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!

Lanzaboy (author)safay2014-07-01

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).

rabeatz made it! (author)2015-07-11

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.

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.

I added a command to copy the original files before resized so they are available for prints at a later time.

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.

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.

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?

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.

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.

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.

ValentineD1 (author)rabeatz2017-03-17

"I added a command to copy the original files before resized so they are available for prints at a later time."

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 !

thank you !

ThomasT18 made it! (author)2015-07-27

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.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+.)

darkman77 (author)ThomasT182015-08-03

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.

safay (author)ThomasT182015-07-30

Thank you for sharing your build, that looks like a sweet setup.

darkman77 (author)2015-06-18

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

bdh1976 made it! (author)2014-03-22

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.

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.

gleemonex69 (author)bdh19762015-05-21

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?

safay (author)gleemonex692015-05-25

Great idea!

Here's a python package that you could use to modify my script:

It uses the flickr API, if you're curious about learning more:

safay (author)bdh19762014-03-22

Cool! I'm glad this worked for you.

bdh1976 (author)2014-03-15

Be sure to check that gphoto2 supported camera page lists "image capture" for you camera, otherwise it won't work.

safay (author)bdh19762014-03-19

Great point! Edited accordingly; thanks for the tip.

JasonH100 made it! (author)2017-11-27

Great instructable, thanks for posting.

I picked up some buttons from Amazon, 5 for $20. The light output was poor especially when driven from a Raspberry Pi's GPIO so I made some new thinner inserts for them.

Here's the button link:

And here's the inserts on Thingiverse:

MarkusA12 made it! (author)2017-10-02

Hi, Thanks for Tutorial. It inspired me a lot while building my own booth.

Did you make it somehow to deal with continuing to print after emptying the paper cassette? My printer, shows "add paper" and if I do so it gets stuck showing busy... No Idea how to solve that... Any guesses? Thanks again for the Tutorial!

kguy2 (author)2017-09-22

hey the only selphy printer available to me is the canon selphy cp-1000 would this work for the project as usb direct printer or as a network printer.

kguy2 (author)2017-09-21

Hi, i am replicating this project for a fest in my college and i am wondering if the cannon selphy cp 1000 could be used for this project? as i am not able to find other printers in India. are drivers available for this and if so how can i use the cp 1000 if the drivers are not availalbe. can i use a windows pc and use the printer as a network printer>>> Thanks !!!

Paulpross83 (author)2017-09-18

This is a great project, cant wait to start. Im just waiting for all the bits to be delivered. Ive already got a printer but i cant find it on CUPS, its a mitsubishi d80dw. What options do i have, can i get it working with out too much of an headache? Thanks

aviatorbja made it! (author)2016-07-25

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.

Can't thank the author enough. This was a huge hit at my in-laws 50th wedding anniversary.


GregT90 (author)aviatorbja2017-09-11

Awesome rig. I am working on getting one built myself and am struggling a bit with the flash. Do you mind sharing some information on how yours is set up and controled (if it is controlled) by the RPi?

ValentineD1 (author)2017-07-27

Hello !

Thanks for sharing !

Any idea how to replace the gphoto2 command line by a raspistill one to use the picam instead of an external camera ?

My main problem is to give a name to the photo which are taken so the assemble and print command can find the photos...?

Thank you !

darkman77 made it! (author)2015-08-13

Hi @all,

finally my wedding is
over and the photobooth was a great success. As mentioned in some
comments i used a Raspberry PI 2 and a Pentax DSLR, a Canon Selphy cp910
printer and a 63inch (1.6m) tall case for the photobooth. Also a usb3
hard disk drive was used to store all the images.

I also added a
RTC to the Pi as the start date/time was always 1.1.1970 and so all my
additions to the script would not work as they need date and time

My "buzzer" is a 100mm arcade button with a modded dual
led for red/green illumination of the button. Connected are the casing
and the "start panel" with a standard ethernet cable. All texts are in
german, but as i need to set up the photobooth for an international
wedding again, so i also build an english version.

One photo (the first i hope) showing me, about 3 hours before my own wedding :), installing the photobooth at the party location. Very messy because of the long night of adjustments before. Printer paper was always jamming into the enclosure :(.

What i will change after the usage is the pose led, i have put it into the start panel. It should be in the region around the lense. And i will add a lock, as everyone tries to look inside :(

Safay, many many thanks for making this instructable. It makes my addicted to raspberry too :).

safay (author)darkman772016-01-13

Awesome! I love your clean build. I'm so glad you enjoyed making (and using) this project.

darkman77 (author)safay2016-01-14

Thanks for you kind words safay.

I learned a lot with this project. And since my own wedding the photobooth was upgraded a lot :). Even using EXIF data from first picture to set system clock on Pi :)

Some more pictures:

LuMat (author)darkman772017-04-11

Hey darkman77,

Nice build and improvements.

can you share the code you used to update the Pi's clock based on the EXIF data from the first picture?

I want to do the same thing ;-)

Thanks in advance.

darkman77 (author)LuMat2017-04-11

Hi @LuMat,

I shared the code 2 years ago on GitHub as a fork:

Have fun with it

LuMat (author)darkman772017-04-12

Darkman77, many thanks!

darkman77 (author)LuMat2017-04-12

@LutMat, you will need also


Petroklem (author)darkman772017-06-21

Hey darkman77, I see you are still active ! I wanted to thank you for the improvement you made, EXIF for time, reboot, etc. Its nice to see people sharing. I am a novice at Rpi and python, but I am getting better. I used a Pentax K5 but it never worked with pslr-shoot, i used pktriggercord ultimately. Also I added a QR code in the label with qrencode so the guest can download fullsize pics afterward ! I plan to upload pics afterward or add a function that upload pics via FTP to my site if I have some time... the fun never stops !! :D

My photobooth is still under construction (painting atm), i will post pictures and after.

Many thanks

darkman77 made it! (author)darkman772015-08-24

I have made some changes and the photobooth printed over 230 pictures in a row. It was a big wedding and all guests loved the photobooth.

foluia (author)2017-05-15


Super tutorial. It works great.

Only one problem : the script didn't run automatically. I made exactly what do you said, but when I reboot, nothing. The green led didn't turn on, and when I push the button for the photo, nothing happening.

I made and remade the "7) Set script to run automatically.", but still nothing.

Somebody have an Idea of my problem ?

Thanks a lot

Ljusto_struhar (author)2017-04-20

This is simple amazing project. I am in, i just waiting for arriving of photo printer MITSUBISHI CP 80DW. Does anybody try with this printer?

I have one concern: my photoboot will work 24/7.
When the script is in ready status (Ready for next job), CPU on my raspberry is on 50% (python while loop), is there any fix code for this?

MikalV (author)2015-07-30

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?

safay (author)MikalV2015-07-30

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:

MikalV (author)safay2015-08-11

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? :)
Printer is Canon Selphy 910:

darkman77 (author)MikalV2015-08-14

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.

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.

MikalV (author)darkman772015-08-17

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 :)

Attached is a nice shot of me and mylady the morning after our friends wedding.

NicoD15 (author)MikalV2016-04-16

Hi MikaIV, I see you had it in landscape mode with the banner on the bottom
(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?

MikalV (author)NicoD152017-04-12

Sorry for the late reply, contact me directly and I'll send you the files.

criticalmass115 (author)MikalV2017-01-17

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.

Many thanks, Steve.

MikalV (author)criticalmass1152017-04-12

HI Steve. If you contact me directly I could send you the files for the project. Also I got some help from a friend to make a version with only one image, not four.

KyleH81 (author)MikalV2017-03-14

Where'd you get that shirt?

About This Instructable




More by safay:Commute on BART with your bike like a BOSSRaspberry Pi photo booth controllerMake a 3D print from a 2D drawing
Add instructable to: