Topic: This post is about measuring the reaction time of a (digital) camera. More precisely: The time difference between the trigger by cable release and the moment when the photo is taken.
What is this for? Precise timing for the water drop photography. Implementation of the time delay using different camera settings (without flash, with manual flash, with TTL-flash) in the code for taking the photo after the water drop passes through a light barrier.
The idea:
An object falls through the light barrier (like the water drop later on). This is measured by the voltage increase over the light sensitive resistor. The Arduino then immediately triggers the camera and a photo is made of actual position of the object. From the distance between light barrier and position of the object on the photo (and the speed of the object when passing the light barrier) the reaction time of the camera can be calculated, based on standard mechanics:
s = 1/2 g t^2 <=> t = ( 2 s / g ) ^ 1/2
with s: distance from the height from which the object is dropped to a) the light barrier and b) the position on the photo.
The difference in the times for a) and b) is the reaction time of the camera.
I found that the results I got were astonishing reliable (see the standard deviation) and ended up with the following values:
D700:
- Without flash (camera set to M and ISO was preset): 40,3ms (1.1ms standard deviation)
- With flash (preset to 1/8 strength) (camera set to M and ISO was preset): 46.1ms (1.1 ms standard deviation)
- With flash (TTL), camera was set to ISO auto and “P” program: 85,8ms (3.1ms standard deviation)
D200:
- Without flash, camera set to M, ISO was preset: 57.8ms (I just made 2 photos with exactly the same result, so I don’t give any standard deviation here)
- With flash (preset to 1/8 strength) (camera set to M and ISO was preset): 222,5ms (7,5 ms standard deviation)
The D200 with flash is significantly slower and cannot be used for my setup.
Required material:
Light source (see picture DSC_3027):
- 650nm Laser Diode Module: 5.99EUR at ebay. I bought mine at ether.deal. This diode uses 5V input. (I used an Arduino board to provide the voltage, since I had two of them).
- Arduino UNO (just because I was lazy. You can easily build up your own 5V power supply for the diode).
- 9V Battery block + power supply for the Arduino (from Conrad)
- a breadboard (from Conrad)
- 2 cables (from Conrad)
- several filters (colored plastic) in order to decrease the light intensity by the laser diode.
Central steering unit (see picture DSC_3025):
- Arduino UNO
- Light sensitive resistor (I used VT 83 N2 (THT) from Watterott). It had a resistance of 1.5kOhm in darkness and about 0 Ohm when the laser diode was directed at it.
- A 1.5kOhm resistance (as the light sensitive resistor in darkness).
- An optocoupling device (PC817). I had one in an Arduino Starterset.
- A cheap cable release for my camera. I bought mine at ebay from China for about 5EUR. As you are going to cut it, it should be cheap…
- 6 cables
- a breadboard
- USB cable
Other equipment (see picture “gauging”):
- lightning stands, clamps etc. to hold the laser diode, the photo resistor, a multivitamin tube and the filters to decrease the light intensity of the laser diode.
- a plastic tube from multivitamin pills (in order to release the object from a definite height and hit the light barrier below)
- glass beads (or any other small, but visible object to be dropped)
- laptop (as the interface to the Arduino program)
- Folding rule (Zollstock) (I attached mine to the ceiling)
Photographic equipment:
- Cameras & flashes you want to measure
- White background
- Tripod
Arduino sketch for the control unit (for the connections see in the Water drop photography section):
/* Arduino program to measure the voltage over a photo sensitive resistor and trigger a digital camera. Intention: Target is to measure the reaction time of the camera (i.e. time difference between trigger signal and moment, when the photo is taken). Some physics of the light barrier: Resistance in darkness: 1.5kOhm Resistance with laser diode pointing at it: ca 0 Ohm => use another 1.5kOhm resistance in serial. Use filters to descrease the light intensity until the voltage over the photo sensitive resistance is about 2V. */ const int pinCamera = 11; // Pin for triggering the camera float maxVmeasured; // maximum voltage measured during gauging time int cntiLoops; // counter for inactive time < 0s / gauging time 0s-3s / measuring time > 3s float triggerDeltaV; // offset to trigger the camera in V (over maximum voltage observed within gauging period) // the setup routine runs once when you press reset: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); pinMode(pinCamera, OUTPUT); cntiLoops = -3; // first 3 seconds: inactive, then 3 seconds gaugingm after that: measurements triggerDeltaV = 0.2; // trigger level in V about maximum voltage measured within gauging time } // the loop routine runs over and over again forever: void loop() { int currMillis = millis(); int duration = 1000; int lastMillis = millis(); int cnti = 0; float maxV = 0; float minV = 10; float sumV = 0; int cntV = 0; cntiLoops++; // < 0: inactive / 0-3: gauging / >3 measurements while (currMillis < lastMillis+duration) { // 1 seconds loop step // any input from the computer to steer the behaviour? while (Serial.available() > 0) { char h = Serial.read(); if (h=='p') triggerDeltaV = triggerDeltaV+0.05; // increase trigger level by 0.2V if (h=='m') triggerDeltaV = triggerDeltaV-0.05; // decrease trigger level by 0.2V if (h=='x') maxVmeasured = 20.0; // switch off if (h=='.') { cntiLoops = 0; maxVmeasured = 0;} // gauge yourself } /* Read the voltage over the photo sensistive resistor */ int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1023.0); if ((voltage>maxVmeasured+triggerDeltaV) and (cntiLoops>3)) { digitalWrite(pinCamera, HIGH); // trigger the camera delay(200); // this delay has no influence on the reaction time digitalWrite(pinCamera, LOW); // reset the camera trigger to 0 // print out the value you read: Serial.print("TRIGGERED!"); Serial.print(", Trigger="); Serial.print(maxVmeasured); Serial.println("."); cntiLoops = -3; // <0: inactive / 0-3: gauging / >3: measurement maxVmeasured = 0; // reset maximum voltage level for gauging } if (voltage>maxV) maxV = voltage; if (voltage<minV) minV = voltage; /* first 3 seconds: gauge yourself by finding the maximum voltage over the restistor */ if ((cntiLoops<=3) and (cntiLoops>=0)) { if (maxVmeasured < maxV) maxVmeasured = maxV; } sumV = sumV+voltage; // OLD cntV = cntV + 1; // OLD currMillis = millis(); } // print out the value you read: if (cntiLoops<0) { Serial.print("INACTIVE... "); } if ((cntiLoops>=0) and (cntiLoops<3)) { Serial.print("GAUGING... "); } Serial.print(", max="); Serial.print(maxV); Serial.print(", Trigger="); Serial.print(maxVmeasured+triggerDeltaV); Serial.println("."); Serial.println(""); }
The (dummy) Arduino sketch for the laser diode:
/* The Arduino is just needed as a 5V power source. */ int led = 5; // The 650nm Laser Diode Laserdiode Module is connected to Pin 5. // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) } // the loop routine runs over and over again forever: void loop() { delay(1000); // wait for a second }