Opto Isolator Programming

Hello,
I am new to Arduino and wanted to make just 1 project and I don’t have any programming skills.
I found a sound trigger that calls for a Panasonic AQW280EH optic relay and I have an LTV847 already that I would rather use. My question is can I still use the program as it was written or would it need to be rewritten? If it needs to be rewritten would someone point out what has to be changed? Here is what I have with the trigger:

56 lines (50 sloc) 1.75 KB

/* Audio camera trigger by Matt Richardson

This is a basic sound-detecting camera & flash trigger for Arduino.

Use a piezo element for the sensor (see http://www.arduino.cc/en/Tutorial/KnockSensor)

Use opto isolators (aka optocouplers) for the flash and camera triggers

Camera must be in BULB mode for shutter release to work

*/

#define BUTTON_PIN 5

#define CAM_TRIGGER_PIN 11

#define FLASH_TRIGGER_PIN 12

#define SENSOR_PIN 0

#define LED_PIN 10

#define STANDBY 0

#define ACTIVE 1

#define WORKLIGHT_RELAY 9

#define SENSOR_THRESHOLD 0

int mode = STANDBY;

// For best results, set flashDelayMS according to what type

// of shot you're doing. 0 seems best for balloon burst while

// 10 seems best for shattering glass. YMMV.

long flashDelayMS = 10;

void setup() {

pinMode(BUTTON_PIN, INPUT);

pinMode(CAM_TRIGGER_PIN, OUTPUT);

pinMode(FLASH_TRIGGER_PIN, OUTPUT);

pinMode(LED_PIN, OUTPUT);

pinMode(WORKLIGHT_RELAY, OUTPUT);

digitalWrite(LED_PIN, HIGH);

digitalWrite(WORKLIGHT_RELAY, HIGH); //turn the lights on

}

void loop() {

if (digitalRead(BUTTON_PIN) == HIGH)

{

mode = ACTIVE;

digitalWrite(WORKLIGHT_RELAY, LOW); // turn the lights off

delay(2000); // to give time for light to go down and settle after button push

digitalWrite(LED_PIN, LOW); // show we're ready

digitalWrite(CAM_TRIGGER_PIN, HIGH); // open the camera shutter

}

if ((mode == ACTIVE) && (analogRead(SENSOR_PIN) > SENSOR_THRESHOLD)) //

{ //If we're in ACTIVE mode and we sense a pop:

delay(flashDelayMS);

digitalWrite(FLASH_TRIGGER_PIN, HIGH); // fire flash

delay(50);

digitalWrite(FLASH_TRIGGER_PIN, LOW);

digitalWrite(CAM_TRIGGER_PIN, LOW); // close camera shutter

mode = STANDBY;

digitalWrite(LED_PIN, HIGH);

digitalWrite(WORKLIGHT_RELAY, HIGH); // turn lights back on

}

}
This is for a Christmas present and any help would be very much appreciated. Thanks for any help you can give me

The Panasonic part is a solid-state relay capable of switching over 300V. The other part has a transistor output. I don't know if it is safe to substitute. Probably depends on the other electronics which can't be deduced from the software.

Thanks here is the circuit. It has just the 4 resistor, 3- 4.7 ohm and 1-1m ohm. It doesn’t have the diode, transistor or power tail and will run on 9 volts.

Schematic_bb.jpg

I have seen another trigger that is using the LTV847 and worked on that circuit. Can I setup this circuit on a breadboard and test it with a meter for voltage out to know if it is able to protect the camera, assuming that the program will work with the opto-Isolator versus the optic relay?

Maybe the isolator was more to protect the Arduino from the voltages in the camera and flash. Can you measure the voltage across the connections on the two devices? Then measure the current through the switch. If your opto-isolators can handle the voltage and current they will probably work in this circuit.

I will need to build the circuit on a breadboard to check. Thanks for your help