Go Down

Topic: Relay or optocoupler for controlling a camera shutter (Read 4786 times) previous topic - next topic



I ordered an arduino mega last week, and it is arriving tomorrow!  I looked through the project ideas page and I have a lot of things planned for it.

One of the first things I want to do is control the shutter on my point and shoot camera, to make it take a picture every 10 seconds, for making time lapse videos.  Unlike expensive SLR cameras, it doesn't have a jack to plug in a shutter control cable.  But I took it apart, and there are three contacts by the shutter button.  I assume one is ground.  And pressing the button halfway down probably connects one wire to ground to make the camera focus.  Pressing the button all the way down to take a picture probably connects the other wire to ground.

I found a page which explains how to do this sort of thing (link: http://openmoco.org/node/88 ).  Here is an image from that page:

The thing is, I don't have the optocoupler thing that it calls for.  And unfortunately, I live on a farm in the middle of nowhere, with the nearest radioshack about 40 miles away.  Since I would like to get my timelapse camera rig ready tomorrow, I would like to know if the optocoupler's functionality could be replicated by some other components I have on hand.

I have some small transistors from an electronics kit I had as a kid (both pnp and npn).  Could I make a solid state relay out of transistors somehow?  My dad also has some old VCRs, radios, and general electronic junk laying around.  Would any common electronic device contain a small relay, or maybe even an optocoupler, that I could use?

Thanks for the help guys!  Will probably be back with many more questions as I try different projects.


opto-coupler is best
a relay would certainly work, but there is a slight delay while it operates
don't forget to put a diode acrss the coil to stop the back emf from blowing the arduino/drive transistor

a transistor should probably work as well, but I've never tried that

have you measured the voltages on the camera?
that way you would know which way round to wire the transistor!
there are only 10 types of people
them that understands binary
and them that doesn't


Sorry to dredge up an old topic, but I finally made it to radioshack.  And, it turns out, they don't even have an optocoupler!  The guy that worked there didn't even know what an optocoupler is!  So I had to buy a relay instead.  They didn't even have a solid state relay, so I had to get a mechanical one.  Should have checked their website before I went.  I bought a couple of these, the smallest relays they had:


Now, the package says the nominal coil current is 89mA.  I assume this is the current required to trip the relay.  This is more than the 40mA  I can get from a digital I/O pin, so I will have to use a transistor to drive it from the arduino's 5V and Gnd pins, right?  And then, somewhere in there I need a doide to protect from back emf, like mmcp42 said.  I have some transistors and doides laying around, which I hope can handle 89mA.  Do I also need a resistor along with the transistor?

Also, out of curiosity, could I just have used a transistor as a relay, or does that only work if the load and control current have a common ground?  Since the transistor has only 3 pins and a relay has 4?  The camera's power source is completely separate from the arduino's.


you really need to understand the camera first.

I would bring those 3 connections out of the camera with 3 flexible small wires.  I would remove the camera battery, wait for 10 minutes or so, and then measure the resistance between the wires and push the button to both positions.  Find out what connection is the "common" and which is Focus and which is Shoot.  If the resistance when button is pushed is very low (say < 10 ohms) then it's a metal 'hard contact' switch. If it's some other resistance, you may have to duplicate that.

I would reinsert the battery and measure the voltage when the button is pushed and when it is not.
Then manually duplicate what the switch does by just connecting wires or connecting through a resistor. Does the camera do what you expected?

If you are lucky, there is one common connection.  If you are still lucky the voltage from 'common' to the other two connections is a positive voltage of 12 volts or less.  If those are true you can use two small NPN transistors as 'switches' to act as the button.

If so, connect the transistors:

- Emitter to arduino Ground and Camera Common
- Base through a resistor (say 220 ohms up to 2.7K) to arduino digital I/O pin
- Collector to the camera (other) wires.

Setting the Arduino pins 'High' should act like the switch closures.


You need to really understand the camera first...

Let us know what you learn...
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info


Thanks TerryKing.  When the button is not pressed, the resistances across the pins are in the mega-ohms.  When the button is pressed half way, the resistance from the focus pin to ground drops to less than 1 ohm (about 0.3).  When the button is pressed all the way down, the resistance between the "shoot" pin and ground drops to 0.3 ohm, and, the resistance between focus and ground also remains 0.3 ohm.

When the camera is on, there is 3.3 volts between focus/shoot and ground.  This drops to zero between focus/shoot and ground when the button is pressed halfway or fully.

So it sounds like it meets your requirements for just using 2 transistors to control it.  The focus and shoot pins share a common connection, ground.  Anywhere on the camera frame seems to work, as well as a number of ground pins on the camera circuit board.  And the voltage from shoot/focus to ground is only 3.3 volts.

One question about your transistor idea though.  Since both arduino ground and camera ground are connected to the emitter(s),  how do we know that current won't flow from the camera's focus/shoot pins to the arduino's ground, instead of to the camera's ground?  Would it be bad if current flowed that way?  This is why I suspected I would need a relay (with 4 pins) instead of a transistor (with 3).

And the resistor on the arduino I/O pin is required to give it a load, so that it is not just shorted to arduino ground, which would allow too much current to flow, right?

Thanks for the help guys!


OK, this sounds workable.. They are simple switches.  They are connected to ground for their focus or shoot function.

The camera and Arduino grounds need to be connected together. The (small) current that flows from 'focus' or 'shoot' usually travels to the camera ground. It will now travel through a transistor (when the transistor is 'on') and to the camera and Arduino grounds which are the same. 

Do you have any parts? Small NPN transistors, resistors, maybe diodes? 

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info


The receiver side of the optoisolator is a transistor.  The advantage of the optoisolator is that it guards against mistakes, but if you're careful an ordinary npn signal transistor will work too.

There cannot be any net current flow out of (or into) the camera.  If it were to lose or gain electrons, the voltage potential of the camera would change and pull/push the electrons right back again.


Do you have any parts? Small NPN transistors, resistors, maybe diodes?

Yes.  I have some parts from an electronics kit I had as a kid.  Maybe if I would have played with it more as a kid I wouldn't need so much help now lol.  10 small transistors (5 pnp labeled a833 sra, 5 npn labelled c1740 src).  Resistors ranging from 3.3 ohm to 1.5 M ohm.  6 switching diodes, and one each of rectifier diode, zener diode, and germanium diode.  And a variety of capacitors, a potentiometer, some LEDs, a photoresistor, and some basic IC chips.

I also have the two 5v 1A micro relays I got at radioshack.  My dad also has lots of old VCRs, radios, etc laying around, which I could tear apart.  The nearest radioshack is 40 miles away, but I get down there about once a week, and I can order stuff online of course.

Also, I had another idea.  Could I connect the wires to a standard SLR camera intervalometer, like this?:

According to the article I linked to in my original post, these plug in to the shutter port on an SLR camera, and just short focus/shoot to ground.  Cheap cameras like mine don't have a shutter jack, but could I essentially give my camera a shutter port, using the wires I soldered in there?  I will still use the arduino to save money, but I was just curious if that would work.

Thanks again!



Which camera do you have, Cjmdjm?

Fujifilm real 3d w3.  I have a few other point and shoots, but this one proved to be the easiest to disassemble.


OK, so what you need to do to operate the camera:

- connect FOCUS to ground to cause focus
- wait a bit
- connect SHOOT to ground to cause shoot.

I think all you need for each of these is a small NPN transistor and a resistor of 220 to 1000 ohms or so.

The transistors act as switches. The switch terminals are:
- (emitter) goes to GND 
- (collector) goes to foCUs or shoot

To turn the transistor ON, put current into its (base) by connecting base thru a 1000 or so resistor to an Arduino output.

Connect camera ground and Arduino ground together.

Let us know how this works out...
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Go Up