Detecting pulse from camera flash port

Hello,

I want to use arduino to detect a voltage pulse (40-100ms, normally under 5V DC) coming from a camera flash sync port.

I use the following setup and code that work fine:

void setup() {
    pinMode(2, INPUT_PULLUP);
    attachInterrupt(0, flashChk, RISING);    
    Serial.begin(9600);
}
void loop() { 
}  
void flashChk() {
    Serial.println("Flash pulse detected");
}

Now I want to separate the two circuits with a 4N35 optocoupler in case the camera flash trigger voltage exceeds 5V.

So I use the same code and the following circuit.
When I test it with a 4.8V battery through a momentary switch it works fine.
But when I connect it to the camera flash port it doesn't work.

How can i make this work?

.

What is the value of the resistor on the LED input ?

I tried different value resistors from 50Ω to 1000Ω, made no difference.

Are you sure you get a voltage output and not just a contact closure?

Hi,
The internal pullup resisitance may nt be low enough for the opto transistor.
Place a 10K or 4K7 resistor from digital inout to 5V.
Don't forget the logic is reversed, a pulse from the camera will now cause a low on the digital input.

Tom.... :slight_smile:

Grumpy_Mike:
Are you sure you get a voltage output and not just a contact closure?

I think you're be right, it looks like it's just a switch!
Couldn't measure any voltage, just a tiny fluctuation ~6-7mV, but I thought it was because my crappy meter was too slow to measure the pulse.

I also tried TomGeorge's suggestion, didn't work.

The opto isolator is still a good idea. For a test wire up a battery and resistor in line with the opto's LED and thr camera's output see if it works.