DSLR Laser Trigger (LDR based)

Hi,

I am very new to the Arduino community and have been working on my first project:

A laser beam is broken and the LDR "senses" that the light level has dropped below my specified value in the code. If the beam is broken, 3 pins go high that are connected to the shutter cable of my camera which in turn triggers the camera.

My question is: How do I set the 3 pins [pins 8,9,10 (digital pins btw.)] to HIGH for a specific amount of time for all 3 pins at the same time? e.g. beam is broken, pins 8, 9, and 10 go High for 10 seconds?

Thank you!

My code thus far looks like this:

int LDR = 0;
int LDRValue = 0;
int Light_sensitivity = 350; //set the sensitivity threshhold of the LDR, lower values = less light//

void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop()
{
LDRValue = analogRead(LDR); //the LDR is connected to an analog pin A0//
Serial.println(LDRValue); //this command allows you to "print" the light level using the serial monitor under the tools tab//
delay(100); //this is the delay in ms that the serial monitor updates the light level//

if(LDRValue < Light_sensitivity) //if light sensitivity falls below the value of X [as defined in line 3 (lase on LDR is about 900)] trigger occurs (8,9,10 are high)//
{
digitalWrite(13, HIGH); //13 is for the laser//
digitalWrite(8, HIGH); //8 is for the camera trigger//
digitalWrite(9, HIGH); //9 is for the camera trigger//
digitalWrite(10, HIGH); //10 is for the camera trigger//

}
else
{
digitalWrite(8, LOW); //when laser is on the LDR, No trigger occurs//
digitalWrite(9, LOW); //when laser is on the LDR, No trigger occurs//
digitalWrite(10, LOW); //when laser is on the LDR, No trigger occurs//
} }

You could pick three pins on the same port and use direct port manipulation.
But does it really matter if the three pins go high over a span of a few microseconds, bearing in mind the slow response times of LDRs?

Please remember to use code tags when posting code

Why 3 pins?

Mark

Thank you for your reply! The camera only triggers if all 3 wires "touch" each other at the same time. That's why I need 3 different digital output pins. I need them to stay on for a few seconds (so that the camera fires several shots during that time).

No, that doesn't sound like the right way to trigger a camera.

Usually there are 3 wires. One is ground. Connect that to your Arduino ground. Then the other two wires are the half-press and full-press of the camera shutter button. Some cameras will fire with just the full-press wire grounded but some will require the half-press to also be grounded.

If you aren't sure of the voltage of the camera or you want to be absolutely sure that the Arduino can't damage the camera then you can use relays or optocouplers. Tiny micro relays can be purchased that will run directly from an Arduino pin. I've used them for cameras successfully.

See below for a suggested schematic using an ILD2 dual optocoupler:

Awesome! I will have to look into that. I will let you know if it works. I still need to know how to write the code to keep the pins on HIGH for a few seconds.

Thank you