Home

This is a brief summary of the high speed photography workshop I held for the 2nd birthday bash at The Edge

High Speed Photography…

is a technique for taking pictures of phenomena that are usually too fast to be visible to the human eye. Ever wanted to take a snapshot of a smashing window or exploding water balloon? This is where you’ll need the techniques described below.

In order to understand the required setup for high-speed photography, let’s first recall how a conventional photo camera works. When you press the shutter-release button on your camera, a mechanical system opens the shutter and the sensor or film behind the shutter (depends if you’re shooting digital or analog) captures light from the image you’re taking. The longer the shutter remains open, the more light passes through, hence the brighter your image gets. If the shutter speed is too high (i.e. short exposure time) or too low (i.e. long exposure time), the image will be underexposed (too dark) or overexposed (too light) respectively. Check out this site for more details about how a camera works. In the workshop we use a DSLR camera, but you can do high speed photography with any compact camera that allows you to manually set the exposure time. No, your iPhone will not work…

If you want to freeze moments in a picture, you would normally select a high shutter speed. However, depending on the speed of the object that you are trying to capture, the mechanical system of the camera might be too slow.
Therefore, in high-speed photography settings you can use a little trick: bypass the mechanical shutter, and freeze your image with a flashlight. The downside is that you need to be in a relatively dark environment with as low ambient light as possible.

What’s the Setup?

Set the shutter to long exposure, e.g. 5 seconds or longer (it doesn’t really matter as you are in a dark room and no ambient light is captured by the sensor anyways). Now the flash needs to be triggered at the same time the event happens. If you’re throwing lemons into a glass of water for example, and want to capture the moment of the lemon diving in and splashing water, you may be able to do this by manually triggering the flash. You will probably need a couple of test runs, but eventually you’ll manage to trigger the flash simultaneously to the event and get a nice shot.
If you want to play with different light/shadow effects, you’ll need to take that flash off the camera. Check out the “Lighting 101 Series” on the Strobist Blog , it’s probably one of the best and most efficient resources on the web to get started with flash photography. In order to trigger your flash in the manual scenario, I use the Yongnuo RF-602 Wireless Flash Trigger. It has great test results and is the best bang for bucks in amateur-photography world. You’ll find them on ebay for ca. 40 AUD a transceiver/receiver pair.

Arduino microcontroller with laser sensor gateFor capturing faster events, e.g. an exploding water balloon, it’ll be very hard to capture the event by manually triggering the flash. Therefore, you’ll need a microcontroller / sensor installation that fires the flash automatically when it senses an event. For the exploding balloon example, you would probably use a microphone to trigger the flash as soon as it hears the balloon exploding (find a great video tutorial here).
In this workshop I use a laser-light gate to sense when the object passes a particular spot (e.g. when hits the ground), and an Arduino microcontroller, an optoisolator and PC-synch cable to fire the flash automatically according to the laster-gate.
Check out this tutorial on how to control a flashlight through an Arduino, and further schematics and Arduino sketch to fire sensor triggered flash events. The video below shows the first development stage; the flashlight is triggered through an Arduino, by sending it a spacebar character through the computer’s serial port. Later the computer is replaced by a laser light-gate as a trigger input.

How do I Take a High Speed Picture?

  1. Make sure the ambient light is low, ideally you’d be in a completely dark room
  2. Set a 10 sec exposure time, and trigger the camera. You can set shorter or longer exposure, just make sure it gives you enough time to trigger the event that you want to capture.
  3. …for fast, but not very fast events: Trigger your event and your flashlight simultaneously.
  4. …for fast, really fast events: Trigger your event and make sure it crosses the laser light-gate to trigger, which will then trigger your flashlight automatically. In the workshop we used pegs and eggs falling on a table surface and mousetraps. If you use the egg/mousetrap combination, it’s a good idea to cover your sensor components and electronics…


Source Code

The Arduino code for this workshop is based on Maurice Ribble’s solution. This worked great. However, during setup times the light sensor continued doing it’s job and firing the flash every time something crossed laser gate. I added a little activation button on PIN 2 to activate the flash trigger when it is needed. Here is the extended code:


