Hi! (My first post here)
I'm dealing with a bit of a head scratcher here...
My project consists of 10 LED's (12v 3W COB) that light up independently and in an ordered sequence (one after the other, turning off the last one). At the same time, while each LED turns ON individually a CANON camera takes a picture. (a technique called RTI if anyone's curious)
Specifically, when you start the program a single LED shines in order to get the user a chance to set up the camera (exposure, white balance, etc.) then, by pressing a push button on pin2, the sequence actually starts; going from digital pin13 to pin4; the camera shutter/trigger is connected to pins 0 & 1.
My setup is I guess a bit Overkill but here it is:
- x10 LED's
- x10 N-channel MOSFETS (IRFZ44N)
- x1 Arduino Uno
- x1 12v 3 Amp Power Supply (AC Wall adapter)
- x1 2.5mm Audio cable (for triggering the camera)
This PCB/Schematic shows the way the MOSFETs are connected to the LED's with their respective Arduino signals and power supply.
The CODE is fairly simple:
https://drive.google.com/open?id=0B9wLZtMtEUCiSUhkdjFnZGFiVEk
int i =13;
int estado, estado_ant, cont,valor;
void setup() {
for(i=13;i>=4;i--){
pinMode(i,OUTPUT);
digitalWrite(i,LOW);
}
pinMode(2,INPUT);
pinMode(1,OUTPUT);
pinMode(0,OUTPUT);
digitalWrite(0,LOW);
}
void loop() {
//botón (this toggles between "LED/Shutter sequence" mode and "single LED" (pin 9) mode)
estado = digitalRead(2);
if((estado==HIGH) && (estado_ant==LOW)){
valor= 1 - valor;
}
estado_ant = estado;
if(valor == 1){
for(i=13;i>=4;i--){
pinMode(i,OUTPUT);
digitalWrite(i,LOW);
}
for(i=13;i>=4;i--){
digitalWrite(i+1,LOW);
digitalWrite(i,HIGH);
digitalWrite(1,LOW); //shutter on
delay(4000);
digitalWrite(1,HIGH);//shutter off
delay(100);
}
}else{
digitalWrite(9,HIGH);//Single LED shines for camera setup/adjustments
digitalWrite(1,HIGH);
}
}
The actual issue is that for some reason MOSFET #9 (pin5) isn't turning ON at all. Everything else works perfectly as its supposed to.
I've tried the following:
- Adding 10k resistors to each of the MOSFET's Gates (to GND)
- Replacing the MOSFET (with a P60NF06)
- Revising my code (seems good to me)
- Checking my electronics (all connections are fine)
- Checking the actual LED (it works fine)
Nothing seems to work.
What am I missing?
Thanks in advance.
Edit: I meant 10k resistors instead of 100k
Edit: A kinda better schematic