Mechanical shutter release project

Hi, I'm vinny, a photographer who likes to build stuff as well. I can fix just about anything. I've never used any Arduino products and it scares me quite a bit. I'm not well-versed with computers and I can't write code/programs. I've watched a lot of videos and read a lot about these things but will need help. I've posted this on a couple photography forums to see if someone was willing to build it for me but no luck. I'm in need of a gadget that can attach to my cable release on my cameras* for remote shooting outdoors. I plan to use an rc servo, the smallest Arduino that will do the job, and bluetooth. I'm hoping there's exists an app which will run the servo just like this::http://www.youtube.com/watch?v=qciLa_Wo8oM but with the iphone 4 I already have.

I've read that the iphone 4 cannot use bluetooth with arduino's w/o apple mfi or jailbreaking and have also read it can now be done. I really have no need for a new phone at the moment.

thanks!

*these are view cameras which have zero batteries or electronics but use lenses in mechanical shutters which require a plunger style cable release

look for arduino post about time delay and elapsed time photography. Someone had a post about 4 months back where he posted a really cool setup for triggering 10 to 50 cameras simultaneously. (try google first)

Here are some links I've seen in the past:

You can now get Bluetooth LE shields and cards for the Arduino that is claimed to work with Apple without jailbreaking. What you want to do is tackle each step at a time. The first is probably the servo control. After that probably integrate bluetooth LE to run the commands. And finally make it battery powered and portable.

Here is a link about Bluetooth LE: http://makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailbreaking-no-mfi/

Adafruit sells a Bluetooth LE breakout board for Arduinos (probably best to start with Uno, since that is the most common, and just about everything supports it): https://www.adafruit.com/products/1697. There is a shield from Adafruit as well, but it doesn't appear to work with IOS devices.

Seeed has a shield that is probably easier to work with than a breakout board: http://www.seeedstudio.com/depot/bluetooth-40-low-energy-ble-shield-v20-p-1631.html

Geeetech also seems to offer a similar shield: http://www.amazon.com/Geeetech-Bluetooth-arduino-Requires-iphone4s/dp/B00B945EUM

There is a self contained Arduino compatible system with BLE (BLEduino). I am unsure if it is shipping, the status says they hope to ship the kickstarter orders by March, but it is now June. Perhaps it is still vapor: http://bleduino.cc/.

Digispark Pro was a kickstarter project, and they will be shipping in a month or so. I'm not sure whether you can add a pre-order for the Digispark Pro and Bluetooth LE shield at this time, but it might not hurt to ask: https://www.kickstarter.com/projects/digistump/digispark-pro-tiny-arduino-ready-mobile-and-usb-de.

Michael, I have a pretty good idea of how I'll set up the mechanics of this thing and it seems like plenty of folks have used servos for such an application. The iphone 4 doesn't support Bluetooth 4 or Bluetooth LE so that doesn't leave me with many options. I like the IR remote the guy used in one of the links and that would be a good option too if I knew anything about those.

You don’t know anything about IR controls, programming, Arduinos, etc. NOW. That doesn’t mean you can’t learn how to do it. Take it one step at a time, break the project into smaller steps, each of which are self contained, and/or build on the previous step. Don’t get discouraged if your initial attempts aren’t successful, you just found one more way that doesn’t work. Ask for help for pointers (but don’t expect people to do your project for you unless you pay them).

I see a lot of people entering these forums who keep telling themselves they can’t do something without adding the necessary words AT THE CURRENT TIME, and unfortunately a lot of times they prove themselves right.

Ok, enough soapbox. I tend to think getting the first step is just learning the Arduino environment. Get your system, get some leds, resistors, jumper wire, buttons, a potentiometer, and a servo or two, and a breadboard. Go through some of the examples, such as blink. Copy the example, and modify it to change the amount of time the led blinks. Put together some of the simple circuits. The idea isn’t to become a master of programming, but to get an idea how to modify code to wait for an input (such as a button), and do something, such as move the servo.

Unfortunately as somebody who has been programming for almost 40 years now, it is so natural to me, that I have a hard time bridging that gap between not programming and programming, but there are a lot of people in this forum for whom it is a much more recent accomplishment, that they can help (of course I have the same issue with people who have been doing the electronics side of things so long, that soldering is second nature to them). Basically you need to break things down into very concrete steps. So instead of thinking ‘press the shutter release’, you want to think, ‘has the button been pressed since the last time, if so, then start the servo to move x degrees, wait for the amount of time for the camera to take the picture, and then move the shutter back’.

Here is code that I wrote last year to play with the Servo with an idea of having the servo fire the camera. I played with the servo for a bit, and then moved on to other projects and I haven’t looked it since then, but hopefully it might give you a starting point:

// Adapted from the Sweep and Button example code
// Adaption by Michael Meissner, arduino@the-meissners.org

