A RPi photobooth for my brother's wedding, that controls a DSLR and makes a slideshow of the pictures.
Forked from kitesurfer1404's one.
Architecture : RPI for interfacing the DSLR, with arduino to command the I/Os.
By order of importance...
- RaspberryPi-based
- Pictures from DSLR (and not Picamera module)
- LED light (because the room will be dark)
- Press button to trigger capture
- Publish the photos as slideshow on a (remote) screen
- Countdown (7-segment display ?)
- Do a Wooden enclosure
-
RaspberryPi :
- Controls the DLSR
- Setup the slideshow
-
Arduino :
- Wait for events on the button (+ light it up with the countdown)
- Control the 7-segment display
- Light and dim the big LEDs
-
Serial link between Arduino and RaspberryPi to exchagne commands and feeback.
-
State machine running on both µcontrollers to listen for serial commands
-
Based on serial commands, they can interact
- Control 7-segment display using python
- Example Control big button + light
- Instagram Filters in 15 Lines of Python
- Background Image
- Arduino Uno - R3 - Sparkfun - 24.95$
- Breadboard - Self-Adhesive (White) - Sparkfun - 4.95$
- Big Red dome button - Sparkfun - 11.95$ 12V supply
- 7-Segment display 6,5" - Sparkfun - 18.95$ 12V supply
- Jumper Wires Premium 4" M/M - 26 AWG (30 Pack) - Sparkfun - 1.95$ (to connect with RPi)
- Darlington Driver 8-Channel ULN2803 DIP - Sparkfun - 1.95$ 2 pieves
- Jumper Wire Kit - 140pcs - Sparkfun - 5.95$
- DC Barrel Jack Adapter - Breadboard Compatible - Sparkfun - 0.95$ to bring 12V on the breadboard
- Resistor 1K Ohm 1/4 Watt PTH - 20 pack (Thick Leads) - Sparkfun - 0.95$
- 4 LED MR16 Spotlight 12V 4W - MiniInTheBox.com - 17.38€ for 10.
- 10pc MR16 Sockets - Amazon - 7.71$
- Arduino and Breadboard Holder - Sparkfun - 3.95$
Here is the workflow I initially intend for this project :
- Push the red button
- Countdown from 3 to 0 :
- Count using the 7-segment display
- Light up/down the red button
- Light the LEDs
- At "1", ask the RPi to do the focus
- Display the camera preview on a VGA screen
- Trigger picture and light the LEDs more
- Download the picture (raw/jpg?) on the RaspberryPi's external storage
- Move a jpg version to the webserver backend
- Reset the setup
Initial state :
- buttonLED is "breathing" (cf Snippets.md)
- Wait for event on the button
- Listening for any command in the serial port
- When button is pressed :
- Display "3" on 7-segment display for 1s
- Light the button for 0.5s
- After 1s :
- Display "2" on the 7-segment display for 1s
- Light the button for 0.5s
- After 1s :
- Display "1" on the 7-segment display for 1s
Send command "do_focus
" via serial to the RPi- Light the button for 0.5s
- Take the photo :
- Increase lights of the LED to 100%
- Send command "
takePhoto
" via serial to the RPi Wait for command "picture_taken
" from the serial port
- Get back to initial state
Initial state :
Waiting for command "do_focus
" from the Arduino- Listens for the command "
takePhoto
"
Whendo_focus
is received :use gphoto to do the focus (not sure if supported)
- When
takePhoto
is received :- use gphoto to capture the image and download it
sendpicture_taken
to Arduino
- Post-process the image in a separate thread :
- Apply a filter ? (if fast enough : 3-4s)
- Move it the the correct folder
- Rename it
- Update the slideshow
- Get back to initial state
Reference here
On most Arduino boards (those with the ATmega168 or ATmega328P), this function works on pins 3
, 5
, 6
, 9
, 10
, and 11
.
They are indicated by a ~
besides their number on the Arduino.
(Learned from here, where they featyre the exact same button
Status :
- Button pressed :
digitalRead(button) == LOW
- Button released :
digitalRead(button) == HIGH
Pinning :
- NO (normally openned) pin : button trigger
- Anode : LED anode
- GND : ground
Nice explanation here
The output of the ULN2803 is not supplying anything. The ULN2803 are a bunch of darlington transistor. They pull the output low. That is all. They have also a large voltage drop of about 1V.
Pinning :
- 1-8 (arduino) -> 18-11 (output)
That is :pin 1
will control whatever is conected onpin 18
pin 2
will control the outputpin 17
etc...
- 10 : Common -> +12V
- Ground -> Power supply Ground
The load (led+7-segment display) has 2 connections :
- +12VDC
- output pin of the matching control pin
When the control pin is high, the Darlington array pulls down the output pin (at +12V) to the Ground. And the current flows and you have current in whatever load you have put between the Darlington output pin and the power sypply.
- Dim the 12V LEDs using the Raspberry and a Darlington array (since they are 12V-powered)
Solution : Use an Arduino Uno for all GPIO-related events. - DSLR is not recognized by the Ubuntu
Solution found here - Auto-poweroff of the USB connectivity (tests made on MacOS)
Solution found here : use thewait-event
function, it send a keepalive message to the camera. Will be tested. Edit : the AutoPoweroff of the CanonESO 700D has been disabled on the Camera itself.Once done, no more interruption in the gphoto detection of the camera. -
Impossible to trigger the focus of the camera itself. State machine has been updated.
Impossible to do using gphoto2. - Handles the warning exception of skimage ()'Possible precision loss when converting from float64 to uint8')
- Threadize the post-processing
I used a Canon EOS 700D DSLR camera, the following page lists the supported operations of gphoto for this type of camera