Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Arduino high-speed camera trigger

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,043
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 4, 2011

Everything you need to know is in the video. Here's the Arduino code. Be sure to replace [less than] with the correct programming character (youtube doesn't like it in descriptions apparently?)!

/* Sense light incident on the photodiode. If the photodiode current exceeds a certain amount, turn the laser off. Wait, then trigger camera flash [I don't know how to do this yet] Wait more, then turn laser back on and make photodiode sensitive again. Let the potentiometer determine the delay time*/

// By Zack Lasner, May 4, 2011

int potPin = A1;
int detectorPin = A0;
int laserPin = 13;
int flashPin = 12;
int highPin = 8;
// Light level below which flash is triggered
int threshold = 50;

// Time to wait after flash goes off before turning laser back on
int shuttertime = 2500;

// Time to keep flash on
int flashtime = 1;

// For printing light level (to help aiming)
int counter = 0;

void setup(){
Serial.begin(9600);
pinMode(detectorPin, INPUT);
pinMode(potPin, INPUT);
pinMode(flashPin, OUTPUT);
pinMode(laserPin, OUTPUT);
pinMode(highPin, OUTPUT); // Start out with laser on and flash off
digitalWrite(flashPin, LOW);
digitalWrite(laserPin, HIGH);
digitalWrite(highPin, HIGH);
}

void loop(){
// Only stop checking the light sensor if the laser beam is broken
if(analogRead(detectorPin) [less than] threshold){ //Print out light level (to help aiming) Serial.println(analogRead(detectorPin)); // Turn laser off when threshold is breached
digitalWrite(laserPin, LOW); // Wait an amount of time determined by the pot
delay(analogRead(potPin)); // Trigger the flash
digitalWrite(flashPin, HIGH);
delay(flashtime);
digitalWrite(flashPin, LOW); // Wait for camera shutter to close
delay(shuttertime); // Turn laser back on
digitalWrite(laserPin, HIGH);
} // Display incident light level (to help aim)
if(counter % 100 ==0) Serial.println(analogRead(detectorPin));

counter++;

}

Category:

Science & Technology

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more