Arduino Multiple camera trigger
AnsweredI am using Chameleon3 cameras in an application with a new software called Jarvis Mocap. This requires multiple cameras to be triggered synchronously using an Arduino Uno.
I haven't worked with Arduino code much before so is there any code already existing that I can load into the Arduino for sending out a 3.3 V square wave TTL signal for triggering the cameras?
-
Official comment
Hello Varun,
Please find below comments to your question.
"Is there a way to get it so that it is outputted through the ~6 point on the Arduino Uno?"
Yes, you can defined and configure more digital pins to trigger 6 cameras at the same time.
"Also is it possible to control the frequency and duration of each square pulse as well as the runtime for the code?"
The delay function (in milliseconds) control the frequency to trigger the camera. For instance, to run camera at 2 fps, I would set delay to 250 ms (i.e delay(250)).
"Alternatively is there a way for me to start the programme, the cameras get triggered and the frames grabbed at the desired frequency, and then I can stop the programme? "
One option is to implement push button or toggle switch in one of the digital pin. Please reference the example codes from Arduino IDE (i.e File >> Examples) and explore all the examples that come along with it. For instance, I would explore and edit "Debounce" example to control start/stop of the program with the aid of push button.
Please node, this question is outside our tech support. There is a lot of Ardiuno tutorials, programming guides, codes and projects out there. I would recommend to reference any of them to learn more on how to best implement this as per your project requirements.Here is another example to trigger 6 cameras at 5 fps .
const int pin3 = 3; // for camera 1
const int pin4 = 4; // for camera 2
const int pin5 = 5; // for camera 3
const int pin6 = 6; // for camera 4
const int pin7 = 7; // for camera 5
const int pin8 = 8; // for camera 6// the setup function runs once when you press reset or power the board
void setup() {
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
pinMode(pin6, OUTPUT);
pinMode(pin7, OUTPUT);
pinMode(pin8, OUTPUT);
}// the loop function runs over and over again forever
void loop() {digitalWrite(pin3, HIGH);
digitalWrite(pin4, HIGH);
digitalWrite(pin5, HIGH);
digitalWrite(pin6, HIGH);
digitalWrite(pin7, HIGH);
digitalWrite(pin8, HIGH);delay(100);
digitalWrite(pin3, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin5, LOW);
digitalWrite(pin6, LOW);
digitalWrite(pin7, LOW);
digitalWrite(pin8, LOW);
delay(100);
}Regards,
Ifeanyi Onah
-
Hello Varun,
Hereunder is example code snippet (edited from Arduino example code) that could be loaded to trigger the camera via digital pin 2.
const int pin2 = 2; // digital output pin
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 2 as output.
pinMode(pin2, pin2);
}// the loop function runs over and over again forever
void loop() {
digitalWrite(pin2, HIGH); // turn the pin2 on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(pin2, LOW); // turn the pin2 off by making the voltage LOW
delay(1000); // wait for a second
}Please note, as arduino delivers about 150 mA current, you may not be able to trigger more than 4 cameras in parallel.
I hope this information helps to proceed with your project.
Best regards,
Ifeanyi Onah
1 -
Hi Ifeanyi,
Thank you for this. Is there a way to get it so that it is outputted through the ~6 point on the Arduino Uno?
Also is it possible to control the frequency and duration of each square pulse as well as the runtime for the code?
Alternatively is there a way for me to start the programme, the cameras get triggered and the frames grabbed at the desired frequency, and then I can stop the programme?
Thanks in advance
Kind regards,
Varun
0 -
Thank you again.
For the CM3-U3-31S4C-CS cameras, what is the required voltage output through the pins from the arduino into the GPIO cables? While triggering the cameras, I don't want to give it a voltage too high or low. From the website, I think it was 3.3 V but I just want to be certain.
Thanks.
Regards,
Varun
0 -
Hello Varun,
We spec 0 - 24V operating range for opto-isolated output and non-opto-isolated GPIO line. The opto-isolated input ranges from 0 - 34 Volts. Please reference camera tech manual for details https://www.flir.com/support/products/chameleon3-usb3/?vertical=machine+vision&segment=iis#Documents
Therefore, 3.3 V from Arduino should be fine to trigger the camera.
Please note, camera ground pin should be connected before sending trigger signal to GPIO line.
Please let me know if the provided info answered your question.
Best regards,
Ifeanyi
0
Please sign in to leave a comment.
Comments
5 comments