Raspberry Pi Photo Booth Controller




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

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

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 raw.github.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh

sudo chmod 755 gphoto2-updater.sh

sudo ./gphoto2-updater.sh

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

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

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

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 raw.github.com/safay/RPi_photobooth/master/assemble_and_print

sudo wget raw.github.com/safay/RPi_photobooth/master/photo_booth.py

sudo wget raw.github.com/safay/RPi_photobooth/master/startup_script

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/photo_booth.py

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: https://www.instructables.com/id/DIY-Portable-Wedding-Photo-Booth/step4/Frame/  
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.

18 People Made This Project!


  • Creative Misuse Contest

    Creative Misuse Contest
  • Fix It! Contest

    Fix It! Contest
  • Water Contest

    Water Contest

116 Discussions

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

1 reply

2 months ago

Hope someone can help me!

I did everything as described but when i run the script, now LED glows and without pressing the button, it starts taking pictures. The rest work fine. I've Rebuilt the electrics with a breadboard and its the same. But when i disconnect the wire at the #24 the scrips waits... But now i've found out, that it doenst matter which wire touches #24, the script starts taking Pictures. Even if the wire is connected to nothing. Sorry for my bad englisch.


10 months ago

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.


10 months ago

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

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

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 !


1 year ago


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

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 photobooth.py 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?

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?

9 replies

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:

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:


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.

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.


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?

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

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.

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.

Where'd you get that shirt?