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.
Attachments
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);
- }
- }

Participated in the
First Time Author Contest
4 Discussions
Tip 8 months ago on Step 1
Just a tip guys =).
I'm a professional wildlife photographer and use lots of camera traps.
I strongly recommend using MANUAL focus. You have to focus on the hyperfocal distance of the desired lens you use. You don't want the camera to look for the focus and miss the animal =). That also saves you wiring, since you just need the shutter.
Hope that makes sense
Enjoy!
8 months ago
hi bud,
Looks really good! (there are few projects to Nikon...since most are for Canon). Just curious
where should I hook the cables coming from the camera?
Sorry for the silly question..
5 years ago
This is cool! What applications have you used this with?
Reply 5 years ago
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!