curious guest to be able to find AC connections
After getting the components I didn’t have, I began to
breadboard the design. It is really a very quick and simple
circuit. An LED with a current-limiting resistor for the
flashing timer light, the two leads to the power switch, and
two buttons for trigger and shutdown were all we needed.
The general-purpose input/output pins (GPIO) on the Pi
are very configurable, so I chose to have the lines held
high by the Pi and pulled low by the buttons.
A breakout board like the Pi T-Cobbler makes
connecting everything to the right pins a lot more simple
and easy to change later, but isn’t necessary. You can
choose whatever GPIO pins you wish, but I used those
marked in the hook-up diagram shown in Figure 2. That is
what the downloadable code (available at the article
link)will be set up for.
The camera hooks up to a flat-flex connector on the
Pi. Be careful that you connect the camera to the correct
connector and in the right direction! On the Pi A+, the
bare contacts go towards the HDMI connector and the
blue strip is towards the USB connector (Figure 3). Gently
lift the connector bail and insert the cable, then snap the
bail back down. A small screwdriver could help if you
have large fingers.
For initial prototyping, I hooked the Pi up to my living
room television, but it is important to keep testing it with
the screen you will use in the end product to catch any
resolution issues early. Use a decent quality HDMI cable
or you may run into reliability issues.
It is easiest to work with the Pi — at least initially — if it
is connected to a keyboard, mouse, and the Internet. I
used a small USB hub to break out the single USB port on
the A+. Powered hubs are really helpful if you are running
into erratic behavior. Wi-Fi modules can consume a
decent amount of power and could be the root of the
problem. Power is the last thing our machine needs.
Again, use a high quality USB cable for durability and
because they generally have larger gauge wire than very
cheap cables. I used an old Apple iPad charger as my
power source. Whatever you use should be able to source
about 2A at 5 VDC.
There are a lot of steps to get all the parts in place for
the photo booth to work flawlessly and automatically.
Hang in there, though; it is worth it!
To get started with your Raspberry Pi, you’ll need to
set up the operating system (Raspbian) on an SD card.
The easiest way to do this is with a tool called NOOBS
(New Out Of the Box Software). You can buy SD cards
with NOOBS already installed, or do it yourself. I chose to
do it myself on a large ( 32 GB) SD card to provide lots of
photo storage. You can format the SD card with tools
already on your computer, or with SD Formatter from the
SD Association ( www.sdcard.org/downloads/
Download the offline and network install version of
NOOBS from the raspberrypi.org site
( http://downloads.raspberrypi.org/NOOBS_latest) and
unzip it. Copy the contents onto your SD card and eject it
from your computer. Insert the SD card into your Pi and
You’ll be greeted with a window that allows you to
select the OS you wish to install. Installation can take a
while, but eventually will complete and an onscreen
configuration guide will take you the rest of the way. Be
sure to enable the camera during the prompts! You can
now log in and load up Raspbian (see the sidebar).
Before continuing, it’s a good idea to update the
software on your Pi since the NOOBS distribution and
packages could be a little dated. Make sure you’ve set up
the network connection and at a terminal prompt, type
“sudo apt-get update,” then “sudo apt-get upgrade.”
Again, this took a while for me to complete.
While we have the Pi connected to the Web, we’ll
March 2016 29
Randomly Tweeting Text
Initially, I had the photo booth tweeting the photos with some
default text that is stored in the tweet_text variable. You can still do
that, but if you put a text file in the PiBooth directory that has
different tweets on each line and set tweet_text to that filename, the
photo booth will randomly select a tweet from that file and make your
Twitter stream a little more interesting. Below are some examples of
the tweets that we used. You can follow my photo booth’s adventures
by following @Pi_Booth on Twitter.
These people really pushed my buttons.
... and all I got was these photo booth pictures.
Hey, I just met you, this is crazy.
I wasn't lucky, I deserved it.
I had fun once, it was horrible.
OMG that's so cute!
Collect moments, not things.
These people ...
Best selfie ever!
Frankly my dear, I don't Instagram.
Logging into Your Pi
It’s not uncommon to boot up a new system and not know how to
log in. The current distribution of Raspbian has the following default
username: pipassword: raspberry
It is a good idea to change the default password — especially if
you are going to make your project Internet connected. Just type
“passwd” at the terminal prompt and follow the instructions. You can
even create a new user, but be sure to modify the setup instructions
to use that account instead of the Pi account.