My lightning trigger works well with my 400D but not with my 7D

I have recently made a lightning trigger, added the code to my Uno and got it working on my 400D, however, after testing it, I tried it with my 7D and it doesn't work, I checked the cable connections and they work correctly, could it be the optocoupler I used ( 4N35) or something in the code. I am very new at this and don't really know how to write the code. The other problem is how can I send a signal to keep the camera awake between lightning strikes.

The code I have used is

// Lightning Catcher for Arduino
// Written by Uria Dubinsky
// www.udpic.co.il
#define poten A5 // Potentiometer Analog pin no. 5, for setting sensetivity
#define seLight A0 // Light Sensor Analog pin no. 0
#define shoot 10 // Optisolator Digital pin no. 10 for making the shoot
int ambient =0; // integer for the ambient light avrage keeping
int sensitiv, lastSens; // sensitiv integer for keeping the sensetivity levels value, lastSens integer for keeping the last light metring value
void setup () {
Serial.begin (9600);
pinMode (poten, INPUT); // Setting the pins modes
pinMode (seLight, INPUT);
pinMode (shoot, OUTPUT);

digitalWrite (shoot, LOW); // Making sure the shoot pin is LOW
ambient = analogRead (seLight); // insert a first ambient value
}
void loop () {
lastSens = analogRead (seLight); // Analog reading the light sensor
if (isSpike (lastSens) == false) { // Compering the ambient value for a spike in the light (through the isSpike function)
ambient = ((ambient + lastSens) / 2); // If there is no spike enters the value to the ambient avrage
}
else {
digitalWrite (shoot, HIGH); // If there is a spike in the light making the shoot
delay (20);
digitalWrite (shoot, LOW);
}
}
boolean isSpike (int sensRead) { // Function recive the value of the last light mesuring and return true for a spike and false for non
sensitiv = analogRead (poten);
if (sensRead <= ambient+sensitiv ) return false; else return true;
}

Thank you

If you have the 4N35 connected as shown in the diagram, I don't see how it could work for either camera. You have the "input" on the "output" side and vice versa.
Assuming that you do have it wired correctly, the most likely problem is that, as wired, the 4N35 can't drive the 7D but has enough to fire the 400D. Maybe it only has just enough to fire the 400D. Does it ever misfire - the LED lights but it doesn't take the shot?
If I were playing with it, I would first try removing the resistor-LED combination (which should be on pin 2 of the 4N35, not pin 4 as shown) and replace them with a 100 ohm resistor. If that fails, you might have to add a transistor instead to get sufficient drive.

Pete

On second thought, use a 150 ohm resistor. The absolute maximum rating for the 4N35 input is 50mA and the 100 ohm resistor would do precisely that. A 150 ohm resistor will allow about 33mA.

Pete

Thanks Pete,
I Took your advice, ensured the 4n35 was connected properly and replaced the resistor with a 150 ohm resistor and walla it works. I must admit I wasn't 100% sure of what I was doing as this is my first foray into electronics.
The only thing I need now is to put a line or two of code to signal the camera, every 10 minutes, to keep it awake.

Thanks again

Rob