Tag: resistors
Jump in to arduino
by admin on Nov.17, 2010, under Arduino, Coding, Electronics
So i spent the next evening converting the proof of concept over for use with the arduino.
I have added some extra bits:
1) A button for triggering the shutter.
2) A button to Increase the shutter open time.
3) A button to Decrease the shutter open time.
.
.
Parts used:
3 x small push buttons.
4x (insert ohms here) resistors
1x long breadboard.
1x npn transistor.
A ton of hook up wires.
.
The buttons were pretty straight forward to hook up, which was nice. The trigger button is connected to pin 12, the “add time / up” button is connected to pin 7 and the “reduce time / down” button is connected to pin 6.
.
The code to run the buttons looks like this:
</code> /* simple program for setting my canon cameras shutter time. I do long welding glass exposures and this will come in handy so i wont need to hold the trigger down for too long. The arduino will do that for me. */ #define SHUTTER 13 // defines the shutter control #define TRIGGER 12 // defines the trigger button #define UP 7 // defines the +1 second button #define DOWN 6 // defines the -1 second button #define SECOND 1001 // defines how long a second is int curTime = SECOND; // sets the current time to be one second at the start of the program int val = 0; // this is the trigger button control int upButton = LOW; int downButton = LOW; void setup() { pinMode(SHUTTER,OUTPUT); pinMode(TRIGGER,INPUT); pinMode(UP,INPUT); pinMode(DOWN,INPUT); Serial.begin(9600); // open the serial port at 9600 bps: // so we can see what the arduino is doing //before we attach the lcd screen later. } // the loop function void loop() { // get the vars. upButton = digitalRead(UP); downButton = digitalRead(DOWN); val = digitalRead(TRIGGER); if (upButton == HIGH) { // adds one second on to current time curTime = curTime + SECOND; Serial.print("up button\n"); delay(200); } if (downButton == HIGH) { // removes one second from current time curTime = curTime - SECOND; Serial.print("down button\n"); delay(200); } if (val == HIGH) { // takes the photo. Serial.print("Shutter will be open for: "); Serial.print(curTime); Serial.print(" miliseconds\n"); digitalWrite(SHUTTER,HIGH); delay(curTime); digitalWrite(SHUTTER,LOW); Serial.print("shutter closed\n"); } // delays the loop for a tad delay(200); } <code>
You’ll see that i have my “SECOND” variable set to 1001. I have been running into issues where the shutter open and close time doesn’t match a correct one second interval…. Which is really strange…
Also because i have no way at the moment to display the information, i’m sending debug prints to the serial, so i can view it on the serial monitor.
.
I found a really good explanation about the canon 3 pin connect Im interfacing with:
.
To finish this project i have a few more steps to do:
a) Add another button to control the mode the device is in.
b) Get hold of a LCD to allow for real world use……
c) Refine the code, I’m still learning the api, so im sure i can clean this up a little and work out where my time is going.
d) Start to plan a durable storage case to house the project in.
.
Jumping in to electronics
by admin on Nov.12, 2010, under Arduino, Electronics
So i have finished reading, “Make: Getting Started with Arduino“ for the 2nd time. I have Gotten a few chapters though “Make: Electronics” . I decided to try and put together a quick proof of concept on the breadboard for the circuit i need to create in order to make the shutter open for a period of time and then close.
I have a Canon 40D as my primary camera, this is the one i use to for the long exposures.
So for my proof of concept, i opened my canon rs-80n3 shutter control to see how the wires need to be setup. I have three alligator clips which i use to connect wires to the bread board.
There are 3 pins on my canon 40d, shutter, auto focus and one to make the connection back to the camera.
Ive read that a lot of people use an optoisolater to to trigger the shutter. I couldn’t get that to work, so i ended out using an npn transistor. Then i could use a small current to trigger the shutter.
I have a 6volt battery pack connected for the power (4xAA). I have used a 22k resistor to limit the flow from the power rail to the transistor.
So when i turn on an off the 6volt battery pack the stutter opens, when i turn it of the shutter closes.
I also hooked up a button to test out, which worked too.
So what i get out of this….
I managed to get the shutter to open and closed based on whether there is a current passing through the npn transistor.
I got to learn about transistors, optoisolators and ohms…..
I didn’t fry my camera.
Some other pictures can be found at: