Controlling old cool pix from arduino

Controlling old coolpix from arduino compatible

古いCoolpixのリモートコントロール端子は、リモコンとの間でシリアル通信をする仕組みになっている。リモコンは「リモートコード MC-EU1」というたいそう高価かつ評判の悪いものであったそうだ。このリモコンのプロトコルは解析されている。
http://f4hla.free.fr/informatique/CoolpixProtocol.pdf
シリアルケーブルはもう手に入らないし、コネクタも一般的なものではないので、USBケーブルを切断して自作する必要がある。
http://delphys.net/d.holmes/photos/coolpix_e990/e990_usb_cable.html
USBケーブルはサードパーティ製のものがまだ手に入るようだ。僕はdealextremeから購入した。
ArduinoのシリアルはTTLレベルなのでCoolpixRS-232Cとは直接つながらない。写真では2SC1815を使った簡易レベルシフタ回路を使っている。今から作るのなら次の製品が手軽かもしれない。
http://akizukidenshi.com/catalog/g/gK-06464/
以下に示すスケッチはdigital 8がGNDに落ちると3秒間隔で3回撮影を行う。

Old coolpix digital cameras have serial port in their remote control connector. Protocol is described in the link below.
http://f4hla.free.fr/informatique/CoolpixProtocol.pdf
You can make a serial cable from a USB-camera cable. Instructions will be found in following page.
http://delphys.net/d.holmes/photos/coolpix_e990/e990_usb_cable.html
A TTL to RS-232C level shifter is needed.
Here is the sketch. It shoots pictures 3 times when digital 8 is connected to GND.

#include

const byte setCom[12] = {0x1B,0x53,0x06,0x00,0x00,0x11,0x02,0x00,0x00,0x00,0x13,0x00};
// set speed to 19200
const byte setReady[12] = {0x1B,0x53,0x06,0x00,0x00,0x11,0x02,0x00,0x00,0x10,0x23,0x00};
//Go to MC-EU1 protocol packet, switch LCD ON
const byte getReady = 0x06;
//
const byte halfPress[4] = {0x9B, 0x01, 0x1C, 0x1C};
//Half press the shutter button.
const byte fullPress[4] = {0x9B, 0x01, 0x7F, 0x1C};
//Full press the shutter button, take the picture.
const byte fullPressrelease[4] = {0x9B, 0x01, 0x7F, 0x7F};
//Release the shutter button.
const byte halfPressrelease[4] ={0x9B, 0x01, 0x1C, 0x7F};
//Half press release (unlock shutter button).
const byte zoomInpress[4] = {0x9B, 0x02, 0x1C, 0x1C};
//"Press" the zoom in button
const byte zoomInrelease[4] = {0x9B, 0x02, 0x1C, 0x7F};
//"Release" the zoom in button
const byte zoomOutpress[4] = {0x9B, 0x02, 0x7F, 0x1C};
//"Press" the zoom out button
const byte zoomOutrelease[4] = {0x9B, 0x02, 0x7F, 0x7F};
//"Release" the zoom out button
const byte ack = 0x86;
// acknowledgment
const byte hoe = 0x00;
// I don't know what this byte means.

const int rx = 10;
// software serial rx pin
const int tx = 11;
// software serial tx pin

const int sensPin = 8;
// sensor atattched to pin 8

SoftwareSerial mySerial(rx, tx);

void setup() {
Serial.begin(19200);

mySerial.begin(19200);
mySerial.write(hoe);

delay(2500);
Serial.println("initializing Coolpix...");
mySerial.write(setCom,sizeof(setCom));
delay(2500);
Serial.println("turning into MC-EU1 mode...");
mySerial.write(setReady,sizeof(setReady));
delay(1000);
Serial.println("Ready");

pinMode(sensPin, INPUT);

}

void loop() {

if (digitalRead(sensPin) == LOW) {
for (int i = 0; i < 3; i++) {
takePicture();
delay(3000);
}
delay(6000);
}
}

void takePicture() {
Serial.println("Focusing...");
mySerial.write(halfPress,sizeof(halfPress));
delay(500);
Serial.println("Shooting...");
mySerial.write(fullPress,sizeof(fullPress));
delay(500);
//Serial.write(halfPressrelease,sizeof(halfPressrelease));
mySerial.write(halfPressrelease,sizeof(halfPressrelease));
}