Camera Trigger

Update: Check out my latest Camera Axe project for a much more robust device that handles this.

This article explains how to use a microcontroller like Arduino to trigger the shutter on a Canon DSLR camera that has an N3 connector. Canon cameras like the 10d through the 40d and their professional cameras all have this connector. Many other DSLR cameras have a very similar connector that you could adapt this article to, but they’ll require a little more research from you.

This project would work well with another project I wrote about here. It describes how to trigger a flash with sound or a laser trigger. You could easily adapt it so it triggers your camera instead of the flash. Note that in that article I discuss the downside of directly triggering your camera (namely the delay), but if a delay of a fractional part of second doesn’t matter then triggering your camera directly works great. Some cool applications would be having your camera take a picture every time you say a word, taking a picture every time someone rings your doorbell, or taking a picture when someone walks down the hallway.

The most difficult part of this tutorial is getting a cheap N3 connector. Canon decided to go with a proprietary plug and they charge ridiculous prices for any accessory that uses this plug. I think their cheapest device with the N3 plug is a basic remote trigger and they charge $50 for it. You could try to make your own plug. But my favorite solution was to type “canon n3 remote” into ebay and I found lots of simple remote triggers for under $10. I just got my plug from one of these devices.

With the plug in hand I started figuring out what the different wires did. Here is picture of the the plug and the color of wire attached to each pin in the plug. The white wire is ground. The green wire is +3V and when it’s grounded it causes the camera to focus (similar to pushing your shutter button half way down). The red wire is +4V and when it’s grounded it causes the camera to take a picture (depending on the mode the camera is in it might focus first). If you want to guarantee a quick picture you should pre-focus your camera and then set focus to manual.

Now that we know how the N3 plug works all we needed to do is wire a circuit that lets us switch the green (focus) or red wire (shutter) to ground. I actually find the focus wire to be pretty useless since I can have the camera focus before it takes a picture if I want, but there are some use cases where it would be nice so I’ve included it here for completeness. I figured a simple switching transistor like the 2N2222 would be be the perfect switch for this project and so that’s what I used. See my circuit diagram below.

This example code for Arduino is very simple. All it does is focus when you hit the “f” key and and take a picture when you press the space bar key. Here is a link to the code.

// Maurice Ribble
// 4-28-2008
// http://www.glacialwanderer.com/hobbyrobotics

// This code just tests my camera trigger.  It lets you
// focus the camera by pressing the 'f' key and take a
// picture by pressing the space bar.

#define FOCUS_PIN 6
#define SHUTTER_PIN 7

void setup()
{
  pinMode(FOCUS_PIN, OUTPUT);
  pinMode(SHUTTER_PIN, OUTPUT);
  digitalWrite(FOCUS_PIN, LOW);
  digitalWrite(SHUTTER_PIN, LOW);
  Serial.begin(9600); // open serial
  Serial.println("Press 'f' to focus and 'spacebar' to trigger shutter");
}

void loop()
{
  int cmd;

  while (Serial.available() > 0)
  {
    cmd = Serial.read();

    switch (cmd)
    {
    case 'f':
      {
        digitalWrite(FOCUS_PIN, HIGH);
        delay(800); // May want to adjust this depending on focus time
        digitalWrite(FOCUS_PIN, LOW);
        break;
      }
    case ' ':
      {
        digitalWrite(SHUTTER_PIN, HIGH);
        delay(2000); // May want to adjust this depending on shot type
        digitalWrite(SHUTTER_PIN, LOW);
        break;
      }
    default:
      {
        Serial.println("Press 'f' to focus and 'spacebar' to trigger shutter");
      }
    }
  }
}

