Hello, i have jerry-rigged a camera to turn on and off using the arduino. now i have achieved power-on status via (shutterpin, value) but once the initial settup has run its course the (shutterpin, LOW) command fails to turn the cammera off. it has (the camera) its own power supply and im reading a very low (4.5mv) current that i think keeps the circuit open and is the cause of my trouble. What can be done? what am i doing? why?
Thanks. I dont really know what the difference is but I tried digitalWrite instead and it works fine, except now I can only control the shutter or the power, If both are plugged in nothing works.
wild guess since we know nothing about your hardware, but it may be something that's activated by shorting a line to ground. If that's the case, you'll want to make the pins input to leave them idle, then make them outputs driven low to activate the target circuit, then switch back to input mode when finished.
The switches on the camera are just bridging a couple a connection, one for power, another for shutter. I have 7 grounded on the digital ground and 8 has no where to go so its analog ground. When 8 is plugged in, the power of the camera will somewhat turn on, but the camera will not turn on the flash or focus, thus will not take a picture. Unplug it and it will turn on... but I have no shutter.
int value = 20;
int powerpin = 7; // LED connected to digital pin 13
int shutterpin = 8;
void setup() // run once, when the sketch starts
{
pinMode(shutterpin, OUTPUT);
pinMode(powerpin, OUTPUT);
// sets the digital pin as output
}
void loop() // run over and over again
{
digitalWrite(powerpin, HIGH);
delay(1000);
digitalWrite(shutterpin, HIGH);
delay(3000);
digitalWrite(shutterpin, LOW);
digitalWrite(powerpin, LOW);
delay(10000);
1st, you should always be using an opto-coupler to interface between the camera and the arduino - you wouldn't want one frying the other. A 4N28 opto-coupler is an excellent choice (it's what I use for my cameras).
Use your pin and arduino's GND on the anode/cathode side of the 4N28. Now, instead of hooking up your arduino to the camera, look at what the power, focus, and shutter connect on the camera. Take the hot side of each connection and run it to a Collector pin on a 4N28, take the GND side and connect it to the Emitter pin. Repeat for each connection (i.e. one optocoupler per control). You should now find that your control is more reliable, and both devices are safe from each other.
FWIW, I run my pentax K10D this way, although I won't in any way crack it open and hack up the power =) I just use this technique for AF/shutter release via a remote cable.