Nikon D70 infra-red remote control

This is a replacement for the sparsely available Nikon ML-L1 and ML-L3 IR remote controls. Like the original remotes, this very simple circuit allows you to remotely release the D70 shutter or do a bulb exposure while avoiding camera shake. It should also work with other Nikon (d)SLR's, provided they are supported by the ML-L1 or ML-L3. The IR sensor of the D70 is behind the round black plastic spot above the D70 logo on the body.

The circuit uses a PIC12F675 microcontroller from Microchip's PIC series. The PIC controllers are not exactly 'beginner' microcontrollers and don't allow writing versatile code for ("only 35 instructions to learn" is not a benefit, it is a crime! ;-)), but, the PIC12F675 was the cheapest (~$3) DIL-8 packaged 2.0V..5.0V microcontroller that my preferred local shop had in stock, and it suits the task (never mind the extra on-board ADC, comparator, or timers). The PIC12F629 should work as a direct replacement. Other PICs should work too, but you'll need to modify two or three lines in the code so the controller is set up properly (pins set for GP I/O and clock to 4MHz).




Parts required for the remote control:


Schematics:

The schematics are very simple and the circuit is quite easy to build. The lower schematic shows the full final circuit. The upper schematic contains the programming header and has information on which uC pins are needed for programming the chip. The pin header is for in-circuit programming and debugging, and can be removed from when finishing the remote control circuit. I don't know if there are any standards for PIC programming header pin assignments, so be careful if you use e.g. MPLAB ICD2.

A higher resistor value results in longer battery life but also decreases IR range. With 220ohm the range is ~1m, with 33ohm it is 4m or more. Like most LEDs, the IR ones are very directional, so the remote may be a bit tricky to use when holding it very close to the camera's receiver. A piece of diffusing plastic or glass could help.




Firmware:

The firmware must generate a 40kHz-modulated pulse sequence into the IR LED. Of course the sequence must be the correct one. The sequence is sent twice, with a ~63ms pause before repeating. Most of this info for programming I got from bigmike's D70 remote control page - he has a sketch of the pulse sequence, and AVR source code.
The pulses that need to be sent are:
ON
2250us
off
27600us
ON
650us
off
1375us
ON
575us
off
3350us
ON
650us
resend once
after 63ms
Because of the 40kHz modulation, 'ON 2250us' means that for 2250us the IR LED is toggled on and off at a rate of 40kHz, whereas 'off 27600us' means that the IR LED is completely switched off for this duration. The D70 does not appear to be picky about the timings (+- a few 100us here and there...), and even the modulation freq can be different from 40kHz (in fact it might even work without any modulation! as claimed by rhuang's Remote control for Nikon Camera).

The source code is for Microchip's free MPLAB IDE v7.20 (can be downloaded at www.microchip.com). As a side note, there seems to be at least one bug in v7.20 and the IDE initially doesn't find mplib.exe, so if it asks for it, that exe is found in C:\Program Files\Microchip\MPASM Suite\ or similar.

Here's the source code:
MPLAB project files and ASM source d70remote-mplab-proj.zip
Only the assembler source code main.asm
Precompiled HEX binarymain.hex

Updated on 4. Aug 05: restored the previously commented-out NOP's and added code to load the oscillator calibration data. Should work on all F675's now, without the need to add/remove NOPs.

More infos about how the program works you can find in the comments of the main.asm source code.

You can flash the PIC microcontroller using for example DL4YHF's WinPic and a small programmer circuit on the serial or parallel port. Be sure to first read in the PIC chip contents before programming it with the hex file, and note down the original oscillator calibration word (the last word in code memory, for example 0x3435) on paper or elsewhere as backup since you eventually might erase it by accident.

WinPic programmer download
WinPic site on qsl.net winpic
WinPic COM84 compatible serial PIC programmer circuit
I used the above COM84 programmer, but with 1n4148 instead of BAT42 diodes, and no 78L12 regulator section (just connected a 13.8V supply). Keep the programming wires to the PIC as short as possible!

The configuration word to use when programming the PIC is already specified in main.asm. Basically, disable everything except for the brown-out detect and power-up timer (to conserve more power, you might even disable both, and add a small 100nF ceramic capacitor directly accross PIC supply pins 1 and 8 to do the switch debounce). The clock is internal 4MHz with no clock output to any pin.

Be sure to use programming software like WinPic which backs up the oscillator calibration word of the PIC before it erases the memory.



(C) 2005 Jan Wagner - jwagner át cc hut fi