Mirrorless camera as wildtrap

Hello all,
I'm new to this forum and this will be my first post.
So please be gentle if I make beginner mistakes.
Below you can find a description of what I want to achieve.
I'm sitting in a hide to photograph owls at night. Most of time I'm sitting there for 3 hours.
Because I need my sleep I was thinking of turning my systemcamera's (CANON R6 MKI and/or CANON R7) into a wildtrap. The wildtrap will be installed at the moment I decide to go home and get my sleep.

So I bought a PIR sensor and hooked it up with and arduino nano every.
I can read the sensor, activate the focus and shutter and take pictures . So far so good .
But at the moment I add an external flash things are going wrong.
The flash is firing after the shutter is alread closed. (The flash is needed for future projects)
So what I want to achieve is that the flash triggers at the same time as the shutter is activated.

I alread had a look to the millis() function and the examples of doing actions at the same time , but I have difficulty's to understand it . Setting up state machines is not something that I do often.
A second thing that I nottice is, if I take multiple shots the first shot is never in focus although I'm waiting enough. The following shots seems to be in focus
My camera is set in AI servo mode / single shot with mechanical shutter and eye detection for humans to test.

I'was thinking of writing to the port directly so that the pins are set at the same time as described in the link below .
https://docs.arduino.cc/learn/programming/bit-math/
It is unclear to me to which port the pins of the nano every are belong to.
So any advice is welcome here .

Below is the code .

//code begin
const byte shutter = 12;
const byte focus = 11;
const byte flash = 10;
const byte sensor = 16;
const byte LED_ACTIVE_PIN        = 15;
const byte LED_WAITING_PIN       = 14;

int focusTime = 500;    // delay to allow the camera to auto focus
int minTime = 2000;     // minimum time before a sensor re-trigger can initiate a sequence
int shots = 1;          // number of photos taken per trigger
int pause = 1000;         // mili secs between camera taking shots
int Flash_duration = 100; 
boolean PIR_triggerd =false;
int count= 0;
void setup() {
  pinMode(shutter, OUTPUT);       digitalWrite(shutter, LOW);
  pinMode(focus, OUTPUT);         digitalWrite(focus, LOW);
  pinMode (flash,OUTPUT);         digitalWrite(flash, LOW);
  pinMode(sensor, INPUT);
  pinMode(LED_ACTIVE_PIN, OUTPUT);
  Serial.begin(115200);
  digitalWrite(LED_ACTIVE_PIN, HIGH);
  delay(minTime);
}

void loop() 
{
 if ((digitalRead(sensor) == HIGH) && !PIR_triggerd) //first trigger
   {
     PIR_triggerd=true;
     Serial.println("PIR Triggerd");
     digitalWrite(LED_ACTIVE_PIN, HIGH);
     //delay(minTime);
   for (int i = 0; i < shots; i++) 
    {
       Serial.println(count);
       count++;
       //digitalWrite(LED_ACTIVE_PIN, HIGH);
       digitalWrite(focus, HIGH);
       delay(focusTime);
       digitalWrite(focus, LOW);
       digitalWrite(shutter, HIGH);
       digitalWrite(flash, HIGH);
       delay(Flash_duration);     // give enough time to activate the flash
       digitalWrite(flash, LOW);
       digitalWrite(shutter, LOW);
       delay(20);
       delay(minTime);
       digitalWrite(LED_ACTIVE_PIN, LOW);
       if (count == shots)
       {
        Serial.println("waiting for pir to become idle !");
        while(digitalRead(sensor)==HIGH)                      //now waiting for the PIR to  become idle again.
        {}                                        
        count = 0;                                            //reset counter of how much shots are taken for the next loop
        PIR_triggerd=false;
       digitalWrite(focus, LOW);
       digitalWrite(shutter, LOW);
       digitalWrite(flash, LOW);
       digitalWrite(LED_ACTIVE_PIN, LOW);
       delay(minTime);
        Serial.println(" PIR is idle");
      }//end if      
    } // end for
  }// end if loop
}// end loop 


