Frenchy living in Egypt trying to do things!
I just finished to build a new project, a photogrammetry turntable controleed by Arduino, this is a link to the project
Now, I am not satisfied with both option for the camera trigger system (a servo pushong a button...or a HC06 based bluetooth trigger...)
The camera I want to use is a Nikon D300, and I plan to use the Nikon shutter release plug directly connected to the Uno to take the pictures.
Here is how it works on the D300 Side:
I use only 3 pins out of the 10 available.
Pin 6 = GND, pin 9 =AF, pin 4 = Shutter
When pin 6 and pin 9, Camera focus
Whe pin 6 + pin 9 + pin 4 are wired together, Shutter is released.
Being a bit of a noob when it comes to coding, I am seeking for help to modify the here attached code to use the release shutter cord instead of the HC06.
I understand that I have to attach the Nikon cable to the UNO, I have some GND pins available, and pins D3 and D13 are available...now when it comes to the code...I need your help!
Thanks for your time!
Here is the original code using the HC05/06 BT module:
not an answer to your needs but you can look at my small tutorial (in French - should be ok for you) on how to trigger a canon camera and possibly a flash
From my understanding, in the original code, i should replace this:
void takePhoto()
{
// Serial.println("Taking a pic");
_txData.command = CAMERAPRO_CAMERA_CONTROL; // The command.
strcpy(_txData.value, "capture"); // The value for triggering image capture as described in the API manual.
_etOut.sendData();
myBluetooth.flush();
// Serial.println("Took a photo");
// bip();
delay(500); // to allow for lag
}
void pullFocus()
{
// Serial.println("Focussing");
_txData.command = CAMERAPRO_CAMERA_CONTROL; // The command.
strcpy(_txData.value, "focus"); // The value for triggering image capture as described in the API manual.
_etOut.sendData();
myBluetooth.flush();
// Serial.println("Done focussing");
delay(500); // to allow for lag
}
void startVideo()
{
// Serial.println("Starting VT");
_txData.command = CAMERAPRO_CAMERA_MODE; // The command.
strcpy(_txData.value, "video"); // The value for triggering image capture as described in the API manual.
_etOut.sendData();
myBluetooth.flush();
//// Serial.println("Done");
// bip();
delay(500); // to allow for lag
}
void stopVideo()
{
// Serial.println("Stopping VT");
_txData.command = CAMERAPRO_CAMERA_MODE; // The command.
strcpy(_txData.value, "normal"); // The value for triggering image capture as described in the API manual.
_etOut.sendData();
myBluetooth.flush();
// Serial.println("Done");
// bip();
delay(500); // to allow for lag
}
by this:
void pullFocus
{
digitalWrite(focusPin, HIGH);
delay(500); // to allow for lag
digitalWrite(focusPin, LOW);
delay(500); // to allow for lag
}
void takePhoto
{
digitalWrite(focusPin, HIGH);
digitalWrite(shutterPin, HIGH);
delay(500); // to allow for lag
digitalWrite(shutterPin, LOW);
digitalWrite(focusPin, LOW);
delay(500); // to allow for lag
}
Have you tested the operation of the two lines without connecting them to the Arduino? If you connect the focus line to the camera's ground line, does the camera autofocus? And if you then also connect the shutter line to ground, does it take a picture? If not, then perhaps you have selected the wrong lines.
Also, it is safer to do this with transistors because the camera and Arduino have different power supply voltages. Do you have two NPN transistors, or perhaps two N-channel mosfets?
Yes, enough. But your diagram leaves a huge margin of uncertainty because it's a Fritzing mashup not a real schematic. So we can't tell if you have designed it with the right component connections. Your opto's have no input/output labels...
Here is the test Sketch I using the moment for testing....
// Simple test Sketch which should take one photo every 5 seconds after focusing....
void setup() {
pinMode(3, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
void takePhoto
{
digitalWrite(D3, HIGH);
digitalWrite(D13, HIGH);
delay(500); // to allow for lag
digitalWrite(D3, LOW);
digitalWrite(D13, LOW);
delay(5000);
}
}