Stereo Camera Flash Delay
For the stereo photographer
By Mark McAndrewThis page is to be updated soon! Keep checking back for the latest information.
How does it work?
The circuit detects the shutter release signal and then starts a delay timer before triggering a flash. The design incorporates a potentiometer to adjust the time delay. This enables the flash to fire at the right time regardless of camera model and flash combination.
Typical flash delay measurement showing shutter release trigger signal and then fire flash signal
The measurement was recorded using the Poorman’s oscilloscope
Circuit and program description
The circuit’s hardware is very simple consisting of only a handful of components. At the centre of the circuit is a microcontroller. The microcontroller (processor) has a number of ports, some digital and the others with analogue capability. The camera shutter signal is connected to a digital input, while the flash circuitry is connected to a digital output. An analogue input port is used to measure a signal that is utilised to calculate the flash delay. This input is connected to a potentiometer (variable resistor) to form a voltage divider which applies a variable voltage to the processor port. By adjusting the potentiometer, the flash delay time can be changed between 0-51mS.
With all the input/outputs connected, the rest of the operation of the flash delay is controlled by computer code. The code is called a “sketch”. A sketch is a high-level computer programming language that has a likeness to the C programming language yet remaining very simple. The Arduino IDE (Integrated Development Environment) program converts the sketch to machine instructions that the ATtiny85 microcontroller can understand to run the program. The program detects a negative voltage transition from the cameras shutter release signal. It then assigns a timing delay calculated by the voltage applied by the potentiometer. After the calculated delay expires, then a digital output signal is activated to apply a signal to the optocoupler. The output from the optocoupler then effectively closes the contacts of the electronic flash unit. After the flash signal, there is a delay period started. That delay allows time for the electronic flash to charge up again before it is possible to take another shot. Finally, to have confidence that the computer code is running, an additional digital output port is connected to the “activity LED” that flashes briefly every 5 seconds. The heart of the activity LEDs sketch component, is code that uses a special command called millis. If the normal delay command was used, then execution virtually stops for that command. In contrast, the millis command reads the processors clock value each pass through the loop of the code lines under void loop() statement. It checks the clock value to know if it is time to turn led on or off allowing continued execution of the stereo camera flash delay code.
Prototype testing results
Testing the stereo camera flash delay has revealed some interesting results. The understanding of the circuit’s operation was greatly demystified by using oscilloscope functionality. This functionality was created very economically by using a computers sound card and a very simple interface circuit. It is referred to as the “Poormans Oscilloscope”, based on a concept published by Rob Crocket. Whilst it is far from perfect, it does allow pretty good timing measurements. For more information. Link Here
Initially testing was conducted with a single SONY A5100 camera. It demonstrated that the concept worked but the results varied slightly between flash units. There were further differences after changing the flash power levels.
First round of testing - Single camera “pushing limits”
delay time = 21.26mS, YN660 power 1/16
Shutter speeds 1/125 ok... 1/160 ok... 1/200 ok ... 1/250 NG (bottom 3rd of frame not exposed by flash)
delay time = 21.26mS, YN660 power ¼
Shutter speed 1/160 ok ... 1/200 NG (bottom 1/8 of frame not exposed by flash)... second attempt 1/200 OK
The camera was moved by a couple of degrees pointing to a different subject
delay time = 21.26mS, YN660 power ¼
Shutter speed 1/200 ok... 1/250 ok... and again 1/250 ok... 1/320 NG (bottom half of the frame not exposed by flash)
delay time = 21.26mS, YN660 full power 1/1
Shutter speed 1/320 ok ... 1/400 ok ... 1/500 NG (half frame not exposed by flash)
delay time = 21.26mS YN660 full power 1/1
to a subject about one metre away.
Second round of testing - Stereo cameras tested
This round of testing was done on a more conservative basis compared to previous tests. Since the published flash synchronisation speed for the SONY A5100 is 1/160sec, it should be the safest test benchmark.
The potentiometer delay value was changed (for no particular reason) to 23.3mS (equating to a trimpot resistance WRT ground of 47.1KOhms) A single remote shutter release (Promaster) was connected via a diode network to two A5100 cameras. The flash delay circuit was connected to the shutter release wire from the Promaster remote. The A5100's were set to Manual mode with a shutter speed of 1/160sec. The YN660 test flash was set to mainly higher power levels during tests.
Over 95% of test shots with the flash delay were successful. Both cameras recorded complete frames exposed by the flash. That also included different subject distances and flash power ranges. For the couple of shots that failed to record a full frame, it seemed to be related to not allowing enough time for the Auto focus process to finish. (It seems that problem is the same issue as achieving accurate sync between cameras!)
Third round – checking the timing ranges for different flash combinations
The reason for this round of testing was to determine timing delay tolerances according to different flash types and power combinations. There was a curiosity about the best position for the potentiometer setting. The problem with the multi-turn potentiometer is that you can't visualise its actual position. It was important to get some idea what the extremes of the delay window times would be for a full “Flash exposure” on both frames of the stereo pair. To achieve the measurements, it required that the multi-turn pot was temporarily replaced with a conventional rotary one.
The measurement procedure:
Camera settings - Manual mode, shutter speed 1/160sec, ISO 100 and normal evaluative auto focus
The potentiometer was to set to a nominal position then the timing value result was checked. Once both frames were properly exposed by the flash, the pot was adjusted either side to check when partially exposed images would appear. These delay time extremes were recorded via the Poormans oscilloscope to determine the "effective delay range". See the summary of results below.
The single turn potentiometer possibly impacted the accuracy of the results. Its internal wiper on the carbon track would have a different resistance at the same position. This was evident when changing the position between clockwise and anti-clockwise movement!
The measurements prove that the average delay time varies slightly between different flash type/power settings! So, if you wanted to use different flashes you would need to determine a "sweet spot" to suit.
Field testing results
Timo was the lead for this testing. The first test using his favourite flash worked without having to adjust the trim pot. The circuit worked with the trimpot position as it was from factory!
This image was shot 1/160th, f8.0, ISO 400 using Timo’s Vivitar 1200 at the second weakest setting.
Note:-Flash synch become unreliable above 1/160th.
How to build the Stereo Camera Flash Delay
In general, this project is very simple, but only when it is finished!
The project will require patients and care along the way. You will need to apply some of your existing skills or be willing to learn new ones.
Also, before you build this project, it is essential to select/test and build the correct flash interface circuit suitable for your flash. Failure to do so may destroy the optocoupler. (Yes, you will need to read “flash considerations” in the hardware section!)
Going further – It is assumed the people that may take on this project may require additional background information. The information below is what was helpful in my own learning experience.
If you are comfortable with all these points, welcome to the exciting journey ahead!
There are many methods to program the Atmel ATtiny85 microcontroller. The device used for programming the Stereo Camera Flash Delay is a Sparkfun AVR programmer. This is a purpose build programmer which does not require any additional components. It plugs directly into your computers USB port.
Tiny AVR Programmer: PGM-11801
An ATtiny85 chip can be seen plugged into the programmer (left side)
What you will need –
The link to the “programmers hookup guide” is very comprehensive. It covers all aspects to both setup the computer software environment and to program the ATtiny85. The “hookupguide” is quite a long document. It covers many different circumstances and also has sections dedicated to troubleshooting. There is only one critical omission in the document. See the missing vital instruction step below.
Since both the computer and programmer setup instructions could be a little overwhelming, here is an overall summary of the main steps. (something that is not clear in the hookup guide)
The procedure to setup and use the PGM-11801 has been tested in both the Windows and a MAC computer. It takes some time to load all the required software, so be patient!
The hook-up guide’s missing vital instruction relates to making a one-off setting in the ATTiny85 which is essential for correct operation. In the Arduino IDE setup procedure, when you come to select your board type, processor type and speed, an additional step is required. Incidentally, make sure the programmer is plugged into the USB port with the ATtiny85 inserted in the socket!
The brief explanation follows: -
By default, a new ATtiny85's chip comes with its internal clock running a frequency set to 1MHz. The stereo camera flash delay software is designed to run with an 8Mhz internal clock. It is essential that you select 'Internal 8MHz' clock, and then “Burn Bootloader” from the Arduino IDE Tools menu. This operation changes what is referred to as a “fuse” called CKDIV8 - Divide Clock by 8. from value 0 to 1 (effectively disabling the divide by 8 from clocking).
The final step in software loading process is to load the Stereo Camera Flash Delay sketch.
Stereo Camera Flash Delay sketch Text file download here
The screenshots that have been included show only when the process is working correctly. It would be difficult to describe all the possible “twists and turns” in this document!
When you first start the Arduino IDE, you will see a screen like this.
Select and delete the existing lines of code, then paste the stereo camera flash delay sketch text file in its place.
It is probably a good idea to save the sketch for later use. The special tip when saving the sketch is that the filename must not contain any spaces!
From the main menu File > SaveAs
The sketch will be saved as an “.ino” file in your documents directory.
After pasting and saving the code, the next step is to verify the sketch code.
To start the “Verify”, click on the “tick” icon (top left) or from the main menu Sketch > Verify/Compile
The verify process uses the lower part of the screen and is very useful to see how the sketch is checked and compiled. If there are no errors, it will report the memory usage statistics relating to your sketch. In essence the compiler successfully translated the sketch into code that the ATtiny85 can understand and run. If any errors are reported, then maybe some syntax errors exist. Ensure that all the curly brackets at the bottom of the file are included.
The final Arduino IDE action is the “Upload”. This is where the code is actually uploaded (programmed) into the ATtiny85 microcontrollers flash memory. Make sure the programmer is plugged in before attempting the upload! The upload consists of two activities. It does the verification and compiling action (again) and then transfers the compiled binary code into the ATtiny85’s flash memory. The reason why the result reports “avrdude done”, is attributed to the underlying utility program to download/upload/manipulate the ROM and EEPROM contents of AVR microcontroller. The term AVRDUDE is an acronym AVR Downloader/UploaDEr. While we are explaining terms, AVR is Advanced Virtual RISC. The term RISC is Reduced Instruction Set Computer!
To start the “Upload” click on the “right arrow” icon (top left) or from the main menu Sketch > Upload
Remove the programmer from the computer USB port then the ATtiny85 chip can be removed from the programmer ready for use.
Building the hardware is relatively simple. The construction technique will depend on your own requirements. It is recommended, however, to use some sort of “breadboard” printed circuit board and cut it down to the required size.
Component side of the breadboard Printed Circuit Board
Copper side (solder side)
The circuit diagram is shown below.
For some constructors, seeing such a diagram and then trying to translate in to a physical layout could prove difficult. To assist, here is another version which may be more suitable to see a layout to suit a breadboard PCB.
Atmel ATtiny85 microcontroller
Optocoupler either 4N28 or MOC3021 (depending on the flash type)
100k ohm potentiometer (either multiturn or single turn) trimpot
2 x 560 ohm resistors
1 x Green LED (or any colour that you like)
3 volt battery such as 2032 button cell (could be any battery configuration that supplies 3volts)
1 x small switch (Power switch)
1 x IN4148 diode
1 x 8 pin IC socket (optional - but recommended for the ATtiny85)
1 x 6 pin IC socket (optional - but recommended for the 4N28 or MOC3021)
If using the transistor driver for the MOC3021, the following additional parts are required. (see more information under hardware variations)
1 x BC548 transistor
1 x 4.7K ohm resistor
1 x 100 ohm resistor
If you are using the MOC3021 without the transistor driver. (see more information under hardware variations)
1 x 220 ohm resistor
Hardware variations: Flash considerations –
Caution: You must first understand the type of flash to be used.
If you have looked at the original M-Sync circuit, you would have noticed that it uses the photo triac optocoupler (MOC3021). You might then ask why has a transistor optocoupler being used as a first choice. The answer is simple. When testing the first prototype, it was found that the flash would only fire once. Subsequent flash operation was only possible by breaking the circuit between the flash and the MOC3021 device. To overcome this situation, a change was made to a transistor optocoupler. The only issue is that photo transistor optocouplers can only tolerate low DC voltage as opposed to MOC3021 that is rated for 400volts peak DC or 280volts AC.
It is therefore important to determine the choice of Optocoupler flash connection, either photo transistor or photo triac output. If the “ready” indicator on the flash is a neon indicator, then it is more than likely a high trigger voltage flash. A high trigger voltage flash should not be used with the 4N28 optocoupler, the MOC3021 would be the best choice. If the flash has been manufactured in the last few years in the digital photography era, it should be low voltage at the hotshoe. Unlike using the MOC3020, the 4N28's connection to the flash is polarity sensitive, so it is important to also measure the polarity of the voltage.
A simple test is required to test the hotshoe terminal voltage of your electronic flash. This could also be referred to as the “open circuit voltage” of the electronic flash. It is preferable to use a digital multimeter set to a DC voltage scale. If your meter is auto ranging, just set it to DC. Alternately, manually set the meter to highest DC voltage scale. Turn the flash on and wait for the ready/charged light. Measure the hotshoe voltage with the meter connections shown in the diagram below. Some flashes have multiple pins, so make sure you test the right one! Make sure you don’t touch the terminals with your hands. Older flashes may have a very high voltage which could give you an electric shock! If the meter is displaying a low voltage, set the meter to a lower range to improve the measurement accuracy.
Hot shoe connection shown here is for a Nikon configuration
If the voltage is less than 20volts then the 4N28 optocoupler would be your choice. If the voltage is higher or negative, it would be more suited to using the MOC3021.
See the table of results below for voltages measured on the electronic flashes that were checked. They are mostly flashes built in the digital era of last 10 years. There is only one thyristor flash from the film days (Acheiver TZ250 that required the MOC3021 and transistor driver).
If you require more information and testing techniques for electronic flashes, this is a good reference link
To be very sure and gain confidence, you can construct any prospective circuit possibilities using breadboard. The advantage with a breadboard, it is possible to wire up without soldering any components. It is better to confirm the circuit before any disappointment when the flash does not fire.
prototype Stereo Camera Flash Delay on breadboard.
Test circuit to check the suitability of the 4N28 optocoupler
If there is a higher voltage or negative voltage then you will need to change the optocoupler to a photo triac MOC3021. If the flash is an older model such as a thyristor flash from the film days, the optocoupler will need a higher current to operate the internal LED photo diode. Whilst the ATtiny can supply a higher current to operate the photo LED diode, it is wise to use a transistor driver. If required it is possible to simultaneously use the 4N28 and the transistor driven MOC3012 together to provide both outputs!
It is also possible to use the same components/circuit details as used in the original M-Sync project. Change the 560 ohm to 220 ohm resistor for driving the MOC3021. Reducing the resistor value further is not advisable, use the transistor driver.
After reading this description, you may wish to try the photo triac as a first choice. Later subsequent testing of flash units reveals that the MOC3021 with 560 ohm resistor can trigger the Metz 24AF and Yongnuo YN-660 flashes. So, the choice is yours!
The hardware construction will take a little time, despite the simplicity of the circuit. It is recommended that you use IC sockets for both the ATtiny85 and the optocoupler. Solder the passive components first. This would include the IC sockets resistors, any wire links to interconnect different tracks and external wire connections. Then solder the active components such as the diode and LED.
After wiring is completed, check you work to make sure all connections and your solder joints between the components are correct. It is better to check your connections before applying power!
Prototype Stereo Camera Flash Delay using 4N28 optocoupler
If all the components are correctly connected, insert the ATtiny85 and optocoupler. Ensure that the chips are installed with the correct pin orientation. Turn on the power! If the activity LED comes on and then flashes every 5 seconds, then the ATtiny85 microcontroller is running. Next, connect a temporary switch with normally open contacts between the Isolation diode (k end) and the circuit ground. Connect your flash with the correct polarity. Switch on the flash and wait for the ready light. Click the temporary switch and the flash should fire!
Connecting the flash delay circuit to shutter release switch
There are some variations for connecting the stereo camera flash delay to your cameras. The methods shown have both been tested. The first is the conservative approach when using removable multiport plugs. The function of the diodes is to electrically isolate both the cameras and flash delay. Since both cameras and flash delay all operate from a 3 volt sources it is also possible to connect to direct wired cameras as well.
The very conservative way using diode isolation
Timo’s connectivity where there is direct wire connection between cameras.
In the original M-Sync design, this feature was not included. So, it is possible to omit the LED and resistor. But it sure does help when there are bad connections or checking for a depleted battery. Initially even Timo had reservations for its inclusion. But then he had a connection problem with his flash. He connected the activity LED to establish the problem was not with the ATtiny85!
Fixed resistor network for delay timing
If you only plan to use one type of flash, it is conceivable to use a couple of fixed resistors to replace the potentiometer. If you want a very small build, then this may help. It will require some experimentation!
that you have found the flash delay time sweet spot, you need to
disconnect the potentiometer before measuring, but making sure you
know which terminals were connected to + and -
To determine the resistance values, use digital multimeter: -
Select the best “preferred” resistor values with the combined resistance about 100K ohms
Limitations and issues
Timing variations due to different flash/settings
During testing and development, it was evident that the flash delay range (as set on the potentiometer) may vary according to different power levels set on the flash. When setting the potentiometer, you may have to readjust to find the sweet spot for all the flash power ranges.
Delay Timing variations as battery voltage reduces
There is a small problem with the design when the battery drains and the voltage is reduced. The voltage output from the potentiometer changes. This will impact the flash delay timing. It was found that the delay time reduced by 0.2mS. for a voltage drop from 3 to 2volts. The solution is to use higher voltage power source and use a 3volt regulator as was used by the original M-Sync project.
Problems with the Activity LED
Sometimes the Activity LED can remain on. This was a bug that I could not fix! It is suspected that it may be caused by the fact that the mills command runs on the chips internal interrupts system. It may occur if the activity led flash occurs near a shutter release signal. If it persists, turn the power off and on to reset.