Sometimes, it is necessary to trigger flash or turn on the light in the middle of exposure to avoid vibration caused by shutter opening and closing such as front and rear curtain trigger (or some might call it 1st and 2nd curtain trigger). So, a delay circuit is necessary to do this.

While others use classical analog circuit (Mike's), I decided to do it with digital approach. Trying to maintain DIY'ability, it seems that DigiSpark board from fellow Kickstarter project (which I forgot at first) seems to be good choice. DigiSpark is cheap on eBay, but I am not sure if they are licensed from DigiStump and these cheap boards seem to have some flaws (or even the original has them, too)

Nonetheless, it turns out the DigiSpark is the right choice and then some -- I can even shove a OLED display in. Construction of circuit is described in the code (see below), it is rather simple with some exceptions -- pin 1 of the board seems to be tied to the on-board LED, so it must be pulled up with a 10K resistor (1K in my photo as I could not find one). Another exception is that the cheap DigiSpark board is probably a rip-off one, its pin 5, the reset pin is still ENABLED for reset. I do not have genuine DigiSpark board (they stopped selling till May) to test, so if you turn the POT and change voltage to lower than 2.5V, the board resets. Oh well, that is life

Output (in the picture) is now an LED instead of a transistor to trigger flash (or other lights), but it should be easy to change.

One key idea is to use the POT to change the voltage on an ADC pin, in this example, the P5 (analog 0). By turning the POT, you are changing the voltage and the DigiSpark can read it and convert that to change amount of delay.

Code:

Code:

#include <DigisparkOLED.h> // DigiSpark OLED driver
#include <Wire.h>

// OLED I2C Slave address, this is important as different OLED might have different address
#define SSD1306_SA 0x78

// P0 is used for I2C SDA -- OLED Display
// P2 is used for I2C SCK -- OLED Display
// P1 is used for INPUT from camera or stack controller
// P5 is used as analog pin (analog 0)
// P4 is used as output to trigger flash or light

#define MAX_FLASH_DUR 200 // this controls how long the flash/lite is ON in milliseconds
// this is used to increase range.
#define MULTIPLIER 1
// this defines how often the POT is read
#define MAX_READ_TICK 30000

... Output (in the picture) is now an LED instead of a transistor to trigger flash (or other lights), but it should be easy to change.

One key idea is to use the POT to change the voltage on an ADC pin, in this example, the P5 (analog 0). By turning the POT, you are changing the voltage and the DigiSpark can read it and convert that to change amount of delay. ...

Hi Peter,
Very nice & compact design.
"... to trigger flash (or other lights)" - can be output signal length adjusted in order to control continuous light in this configuration ?_________________Saul
Studio, horizontal and field setups

Saul: yes, there is a define, MAX_FLASH_DUR, now it is set to 200ms, you can change it. But if you want dynamic ones, you can add another POT for it.

ChrisR: not sure what you mean by trailing edge, if you mean the edge going from low to high (normally, camera or other devices pulls input low and then high when released), then yes there is a reason -- if camera is in bulb mode or long exposure mode, you can not fire a flash in the middle as the camera will continue hold the signal low till it release the shutter.

For other purposes, you can comment out the "down edge triggered" and un-comment the "up edge triggered" to make the circuit respond to the edge when signal going from low to high.