// Maurice Ribble
// 4-12-2008
// http://www.glacialwanderer.com/hobbyrobotics
// Activation-Button added: Mark Bilandzic, 23/02/2012

// This code is designed to to tune (see PRINT_MESSAGE define) and
// to run a sound sensor and a laser sensor. Both of these sensors
// Are used to trigger a flash. It should be easy to add additional
// sensors if you want.

// These enable the different types of triggers
#define ENABLE_LASER_TRIGGER
//#define ENABLE_SOUND_TRIGGER

// The threshhold values for the different triggers.
// These may need to be changed depending on evironment and sensors being used.
// Using PRINT_MESSAGES can help determine the correct value for these.
#define LASER_THRESHHOLD 800
#define SOUND_THRESHHOLD 100

// This prints messages to the serial port. This is good to enable while determining
// the threshholds for your trigger, but these communications are very slow and
// when using these sensors to actually take pictures this should be turned off.
#define PRINT_MESSAGES

// The digital pins being used
#define CAMERA_FLASH_PIN 4
#define LASER_PIN 5

// The analog pins being used
#define LASER_TRIGGER_ANALOG_PIN 0
#define SOUND_TRIGGER_ANALOG_PIN 1

#define BUTTON_PIN 2
boolean active_flash = false;

void setup()
{
pinMode(CAMERA_FLASH_PIN, OUTPUT);
digitalWrite(CAMERA_FLASH_PIN, LOW);
pinMode(LASER_PIN, OUTPUT);
digitalWrite(LASER_PIN, LOW);
pinMode(BUTTON_PIN, INPUT);

#ifdef ENABLE_LASER_TRIGGER
digitalWrite(LASER_PIN, HIGH); // Turn on the Laser
#endif

#ifdef PRINT_MESSAGES
Serial.begin(9600); // open serial
#endif
}

void loop()
{
int soundVal;
int laserVal;
int button_state = 0;

button_state = digitalRead(BUTTON_PIN);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (button_state == HIGH) {
active_flash = true;
Serial.println(“button pressed”);
}

////////////////////////////////////////////////////////////
// SOUND TRIGGER
////////////////////////////////////////////////////////////
#ifdef ENABLE_SOUND_TRIGGER
soundVal = analogRead(SOUND_TRIGGER_ANALOG_PIN);
//println(“Sound: ” + soundVal);
if (soundVal > SOUND_THRESHHOLD)
{
digitalWrite(CAMERA_FLASH_PIN, HIGH);
#ifdef PRINT_MESSAGES
Serial.println(“Flash Triggered!!!”);
#endif
delay(100);
digitalWrite(CAMERA_FLASH_PIN, LOW);
}
#ifdef PRINT_MESSAGES
Serial.print(“Sound: “);
Serial.println(soundVal, DEC);
#endif
#endif // ENABLE_SOUND_TRIGGER

////////////////////////////////////////////////////////////
// LASER TRIGGER
////////////////////////////////////////////////////////////
#ifdef ENABLE_LASER_TRIGGER
laserVal = analogRead(LASER_TRIGGER_ANALOG_PIN);
if (laserVal < LASER_THRESHHOLD)
{
#ifdef PRINT_MESSAGES
Serial.println(“Below Flash-Threshold!!!”);
#endif

if (active_flash == true) {
digitalWrite(LASER_PIN, LOW); // Turn off laser during picture
//delay(100);
digitalWrite(CAMERA_FLASH_PIN, HIGH);
//Serial.println(“Flash Triggered!!!”);
//delay(50);
digitalWrite(CAMERA_FLASH_PIN, LOW);
delay(500);
digitalWrite(LASER_PIN, HIGH); // Turn laser back on after picture

active_flash = false;
}

}
#ifdef PRINT_MESSAGES
Serial.print(“Laser: “);
Serial.println(laserVal, DEC);
#endif
#endif // ENABLE_LASER_TRIGGER
}

Advertisements

8 thoughts on “High Speed Photography Workshop with Arduino

  1. Pingback: High Speed Photography Workshop with Arduino : NICTA

  2. Pingback: Kennispresentatie #1 – Presentatie en bronnen |

  3. Pingback: Physics @ MHS » DIY high-speed photography

  4. Pingback: Exploding Water Bomb | cuestiondsegundos

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s