20 Comments

  1. andyatspikenzielabs said,

    June 4, 2009 @ 12:06 am

    Thank you !!!!!!

    I was looking all over the net for this!!

    andy@spikenzielabs.com

  2. Pascal said,

    August 4, 2009 @ 10:43 am

    You can do the same circuit with 2N3904 transistor. Since my nikon D200 give already a 0 – 5V at the trigger pins of the remote all i needed was a 1x 2N3904 acting as a switch because the D200 is triggered when the focus and the shutter pins are shorted to ground. Really simple. When the pin 7 is 5v ( detection of lightning) the transistor switchs on as a result the shutter and focus pins are grounded.

  3. Ryan Spalding said,

    February 8, 2010 @ 2:06 am

    awesome project.

    I used this as a base for making a timelapse controller for my camera.

    I found that sony/minolta needs both shutter and focus pins grounded to activate the shutter.
    I also activated the led just to know when it should have taken the picture in case i had a wiring issue when prototyping.

    here is the modified code:

    #define FOCUS_PIN 6
    #define SHUTTER_PIN 7
    int ledPin = 13; // LED connected to digital pin 13

    void setup()
    {
    pinMode(FOCUS_PIN, OUTPUT);
    pinMode(SHUTTER_PIN, OUTPUT);
    digitalWrite(FOCUS_PIN, LOW);
    digitalWrite(SHUTTER_PIN, LOW);
    pinMode(ledPin, OUTPUT); // sets the digital pin as output
    }

    void loop()
    {
    digitalWrite(FOCUS_PIN, HIGH);
    digitalWrite(SHUTTER_PIN, HIGH);
    delay(1000); // May want to adjust this depending on shot type
    digitalWrite(SHUTTER_PIN, LOW);
    digitalWrite(FOCUS_PIN, LOW);
    digitalWrite(ledPin, HIGH); // sets the LED on
    delay(500); // waits for a second
    digitalWrite(ledPin, LOW); // sets the LED off
    delay(30000); // Delay’s 30 seconds untill next shot
    }

  4. quint said,

    March 13, 2010 @ 8:05 am

    Great post! Am looking to DIY a wireless trigger for my EOS with pan and tilt functionality using a couple of servos + FOB and came across this whilst having a sneaky on what other people have done. Thanks for taking the time to detail your project – saved me some time and effort. Ta

  5. TJ said,

    June 11, 2010 @ 7:30 pm

    Just in case anybody is worried about connecting this to their expensive camera (what ever the brand or model) you can use opto-isolators instead of the transistors above, that way there’s no electrical connection from the control board to the camera. No static shocks, no shorted wires, no worries.

  6. Avi said,

    July 10, 2010 @ 4:26 pm

    Thanks a lot for this!

    I had a clarification…….sorry of this sounds silly, but I am a complete noob at this.

    You mentioned that the red wire is +4V and the Green is +3V……but doesn’t the Arduino supply either 0 or +5V? Is that extra 1/2V safe for the camera?

    Also…do you have fuses in between the circuit and the camera to prevent over current?

    Thanks!

    Avi

  7. Maurice Ribble said,

    July 10, 2010 @ 6:10 pm

    Hi Avi,

    The +4 and +3 volts are supplied by the camera. In reality it doesn’t matter what these values are and they might even change between different Canon cameras. All you are doing is grounding or not grounding these cables.

  8. Herman said,

    October 12, 2010 @ 8:24 pm

    I’m a software guy, not a circuit guy. So I might be wrong on this. I realize the signals (pins 6 & 7) connect to the base on the corresponding transistor. But, the schematic isn’t labeled as to which pin is the emitter and which is the base. I tried to figure it out from the picture, but it appears that on the shutter transistor, ground connects to the emitter and on the focus transistor, ground connects to the the collector. Is one of the transistors backwards? If so, is it the one for focus? Or do I need my vision checked?

  9. Maurice Ribble said,

    October 12, 2010 @ 8:43 pm

    Hi Herman,

    I did this post a long time ago and there are multiple issues. One is what you pointed out. The picture is misleading, but the emitter should always go to ground here. So on the top transistor the emitter is on the bottom. On the bottom transistor the emitter is on the top.

    Another issue is that the base (pin connecting to Adreno should have a 1K resistor between the Aurduino and the transistor.

    I’ve done a lot of refinement on this design over time. I know make a kit (more info at http://www.cameraaxe.com). I’ve found it’s better to use optoisolators instead of transistors for flashes, but for cameras it doesn’t matter. You might want to google optoisolators if you’re curious or check out the schematic for the camera axe, but that schematic is pretty complex.

  10. Benson said,

    November 14, 2010 @ 5:04 pm

    Would you please tell me how you calculate the resistor that need for the base?

    and for another flash trigger, why you need 50 ohms in bottom? how you get this?

    Thank you very much!

  11. Maurice Ribble said,

    November 14, 2010 @ 5:42 pm

    Hi Benson,

    As I mentioned before you need about a 1k resistor going to the base. The way you calculate that is by seeing what base current the transistor uses and considering the max current the microcontroller can output in 40ma.

    I don’t know what you mean by 50 ohms unless you’re talking about a complete different circuit using optoisolation. If you are talking about that then you need to look at the current for the emittor in the optoisolator.

    Basically if you want to calculate these values you need to read the datasheets.

  12. Phlexib said,

    November 21, 2011 @ 2:20 pm

    Hi,
    Thanks for this tutorial.
    I just found this very cheap N3 connector remote on amazon. It’s all plastic I just received them,
    http://www.amazon.com/gp/product/B0032O4PTS/ref=oh_o00_s00_i00_details

    21 cents …

    Ben

  13. Phlexib said,

    November 21, 2011 @ 2:38 pm

    Just tried it. Works fine.
    Red wire is shutter
    White is ground
    Yellow is focus.
    As I don’t care about the focus, I will just not use it I think.

  14. DIY Pentax IR Lightning Trigger « New Hardpan said,

    February 27, 2012 @ 3:15 pm

    […] I had to add two 2N2222 switching transistors for the output to the camera shutter release so the focus pin would react and let the shutter fire. Maurice Ribble has a good explanation of that here. […]

  15. Piter said,

    November 19, 2012 @ 1:57 pm

    Could you say, how big si current on 7 or 6 from ardunio? is it 5V or less?

  16. Opendolly, primi passi | massMakers said,

    November 25, 2012 @ 3:47 pm

    […] Hobby Robotics: Camera Trigger […]

  17. Terence said,

    July 3, 2013 @ 6:06 am

    have a question…
    if my camera is eos 550d…the shutter cable how to connect….??
    thank you….^^

  18. Daniel said,

    August 12, 2013 @ 9:46 pm

    Hi, i have a Nikon D7100, will this guide work for that as well?

    // Daniel

  19. Mike Drews said,

    September 20, 2013 @ 10:02 am

    Hello, a great post. It is clear you know what you’re doing. I would like to know if you could give any help on using a PIR (motion detector) sensor to trigger a Canon EOS 5D with the N3 plug.

    Appreciate anything you could share that will help.

    Mike

  20. Didi said,

    September 28, 2013 @ 11:40 pm

    Why don’t you just take a phototransistor, a NE555 and an optocoupler to trigger the camera?
    Sorry, I never had a deep look into the problem ..

RSS feed for comments on this post