Hello all,
I have a small project (using arduino UNO) that I am doing where I need to activate multiple external camera flashs but depending on what number photo it is, depends on which flash.
photo 1 triggers flash 1
photo 2 triggers flash 2
and so on..
So I have the flashes connected to digital pins 2 through 9 via 3.5mm aux connections. I am using the flash sync port also through a 3.5mm aux connection into pin A0. My plan was to use this sync port the same way as a push button as all that happens is the camera closes the connection between the two parts. Now this works perfectly fine normally.
But the issue I'm having is that when I plug the USB data cable from PC into the camera the signal doesn't work. What seems to be happening is that the small current coming from the arduino gets "lost" (grounded) within the camera and doesn't make it back to the arduino for it to register the "button push".
I have tried many options including:
The default layout for a basic Push Button.
Having a seperate 5v current go through the camera to activate a transistor that then closes the circuit and acts like the pushbutton.
I even tried using an interupt. So instead of using pin A0 as the trigger I used pin 2 and moved the flash pins up one, long story short that didn't help either. I got the same result.
All of these work fine when the camera is not plugged in via USB, the issue is I need it to be plugged in as I am transfering the images from the camera directly to the PC because to save time explaining it just has to be that way because of the amount of cameras I will be using and images that will be taken.
Is there a better way of detecting a closed circuit on the arduino that isn't like using a push button?
I have attached my code but 1) its messy. 2) I don't feel its the code thats the issue its the hardware (wiring) side thats the issue.
I have also attached a schematic, really bad one but just to give an idea of the current setup. This works, but not with the USB in.
This video is a quick demo of it working to just trigger one LED and the issue thazt happens with the USB. DEMO VIDEO
thanks for the help.
const int buttonPin = A0;
int buttonState = 0;
int buttonState2 = 0;
const int FlashLight1 = 2 ;
const int FlashLight2 = 3 ;
const int FlashLight3 = 4 ;
const int FlashLight4 = 5 ;
const int FlashLight5 = 6 ;
const int FlashLight6 = 7 ;
const int FlashLight7 = 8 ;
const int FlashLight8 = 9 ;
const int ReadyLight = 12 ;
int iSets = 1;
int ButtonCount = 0;
int Duration = 90;
void setup() {
pinMode(FlashLight1, OUTPUT);
pinMode(FlashLight2, OUTPUT);
pinMode(FlashLight3, OUTPUT);
pinMode(FlashLight4, OUTPUT);
pinMode(FlashLight5, OUTPUT);
pinMode(FlashLight6, OUTPUT);
pinMode(FlashLight7, OUTPUT);
pinMode(FlashLight8, OUTPUT);
pinMode(ReadyLight, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(FlashLight1, LOW);
digitalWrite(FlashLight2, LOW);
digitalWrite(FlashLight3, LOW);
digitalWrite(FlashLight4, LOW);
digitalWrite(FlashLight5, LOW);
digitalWrite(FlashLight6, LOW);
digitalWrite(FlashLight7, LOW);
digitalWrite(FlashLight8, LOW);
digitalWrite(ReadyLight, LOW);
//digitalWrite(buttonPin, HIGH);
Serial.begin(9600);
delay(1000);
iSets = 2;
}
void loop() {
buttonState = analogRead(buttonPin);
if (buttonState >= 100) {
//digitalWrite(BusyLight, HIGH);
//digitalWrite(ReadyLight, LOW);
ButtonCount = ButtonCount + 1;
//************************************
if (ButtonCount == 1) {
digitalWrite(FlashLight1, HIGH);
digitalWrite(FlashLight2, HIGH);
digitalWrite(FlashLight3, HIGH);
digitalWrite(FlashLight4, HIGH);
digitalWrite(FlashLight5, HIGH);
digitalWrite(FlashLight6, HIGH);
digitalWrite(FlashLight7, HIGH);
digitalWrite(FlashLight8, HIGH);
delay(Duration);
digitalWrite(FlashLight1, LOW);
digitalWrite(FlashLight2, LOW);
digitalWrite(FlashLight3, LOW);
digitalWrite(FlashLight4, LOW);
digitalWrite(FlashLight5, LOW);
digitalWrite(FlashLight6, LOW);
digitalWrite(FlashLight7, LOW);
digitalWrite(FlashLight8, LOW);
}
if (ButtonCount == 2) {
digitalWrite(FlashLight1, HIGH);
delay(Duration);
digitalWrite(FlashLight1, LOW);
}
if (ButtonCount == 3) {
digitalWrite(FlashLight2, HIGH);
delay(Duration);
digitalWrite(FlashLight2, LOW);
}
if (ButtonCount == 4) {
digitalWrite(FlashLight3, HIGH);
delay(Duration);
digitalWrite(FlashLight3, LOW);
}
if (ButtonCount == 5) {
digitalWrite(FlashLight4, HIGH);
delay(Duration);
digitalWrite(FlashLight4, LOW);
}
if (ButtonCount == 6) {
digitalWrite(FlashLight5, HIGH);
delay(Duration);
digitalWrite(FlashLight5, LOW);
}
if (ButtonCount == 7) {
digitalWrite(FlashLight6, HIGH);
delay(Duration);
digitalWrite(FlashLight6, LOW);
}
if (ButtonCount == 8) {
digitalWrite(FlashLight7, HIGH);
delay(Duration);
digitalWrite(FlashLight7, LOW);
}
if (ButtonCount == 9) {
digitalWrite(FlashLight8, HIGH);
delay(Duration);
digitalWrite(FlashLight8, LOW);
//************************************
ButtonCount = 0;
//digitalWrite(ReadyLight, HIGH);
//digitalWrite(BusyLight, LOW);
}
delay(10);
//digitalWrite(ReadyLight, HIGH);
}
}

