Now I've got the human interface sorted, its time to sort the most important interface: The camera interface!
The interface to the Canon EOS 450D is a 2.5mm stereo jack (Slightly smaller version of a normal headphone jack). The tip of the jack provides the shoot trigger, the centre of the jack is the focus trigger and shield (bottom) of the jack is a common ground for both shoot & focus. Power is supplied by the camera itself, so all you have to do is close the connection between focus and ground to focus the camera, then shoot and ground to take the picture.
Because the camera supplies the power, we just need a pair of electronic controlled switches to perform the required focus and shoot function. The obvious solution would be to use a transistor to perform the switch function, however we don't really want to cross connect the camera to the Arduino power supplies, so we really need an isolating switch.
For this there are two choices: A relay would be the first choice, but relays are quite slow to switch, so in a project where the point is to react as quick as possible to a sound trigger, a relay would introduce too much of a delay. The alternative then is to use an opto-coupler. This is basically a LED and a photo-transistor mounted in an IC type package, thus creating an isolated switch. The device I am using is a KB827 dual opto-isolator, which gives me the two switches I require in a single 8 pin DIP package.
I also decided at add a couple of LED's to the focus and trigger outputs to give a visual indication of the camera triggering. Also, there is a 550 Ohm in series with the LED and opto-isolator to make sure we don't overdrive the Arduino pin output. During development, rather than connect to the actual camera and risk damaging it, I thought it would be a better idea to connect the photo-transistor side of the opto-isolator with another pair of LED's to give a visual indication that everything is working before connecting to the real thing!
I've also updated the software a bit to actually show the hot-keys as they are intended to be. The other thing I decided to do was to mount the display into a box becuase I the I2C daughter board on the back of the display was bending a bit and I was also getting a occasional missed characters when writing to the display. The ultra-observant will also notice that I finally added the 4.7K Ohm pull-up resistors to the I2C SDA/SCL lines.
The next updates will be mostly software to get the camera trigger control sorted. When complete, I should be able to trigger the camera with optional parameters for exposure time and also perform time-lapse functions.
....OK, so really the next step is to trigger the real camera ;-)
Sunday, March 22, 2009
Saturday, March 21, 2009
Debouncing Switches
Well, now I'm properly under way with the project :-)
The first job was to get the input sorted. The plan is to use a bank of four push switches which will align with hot-key style control's on the display. The first job here of course is to connect the buttons to the Arduino and recognising in software when a button is pressed.
The circuit for this is really quite simple. Firstly, we take the power supply from the Arduino via the power connector (J1) simply using the +5V (pin3) and Ground (pin4). The display (CLCD420-B/J4) is connected via the I2C bus provided via the Arduino analogue input (J3); The SCL signal is provided by analogue pin 5 and SDA is analogue pin 4. Both SCL and SDA lines are connected to +5V via 4K7 ohm pullup resistors.
The switches (J5) share a common +5V supply, then each switch is fed to the Arduino Digital (J2) pins 9 through 12 and to ground via 220K Ohm resistors. When a switch is open, the resistor is effectively disconnected and the Arduino pin is held low. Whent the switch is closed, the resistor ensures that the input pin is held high, while also restricting the current flow.
So the software should also be quite simple... only there's a problem... when you press a push button, the electrical connection is not simply on/off, but rather toggles rapidly during the on/off transitions. To get round this we need to wait for the input to settle at a constant level. So rather than saying the button is pressed the instant the input goes high, we say the button is pressed once the input has remained constantly high for a given time. This process is called "Debouncing".
In the test program, I simply read the button presses and toggle a state value with each button press and output the state (on/off) to the display. The debounce time used is 50ms, that is, the button must be held for 50ms in order to count as a press and toggle the respective state. I created a class for handling the debounce function, so the code need only instatiate the class for each required button/input pin; the constructor handles the pin initialisation, so no other initialisation is required in the setup() function. Software then only needs to call the respective Read() function for each pin.
The first job was to get the input sorted. The plan is to use a bank of four push switches which will align with hot-key style control's on the display. The first job here of course is to connect the buttons to the Arduino and recognising in software when a button is pressed.
The circuit for this is really quite simple. Firstly, we take the power supply from the Arduino via the power connector (J1) simply using the +5V (pin3) and Ground (pin4). The display (CLCD420-B/J4) is connected via the I2C bus provided via the Arduino analogue input (J3); The SCL signal is provided by analogue pin 5 and SDA is analogue pin 4. Both SCL and SDA lines are connected to +5V via 4K7 ohm pullup resistors.
The switches (J5) share a common +5V supply, then each switch is fed to the Arduino Digital (J2) pins 9 through 12 and to ground via 220K Ohm resistors. When a switch is open, the resistor is effectively disconnected and the Arduino pin is held low. Whent the switch is closed, the resistor ensures that the input pin is held high, while also restricting the current flow.
So the software should also be quite simple... only there's a problem... when you press a push button, the electrical connection is not simply on/off, but rather toggles rapidly during the on/off transitions. To get round this we need to wait for the input to settle at a constant level. So rather than saying the button is pressed the instant the input goes high, we say the button is pressed once the input has remained constantly high for a given time. This process is called "Debouncing".
In the test program, I simply read the button presses and toggle a state value with each button press and output the state (on/off) to the display. The debounce time used is 50ms, that is, the button must be held for 50ms in order to count as a press and toggle the respective state. I created a class for handling the debounce function, so the code need only instatiate the class for each required button/input pin; the constructor handles the pin initialisation, so no other initialisation is required in the setup() function. Software then only needs to call the respective Read() function for each pin.
Friday, March 20, 2009
Getting there
Well, not much progress lately. Its hard to start an electronics project when you don't have any electronic components! That has all changed today, since I just got a nice package in the post containing all the bits I need to get started. :-) How convenient its also the weekend, so maybe I'll also have a bit of quality free time to make a real start!!!
Watch this space!
Watch this space!
Wednesday, March 4, 2009
Well, the first parts arrived the other day, so I can finally start playing - How exciting :-P
First up, I got my first Arduino Duemilanove board (I actually got 2 boards, one to play with and one for the actual project!). It really is a very impressive piece of kit and incredibly easy to set up.
Within minutes I'd got the IDE downloaded and installed (that is to say, the USB drivers installed, the IDE is a standalone app that requires no installation!) and was running my first program to make the on-board LED blink! WOW! ;-)
Yeah, a very basic program but it does test that the board is working OK and is also a good demostration of how quickly you can get to work!
The next 'big' part of the project was the dispay device. This is a 4x20 character LCD display with I2C controller from Comfile Technology (CLCD420-B).
The display itself is actually a Palm Tech PMC2004E-SBLW display. The controller seems to be a custom built controller which actually uses an Atmel ATMega48 micro-controller (The 4KB version of the micro-controller on the Arduino board!).
I had originally intended to do some more example programs with the Arduino, but curiosity got the better of me, so immediately after the LED test program, I decided to hook up the display to the Arduino's I2C bus and set about that old favourite "Hello World" program. :-P
Again, simplicity in itself! Simply connect up the two I2C lines and the +5v and GND connections. Link in the Wire libraray provided by the Arduino IDE, then simply call the various wire functions to start sending strings. All in, probably only about 20 minutes to work everything out and get Hello World going!
First up, I got my first Arduino Duemilanove board (I actually got 2 boards, one to play with and one for the actual project!). It really is a very impressive piece of kit and incredibly easy to set up.
Within minutes I'd got the IDE downloaded and installed (that is to say, the USB drivers installed, the IDE is a standalone app that requires no installation!) and was running my first program to make the on-board LED blink! WOW! ;-)
Yeah, a very basic program but it does test that the board is working OK and is also a good demostration of how quickly you can get to work!
The next 'big' part of the project was the dispay device. This is a 4x20 character LCD display with I2C controller from Comfile Technology (CLCD420-B).
The display itself is actually a Palm Tech PMC2004E-SBLW display. The controller seems to be a custom built controller which actually uses an Atmel ATMega48 micro-controller (The 4KB version of the micro-controller on the Arduino board!).
I had originally intended to do some more example programs with the Arduino, but curiosity got the better of me, so immediately after the LED test program, I decided to hook up the display to the Arduino's I2C bus and set about that old favourite "Hello World" program. :-P
Again, simplicity in itself! Simply connect up the two I2C lines and the +5v and GND connections. Link in the Wire libraray provided by the Arduino IDE, then simply call the various wire functions to start sending strings. All in, probably only about 20 minutes to work everything out and get Hello World going!
Monday, March 2, 2009
The Idea
OK, so the blog title already kind of gives away what my idea is, but a little more info would be useful!
The idea is to trigger my Digital SLR camera from a selection of trigger sources:
An LCD display will be connected via the I2C bus and four push button switches will be used to control and setup the trigger. In addition to the external trigger mechanisms, it would also be nice to add a timer function to perform time-lapse photography i.e. take 1 shot per minute for 10 minutes, or more precise control of bulb exposures, i.e. 7.3s exposure time.
The camera to be controlled is primarily a Canon EOS 450D, however, the output will be more generic so that the system can be used to control other camera brands/models as well as external flash guns by using different cables.
The idea is to trigger my Digital SLR camera from a selection of trigger sources:
- Audio trigger - Make a noise and a photo is taken
- Light trigger - Break a light beam and a photo is taken
- Manual trigger - Press a button and a photo is taken
An LCD display will be connected via the I2C bus and four push button switches will be used to control and setup the trigger. In addition to the external trigger mechanisms, it would also be nice to add a timer function to perform time-lapse photography i.e. take 1 shot per minute for 10 minutes, or more precise control of bulb exposures, i.e. 7.3s exposure time.
The camera to be controlled is primarily a Canon EOS 450D, however, the output will be more generic so that the system can be used to control other camera brands/models as well as external flash guns by using different cables.
Subscribe to:
Posts (Atom)