LucidEye
Posts: 83
Joined: Sun Aug 04, 2013 2:20 pm

Can GPIO be used for simple "pass through" on/off switching?

Sat Aug 17, 2013 6:45 am

Not quite sure if I am asking this question the right way... but I'll try my best to explain.
Can I use the GPIO to do simple "pass through" on/off switching?
What I need to figure out is can I use the pins on the GPIO DIRECTLY to open and close a circuit WITHOUT passing voltage from the Pi to the device I am switching on and off... or do I need to isolate my outside circuit using a relay?
The device I want to switch on and off is a DSLR camera shutter.
I just want to fire the shutter via the remote control port on the camera which uses a simple "make or break" switch... thus the camera is already sending voltage through the circuit so I do not want to feed the camera any extra/incorrect voltage from the Pi... rather I just want it to "pass through" the GPIO pins as they are switched on or off to complete a circuit.
I guess the other side of that coin is how much voltage from an outside circuit can the Pi handle safely, and for how long.
I am trying to do long exposure shots (night time-lapse) and need to turn on (open the shutter) for 60 seconds or more.
I can not do this via the USB "tethered mode" for the DSLR camera as the firmware only limits me to 30 second exposures via the USB port.
However, shooting in "bulb" mode and using the camera's remote port I can "manually" hold the shutter open for as long as I want... this is not the ideal way I want to control the camera, but I would have to buy a whole new camera to make it work with the USB control and I can't afford a new $1000 camera :-P
Thus why I want to use the GPIO pins as a simple "dumb" switch to fire the shutter from the remote port.
Can this be done safely, or do I need to build a relay board for this?
I thank you for any help and advice on this subject :-)

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: Can GPIO be used for simple "pass through" on/off switch

Sat Aug 17, 2013 8:49 am

You should indeed isolate you external shutter from the Pi pins.

A simple single transistor circuit would be enough.

You could use a simple circuit circuit like this one : http://www.dslrfocus.com/help/eoscable.htm

I'm sure google can find many others.
Memory in C++ is a leaky abstraction .

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Can GPIO be used for simple "pass through" on/off switch

Sat Aug 17, 2013 10:08 am

The camera is expecting to see a passive switch, open or closed.
The GPIOs produce a voltage with reference to 0v, either 0v or 3v3.

You can modify either the camera or the Pi to behave as the other expects.
Obviously modifying the Pi is easier - and cheaper if it fails - than modifying the camera.

So use a relay. But you may need a transistor etc. because the relay may not be drivable by the Pi.
Or use an opto-isolater. The cameras I've played with were happy with one of those, but your camera may be different

LucidEye
Posts: 83
Joined: Sun Aug 04, 2013 2:20 pm

Re: Can GPIO be used for simple "pass through" on/off switch

Sat Aug 17, 2013 2:26 pm

Not sure what you mean by the Pi may not be able to drive the relay. There are plenty of relay boards out there specifically designed for the Pi... they even have "shield" boards now that plug directly into the GPIO header.
I would assume those boards are designed with relays that use whatever voltage is coming off the Pi's GPIO to properly drive them.
And by transistor, are you referring to a solid state relay?

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Can GPIO be used for simple "pass through" on/off switch

Sun Aug 18, 2013 8:15 am

If you buy a relay board designed for use with the Pi, then it should work.
The designer will have made sure to choose a relay that the Pi can drive, or build-in the appropriate circuit (such as a transistor etc.) to drive the relay.

Only if you wish to build your own interface will you need to know the limitations of the Pi, such as its current and voltage drive.
You will also have to source a relay that will work within those limits - and most won't.
Or you can use a relay with higher voltage / current requirement, and put a transistor between the Pi and the relay.

The advantage of an opto-isolator is that the input side is just an LED, which the Pi can drive.
The disadvantage is that the output side isn't a proper mechanical switch made of bits of metal, so you may find the camera doesn't like it.

So buying a ready-made relay board is maybe your best bet, but won't be as much fun as building your own.
Unless you find building your own gets in the way of taking photos.

Return to “Interfacing (DSI, CSI, I2C, etc.)”