Skip to content

A RPi+Arduino photobooth for my brother's wedding, that controls a DSLR and makes a slideshow of the pictures.

License

Notifications You must be signed in to change notification settings

3isenHeiM/Photob00th

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photob00th

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.

Required features

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

Design

  • 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

Sources :

Bill of Materials :

Workflow

Here is the workflow I initially intend for this project :

  1. Push the red button
  2. 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
  3. Trigger picture and light the LEDs more
  4. Download the picture (raw/jpg?) on the RaspberryPi's external storage
  5. Move a jpg version to the webserver backend
  6. Reset the setup

Arduino State machine

Initial state :

  • buttonLED is "breathing" (cf Snippets.md)
  • Wait for event on the button
  • Listening for any command in the serial port
  1. When button is pressed :
    • Display "3" on 7-segment display for 1s
    • Light the button for 0.5s
  2. After 1s :
    • Display "2" on the 7-segment display for 1s
    • Light the button for 0.5s
  3. 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
  4. 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
  5. Get back to initial state

Raspberry Pi State machine

Initial state :

  • Waiting for command "do_focus" from the Arduino
  • Listens for the command "takePhoto"
  1. When do_focus is received :
    • use gphoto to do the focus (not sure if supported)
  2. When takePhoto is received :
    • use gphoto to capture the image and download it
    • send picture_taken to Arduino
  3. 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
  4. Get back to initial state

Various details

PWM pins on the Arduino

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.

How to manipulate the button

(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

Darlington arrays

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 on pin 18
    • pin 2 will control the output pin 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.

Stepping stones / To-Do

  • 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 the wait-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

Canon EOS 700D support

I used a Canon EOS 700D DSLR camera, the following page lists the supported operations of gphoto for this type of camera

About

A RPi+Arduino photobooth for my brother's wedding, that controls a DSLR and makes a slideshow of the pictures.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 51.6%
  • C++ 26.1%
  • JavaScript 10.1%
  • CSS 5.4%
  • HTML 4.0%
  • Shell 2.8%