Have you suffered a memory loss?

1 Like

Does that work reliably for owls? Just wondering. I imagine a lot of 'false positives' isn't much of a problem, so as long as it reliably triggers whenever an owl passes by, it should be fine.

Your code doesn't show a delay between tripping the shutter and triggering the flash.

What kind of flash unit do you use, and how have you wired it to the Arduino? Do you use some kind of remote trigger? Please show a schematic and some photos of the setup, and post details on the flash unit as well as any trigger system used.

Entirely superfluous.

Your shutter is open for 100ms. A digitalWrite takes, what, 4us? There's no way that the delay before the flash fires is caused by the time needed to execute the two consecutive digitalWrites.

If anything, you may/will be running into problems with the shutter delay itself. You trip the shutter and immediately fire the flash, but how much time does the camera need to open the shutter? It'll likely be in the tens of milliseconds range.

You can determine the shutter delay experimentally by photographing (with Arduini-controlled shutter) an LED that you turn on after a certain interval.

I would expect the flash to be edge triggered. Is it possible it's triggered on the falling edge?

A regular hot shoe or x-sync flash triggers as soon as its trigger pin is shorted to GND/side pin. Hence my question above to describe the flash trigger system.

But as I also said, I suspect the real problem is that the flash actually is over before the shutter even opens.

1 Like

It seems pretty confused.

There is a for-loop which, I first assumed, was supposed to trigger a number of frames to be taken when the PIR sensor gets activated.

But then I noticed the variable count which seems to be for a very similar purpose.

Can you please explain?

The count is there for debug reasons . I want to know how many shots where taken. it is just there to printt out through the serial monitor.
because in a previous attempt the camera was keep taking pictures even if the for loop was finished

I

Blockquote
Does that work reliably for owls? Just wondering. I imagine a lot of 'false positives' isn't much of a problem, so as long as it reliably triggers whenever an owl passes by, it should be fine.

I hope so . The OWLS are sitting on a branch. The cheap commercial wildtraps detect them .
There is continueous dimmed light shinning on them.

Blockquote
Your code doesn't show a delay between tripping the shutter and triggering the flash.

I tried that and you can easily see that flash triggers after the shutter is closed

Blockquote
What kind of flash unit do you use, and how have you wired it to the Arduino? Do you use some kind of remote trigger? Please show a schematic and some photos of the setup, and post details on the flash unit as well as any trigger system used.

I' using a speedlite 430EXII and/or speedlite 580EXII.
The flashes are triggerd with an external hotshoe that is connected to my controll box .The flashes are isolated with optocouplers. The schematic is a part of a dropcontroller that I made in the past.(I made the schematic and pcb but the program was not written by myself).

this is the complete setup


The white cable is connected to the PC.
The first cable at the bottom left is the PIR sensor.
The cable with the blue connector goes to the camera.
The cable on the bottom right goes to the flash.

Apperently I can't upload video's

and these are some real results but without PIR



s

2 Likes

Blockquote
But as I also said, I suspect the real problem is that the flash actually is over before the shutter even opens.

No that is not what I see. the flash comes after the shutter is closed.
I have a video of it but can not upload it.

Are those heat-activated like PIR sensors? Anyway, let's assume that the owls create enough of a warmth signature to trigger a PIR.

OK; looks fine, I see no source of delays there.

I don't see anything in your code or schematic that creates a delay between tripping the shutter and triggering the flash. Given the inherent shutter delay, the anticipated behavior is that the flash will fire before the shutter opens.

The delay of an old first-generation 430EX was around 50us: www.doc-diy.net :: Photo-flash druation and trigger lag measurements
That's a delay that's too brief to be humanly noticeable, so it can't be part of your problem. I assume the EXII isn't any slower.

Can you confirm you do not have the flash units set to 2nd curtain?

One thing you might test is to trigger the flash first and then the shutter, with a delay in-between. Test different delays in increments until you've got sync. Then work out based on this delay what's causing it.

