Interval Shooting... for Nikon D3000 - Maybe others

August 27th, 2011
Interval shooting is an option of having the camera take a photo pause for a minute or whatever and take a photo and repeat, all while you do something else.

Now most entry level cameras don't offer this feature. But I just remedied it.

I have been working on a script to allow interval shooting on my D3000 (which doesn't offer interval shooting) using a freeware program called Powershell from Microsoft that resembles DOS (remember that first scripting tool from the 80's)

step 1
Download and install Powershell 2.0 from Microsoft

step 2
connect your camera via usb cable and start Powershell

step 3
enter these lines of code and hit enter after each one.
$dialog = New-Object -ComObject "WIA.CommonDialog"
$device = $dialog.ShowSelectDevice()
$device.Commands

step 4
now enter the loop and alter the timer in the code to your time and press enter to start.
function CountDown($waitMinutes) {
$startTime = get-date
$endTime = $startTime.addMinutes($waitMinutes)
$timeSpan = new-timespan $startTime $endTime
write-host "`nSleeping for $waitMinutes minutes..." -backgroundcolor black -foregroundcolor yellow
while ($timeSpan -gt 0) {
$timeSpan = new-timespan $(get-date) $endTime
write-host "`r".padright(40," ") -nonewline
write-host $([string]::Format("`rTime Remaining: {0:d2}:{1:d2}:{2:d2}", `
$timeSpan.hours, `
$timeSpan.minutes, `
$timeSpan.seconds)) `
-nonewline -backgroundcolor black -foregroundcolor yellow
sleep 1
}
$device.ExecuteCommand("{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}")
}

while (-1) {
write-host "Taking a photo....."
Countdown 1
}

step 5
let the computer do the work. (copy the code and paste into Powershell-to paste use right-mouse)

have fun with this. If it works with other cameras post it here and let us know.
November 24th, 2011
I was getting an error because of the ` and `r
Modified the code:
$dialog = New-Object -ComObject "WIA.CommonDialog"
$device = $dialog.ShowSelectDevice()
function CountDown($waitMinutes) {
$startTime = get-date
$endTime = $startTime.addMinutes($waitMinutes)
$timeSpan = new-timespan $startTime $endTime
write-host "`nSleeping for $waitMinutes minutes..." -backgroundcolor black -foregroundcolor yellow
while ($timeSpan -gt 0) {
$timeSpan = new-timespan $(get-date) $endTime
write-host "`r".padright(40," ") -nonewline
write-host $([string]::Format("Time Remaining: {0:d2}:{1:d2}:{2:d2}", $timeSpan.hours, $timeSpan.minutes, $timeSpan.seconds)) -nonewline -backgroundcolor black -foregroundcolor yellow
sleep 1
}
$device.ExecuteCommand("{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}")}


while (-1) {
write-host "Taking a photo....."
Countdown 1
}
Works great. Thanks.
Write a Reply
Sign up for a free account or Sign in to post a comment.