/* Based on Arduino sketch for simulating a Canon RC-1 IR remote control to start and stop video recording on a Canon 5D Mark II or 7D 2010, Martin Koch http://controlyourcamera.blogspot.com/ Huge thanks go to http://www.doc-diy.net/photo/rc-1_hacked/index.php for figuring out the IR code. Modified by JustinHerx for accepting input from a remote (wired/wireless) and turning the output into an IR command to activate/deactivate video recording on a Canon 5D MII, 7D, 60D, etc. Parts required: - Arduino - Power LED (or switch with power LED, I am using an illuminated pushbutton switch from RadioShack # 275-0009) - Piezo buzzer (RadioShack #273-059) - 2.5mm jack to attach camera trigger - IR LED to trigger camera - Resistor for LED */ const int irLED = 11; const int SWITCH = 7; const int buzzPin = 8; const int powerLED = 4; boolean running = false; int ledState = HIGH; // ledState used to set the LED long previousMillis = 0; // will store last time LED was updated long interval = 200; // interval at which to blink (milliseconds) unsigned int pulseDuration = 10; //microseconds //The required 15 microseconds pulseDuration didn't work since digitalWrite consumes some additional time //thats adds to pulseDuration value. 10 to 12 microseconds worked for me. unsigned int photo = 7330; //A 7330 microseconds delay between bursts shoots a photo. unsigned int video = 5360; //A 5360 microseconds delay between bursts starts/stops video recording. void setup() { //Serial.begin(9600); // uncomment for debugging pinMode(irLED, OUTPUT); pinMode(SWITCH, INPUT); pinMode(buzzPin, OUTPUT); pinMode(powerLED, OUTPUT); digitalWrite(SWITCH, HIGH); //turn on internal 20 k pullup resistor so the open input state is HIGH. digitalWrite(buzzPin, LOW); digitalWrite(powerLED, HIGH); } void loop() { //run again and again if (running == true) // This part of the loop is to test if the camera has been triggered to record // and blinks the power LED while recording. { //Serial.print("running"); //uncomment for debugging //Serial.println(); unsigned long currentMillis = millis(); if(currentMillis - previousMillis > interval) { // save the last time you blinked the LED previousMillis = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) { ledState = HIGH; } else { ledState = LOW; } // set the LED with the ledState of the variable: digitalWrite(powerLED, ledState); } } if (digitalRead(SWITCH) == LOW) { //read switch input shoot(video); //start or stop video recording if (running == false) //detect the state of recording and invert it { running = true; } else { running = !running; digitalWrite(powerLED, HIGH); } piezoBeep(); //beep the buzzer to indicate that recording has started or stopped delay(500); } } void shoot(unsigned int delayBetweenBursts) { //sends the IR signal //send first 16 bursts for(int i=0; i<16; i++) { digitalWrite(irLED, HIGH); delayMicroseconds(pulseDuration); digitalWrite(irLED, LOW); delayMicroseconds(pulseDuration); } delayMicroseconds(delayBetweenBursts); //send second 16 bursts for(int i=0; i<16; i++) { digitalWrite(irLED, HIGH); delayMicroseconds(pulseDuration); digitalWrite(irLED, LOW); delayMicroseconds(pulseDuration); } return; } void piezoBeep(){ //beeps the piezo buzzer, once for start of recording, twice for end of recording if (running == true) { digitalWrite(buzzPin, HIGH); delay(250); digitalWrite(buzzPin, LOW); } else { digitalWrite(buzzPin, HIGH); delay(250); digitalWrite(buzzPin, LOW); delay(100); digitalWrite(buzzPin, HIGH); delay(250); digitalWrite(buzzPin, LOW); } }