Canon SLR cameras have two ways of remote triggering: Either via wire, or via infrared.
A wire based remote trigger is very easy to build, you simply need a cable with a 2.5" jack connector and shortcut two of the three contacts. More details on blog.dbrgn.ch.
The other method – triggering via infrared – is a bit more challenging. There are a lot of cheap remote controls from China for around 10$, but building your own remote is muc more interesting...
First you need to find out how the protocol for the IR control works. Fortunately there's a post on doc-diy.net that describes the RC-1 protocol in detail. Summary: Send two bursts of 16 pulses each and get the timing right.
CasingThe casing was created using OpenSCAD and can be printed on a 3D printer. It is based on a Design by Ted Lin. The sourcecode for the case is on Github and Thingiverse.
The Atmel C code for the ATtiny is quite simple. In the main function first the I/O is initialized:
// Set up I/O
DDRB = _BV(PB1) | _BV(PB2) | _BV(PB4); // PB0 is input, PB1/2/4 are output
PORTB = _BV(PB0); // Pull-up for input PB0
Then unnecessary features of the microcontroller are disabled to save energy.
// Reduce power consumption
ADCSRA &= ~_BV(ADEN); // Disable ADC
ACSR &= ~_BV(ACD); // Disable the analog comparator
There is a simple function that starts the burst:
#define HPERIOD 0.01524
#define RATIO 0.4
#define NPULSES 16
#define LEDON 0b00010111
#define LEDOFF 0b00000001
null
void flash_led(void) {
for(uint8_t i=0; i<NPULSES; i++) {
PORTB = LEDON;
_delay_ms(HPERIOD);
PORTB = LEDOFF;
_delay_ms(HPERIOD);
}
}
null
The function is called twice, with a delay depending on whether the camera should trigger immediately or with a 2s delay. The two delays can be switched with the slide switch.
null
#define INSTANT 7.33
#define DELAYED 5.36
null
// Flash LED
flash_led();
if (PINB & _BV(PINB0)) {
_delay_ms(INSTANT);
} else {
_delay_ms(DELAYED);
}
flash_led();
null
Then the microcontroller is shut down to preserve energy.
null
// Power down
null
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_mode();
null
The entire code can be found on Github, including a Makefile.CircuitThe circuit is quite simple. By pushing the button the microcontroller is powered on, sends the pulses and shuts down again.
After several hours of development and debugging it finally worked. Here's the result:
Comments
Please log in or sign up to comment.