Note that your schematic is technically incomplete:
image
This is why I asked

However, I suspect the little PC-sync block is 'transparent' in the sense that it just hardwires the center hot shoe and edge contacts to the PC connector. It shouldn't create a problem.

Try what @PaulRB hinted at and give a brief HIGH-LOW pulse (duration e.g. 20ms HIGH duration) to the flash contact ca. 100ms after you open the shutter and before closing it. Note that I suggest to make the flash trigger pin go LOW before writing LOW to the shutter release pin. In case for some weird reason I'm overseeing your flash triggers on the low-going edge, this should catch it. Again, if that's the case, I'm missing it, but it's easy enough to try.

Have you tried manually tripping both contacts without having the Arduino do it, using either push-buttons or some DuPont wires on a breadboard?

I will give it a try . But this will probably for the next days. the owls are calling me . need to go over there :wink:

no I'm reborn

I admire your patience! 3 hours sitting in a hut...holy cow.
Nice photos though!

Blockquote
However, I suspect the little PC-sync block is 'transparent' in the sense that it just hardwires the center hot shoe and edge contacts to the PC connector. It shouldn't create a problem.

Yes , it is transparent. It just hardwires the center pin of the hot shoe.

1 Like

Now, anybody doing this would normally plug the flash into the camera and sync with the shutter just like they did in 1932. Why aren't you doing the same??
Surely the Canon R6 has a hotshoe or a PC socket?

Today , I tried the following things :

  • manually tripping both contacts without the arduino doing it --> exposure not ok
  • Placed the flash directly in front of the camera so that I can see if the flash is visible in the pictures.
  • Playing with larger shutter speeds and going gradually faster There was no delay in the code between activating the shutter pin and activating the flash. (see code below)..I'm using slow shutter speeds in the order of 1/15sec so flash sync should not be the issue here.
digitalWrite(focus, HIGH);
delay(focusTime);
digitalWrite(focus, LOW);
digitalWrite(shutter, HIGH);
digitalWrite(flash, HIGH);
delay(Flash_duration);     // give enough time to activate the flash 100 ms
digitalWrite(shutter, LOW);

Settings camera :
Tried both the mechanical shutter and the electronic shutter first curtain with the same results.

flash settings:
Manual and full power.

shutter speed 0"5 sec --> flash triggerd -->flash visible in picture (overexposed).
shutter speed 0"4 sec --> flash triggerd --> flash visible in picture (overexposed).
shutter speed 0"3 sec --> flash triggerd --> flash not visible in picture !
shutter speed 1/4 sec --> flash triggerd --> flash not visible in picture !

so anything faster then 0"4 sec is not working .
where there is no flash visible in the pictures , the flash is coming after the shutter is already closed. It seems unlogical to me ( If I had to be Spock it might make sense to me).
see pictures below . The first one is without flash and is for reference purposes only.





That's a noticeable delay if you manually trigger the flash through your trigger setup, by simply contacting the input of the optocoupler (with series-R in place) to +5V. Do you notice this?

Your first 0.5 second picture shows an unlit flash; the second with identical text shows a lit flash. I assume the first pic is a mistake.

Also:

at least worth a shot. In fact, with a hot-shoe extender you can mount the 580 away from the camera and still use TTL as well as remotely triggering the 430 by using it as a master.

that was the reference shot without flash as mentioned in my post.

I'm not sure what you want me to do . Measuring with a scope?unfortunately I don't have a (digital)scope to my disposal .

Manually trigger the flash through your trigger system and just visually observe if there's a delay. The >400msec delay you're running into will be noticeable without any further tools etc.

Yes, a scope would be nice to trace the problem, but given this massive delay, you can actually observe it directly.

[quote="rsmls, post:17, topic:1261094"]
Also:

True but for example camtraptions has a system where it is possible so I want to have something familiar created by myself. The hooked it up with there wireless receivers.
https://store.camtraptions.com/collections/camera-traps/products/wireless-pir-motion-sensor?variant=15385707872339