#include <Servo.h> 
 
// Standard output pin assignments
// Pin 0:	serial receive (usb)
// Pin 1:	serial transmit (usb)
// Pin 2:	Interrupt 2 via attachInterrupt
// Pin 3:	Interrupt 3 via attachInterrupt, 8-bit PWM output via analogWrite
// Pin 4:	No special use
// Pin 5:	8-bit PWM output via analogWrite
// Pin 6:	8-bit PWM output via analogWrite
// Pin 7:	No special use
// Pin 8:	No special use
// Pin 9:	8-bit PWM output via analogWrite
// Pin 10:	8-bit PWM output via analogWrite, SPI SS
// Pin 11:	8-bit PWM output via analogWrite, SPI MOSI
// Pin 12:	SPI MISO
// Pin 13:	On board LED, SPI SCK

// Note, the Servo library disables analogWrite (PWM) on pins 9 & 10
// whether or not there is a server on those pins

// Standard input pin assignments
// Pin A0:	No special use
// Pin A1:	No special use
// Pin A2:	No special use
// Pin A3:	No special use
// Pin A4:	TWI SDA pin (Wire library)
// Pin A5:	TWI SCL pin (Wire library)

// Servo's black wire is connected to ground, red wire to 5 volts
// and white wire to button 3

Servo shutter;				// servo to fire shutter release
const int  pin_shutter	 = 3;		// pin servo is on
const int  pos_reset	 = 0;		// position to reset servo to
const int  pos_fire_def	 = 90;		// default position to fire
const int  delay_initial = 1000;	// wait 1 second after power on to turn off the light
const int  delay_servo	 = 250;		// wait 1/4 second for servo to finish
const bool detach_servo	 = true;	// if true, detach the servo

// 10k Potentiometer right pin is connected to ground, center pin to A1, left pin to 5v
const int  pin_pot	 = A1;		// pin 10k potentiometer is on

// Push button has ground connected to 10k resistor, and then button 12 and 5 volts
const int  pin_button	= 2;		// pin button is on
int state;				// current button state

// LEDs
const int pin_red	= 11;		// pin Red LED is on
const int pin_green	= 12;		// pin Green LED is on

// Serial port
const bool do_serial	= true;		// whether to write to the serial port

// Return value to set servo to when firing
static int
pos_fire (void)
{
  int pot = analogRead (pin_pot);
  int ret;

  if (do_serial)
    {
      Serial.print ("Current milliseconds = ");
      Serial.print (millis ());
    }

  if (pot)
    {
      ret = map (pot, 0, 1023, 0, 180);
      if (do_serial)
	{
	  Serial.print (", potentiometer value = ");
	  Serial.print (pot);
	  Serial.print (", servo position = ");
	  Serial.println (ret);
	}
    }
  else
    {
      ret = pos_fire_def;
      if (do_serial)
	{
	  Serial.print (", no potentiometer, servo position = ");
	  Serial.println (ret);
	}
    }

  if (do_serial)
    Serial.flush ();

  return ret;
}

void
setup(void)
{ 
  // Set up the usb monitor
  if (do_serial)
    Serial.begin (9600);

  // set up the button
  pinMode (pin_button, INPUT);
  state = -1;

  // set up the LEDs, turning both on, and then off
  pinMode (pin_green, OUTPUT);
  pinMode (pin_red, OUTPUT);

  digitalWrite (pin_green, HIGH);
  digitalWrite (pin_red, HIGH);

  // set up the servo, resetting it to the initial position
  shutter.attach (pin_shutter);
  shutter.write (pos_reset);

  // wait until the servo is finished moving
  if (delay_initial)
    delay (delay_initial);

  // turn off servo if desired
  if (detach_servo)
    shutter.detach ();

  digitalWrite (pin_red, LOW);
  digitalWrite (pin_green, LOW);
} 
 
 
void
loop(void) 
{
  int new_state = digitalRead (pin_button);
  if (new_state != state)
    {
      state = new_state;

      // If the button is HIGH, turn on the green LED and set the servo to fire.
      // Otherwise turn off the green LED, turn on the red LED, and reset the servo
      if (state == HIGH)
	{
	  digitalWrite (pin_green, HIGH);
	  if (detach_servo)
	    shutter.attach (pin_shutter);

	  shutter.write (pos_fire ());

	  // wait until the servo is finished moving
	  if (delay_servo)
	    delay (delay_servo);

	  digitalWrite (pin_red, LOW);
	}
      else
	{
	  digitalWrite (pin_green, LOW);
	  shutter.write (pos_reset);

	  // wait until the servo is finished moving
	  if (delay_servo)
	    delay (delay_servo);

	  // turn off shutter if desired
	  if (detach_servo)
	    shutter.detach ();

	  digitalWrite (pin_red, HIGH);
	}

    }
}