Introduction: Arduino PIR Motion Trigger for Nikon

In this project I wanted to capture elusive little creatures in the woods. Or catch my son stealing cookies! This project will work with most Nikon cameras on the market. I stress some tinkering may be required to gain the correct "trigger" and "Focus" wires coming from the cameras usb plug. You can buy usb plugs on ebay or the likes or if you have an old timelapse trigger to fit your camera then use that. Make sure you know you wont use the timer again!

The project is pretty straight forward and so is the coding.

Wire the 2 transistors in a darlington pair configuration and then just solder the wires to them.(I recommend you solder the transistors first to a strip board, then you can solder the wires to them without overheating transistors).

The PIR is easy bought for arduino from ebay at a few $ or £ if you are in the UK.

The sketch is attached to this project.

To adjust the distance the PIR detects movement just simply swap the jumper to H on the PIR board.

Simple and easy and works perfectly.

Hope you enjoyed this project and any questions message me below, Ill do my best to resolve any issues.

Step 1: The Code

#define FOCUS_PIN 6
#define SHUTTER_PIN 7 int pirPin = 10;

int calibrationTime = 20;

void setup() {

Serial.begin(9600);

pinMode(pirPin, INPUT);

digitalWrite(pirPin, LOW);

Serial.print("calibrating sensor ");

for(int i = 0; i < calibrationTime; i++)

{ Serial.print("."); delay(1000); }

Serial.println(" done");

Serial.println("SENSOR ACTIVE");

delay(50);

pinMode(FOCUS_PIN, OUTPUT);

pinMode(SHUTTER_PIN, OUTPUT);

digitalWrite(FOCUS_PIN, LOW);

digitalWrite(SHUTTER_PIN, LOW);

delay(1000); // May want to adjust this depending on shot type

}

void loop() {

  • if(digitalRead(pirPin) == HIGH){ digitalWrite(SHUTTER_PIN, HIGH); //Wake up camera after a long time of no movement ready to take picture if motion detected.
  • delay(200); //delay for time after wakeup, if motion is still detected picture is taken. digitalWrite(FOCUS_PIN, HIGH); digitalWrite(SHUTTER_PIN, HIGH); delay(200); //adjust as needed between shutter releases(1000 = 1sec) digitalWrite(FOCUS_PIN, LOW);
  • digitalWrite(SHUTTER_PIN, LOW);
  • }
  • }

Comments

author
tomatoskins (author)2015-10-16

This is cool! What applications have you used this with?

author
jay.navas.33 (author)tomatoskins2015-10-16

Only just started using it. Hoping to build an enclosed box for the DSLR camera to sit in. Beauty is The PIR can be used on an extended lead or use a wireless one, the connections will be the same on the receiving end of it. Thanks for comments!

About This Instructable

1,165views

17favorites

Bio: Computer graphics special effects artist
More by jay.navas.33:Arduino PIR Motion trigger for Nikon
Add instructable to: