# Connecting one circuit to another via a transistor as a switch

I'm a software engineer, and know very little about electronics. I'm learning slowly, so appreciate your patience and kindness :) I will gladly return the favour someday.

I'm trying to build a circuit to release the shutter of a DSLR from a raspberry pi. Releasing the shutter is as easy as closing a circuit, the circuit is entirely contained within the camera. So, I have a camera, with two wires from a disassembled shutter release cable sticking out of it. When I touch those two wires together, the shutter fires. Great, now to do it electronically.

The schematic on the left is what I prototyped using an LED and the on the right is the same (?, we'll get to that) connected to the camera in place of the LED. The LED scenario worked fine, which was exciting, the camera... did not, regardless of the value of R4 - I started with a resistor I believed to be correctly calculated (2.6MΩ) and worked down in resistance until I was using no resistor, the shutter never fired. I've tested all the components and swapped them around diligently checking they all work and are connected correctly.

There are two major differences I can think of, if you understand these and can help confirm and explain, that'd be great. If you spot something else that is the cause of my problems, that's great too.

I can think of:

1) The grounds on the RHS aren't actually the same, one is the camera and the other is the pi. So I'm essentially connecting two circuits via the transistor, whereas on the LHS, I used the pi's + and gnd pins to create power the LED circuit, meaning this is a common ground? Does this make a difference? What should I be doing to connect two circuits in such a way?

2) The current in the camera circuit is very low, 68μA, maybe this isn't enough to cross the transistor C to E (way out of my depth here :) )? Details on the camera circuit can be found here: http://www.doc-diy.net/photo/eos_wired_remote/

• What was the voltage across the shutter when it wasn't firing? The site you linked seems to suggest that the shutter should fire if it goes below 1.8V – Cort Ammon Feb 9 '18 at 1:03
• Yes, I didn't quite understand that part either. As far as I can tell, the shutter circuit is open when it's not firing and I don't have access to the inside circuitry of the camera, so I don't have a way to measure any other voltage, beside the voltage across the two wires I have exposed from the shutter release cable (and when I do this is closes the circuit of course, and fires the shutter). – Matt Feb 10 '18 at 8:27
• Measuring the voltage fires the shutter? What's the resistance of your voltmeter? – Cort Ammon Feb 11 '18 at 1:55

I take it that you used an ammeter to measure the current when you shorted the wires to make the camera shutter operate?

In any case, I'd recommend the use of a small reed relay. If you want this to be very small, anyway. These come in tiny glass ampules and require a small coil wound around them. When you apply a current, the magnetic field closes the relay. It would work perfectly in this situation.

Here's a picture of one:

Reed relays come in enclosed modules, as well. These include the wound coil and detailed specifications, as well. They will be larger. So which you use will depend on your needs. These modules come in a variety of shapes, so I won't include an array of pictures here. You can look them up.

I have a box full of the glass ampule types and have no problems winding "magnet wire" around them to make a complete unit that does the job. So that's the way I'd go here. Driving the coil would be trivial for the MCU you have, as well.

What surprises me a little, though, is that there are lots of people posting up various ways to trigger the shutter for cameras. The above method I just mentioned is sufficiently general that it will work with any such camera.

Also, I'm not particularly liking the idea of an opto-isolator method. These work well in many cases. And I'm certain that there are lots of people using them for camera shutters with MCUs. But these are semiconductor devices and have some unique properties, quite different from a simple relay switch as shown above, that in some cases may require added attention to make work well.

So that's partly why I'd recommend keeping to a reed relay approach. It's bullet proof and quite general purpose and will serve you not only for this camera but for almost any other such camera shutter trigger without ever worrying later on. It just works. Period.

• That's a picture of a reed switch, not a reed relay. And using a relay or coil would still require the transistor setup. You do not want to drive a coil directly from the RPi gpio. – Passerby Feb 8 '18 at 20:51
• I have achieved the transister setup with an LED running from the power rail on the RPi - pins 2 and 6 here. So, I would run the coil right off that, using the transistor switch with base connected to a GPIO pin. The shared ground is already there in this case. I like this approach a lot if there's a reason not to connect the grounds of the camera and the pi directly (which I still don't fully understand why I would / wouldn't, but I'll put some research into this). – Matt Feb 8 '18 at 21:45
• @Passerby Good point. Since I don't think in English, at all, the central function and how it works is all I 'see' in my mind. It's all of a whole to me. But thanks for the clarification about wording. Appreciated. – jonk Feb 9 '18 at 3:13
• @Matt The reed switch, exposed to a magnetic field, simply "closes." No need to share any "galvanic" connections between the circuitry of the MCU/Rpi. You'd simply power an electromagnet, in effect, from the RPi side. That can be done easily with a BJT swtich you activate. – jonk Feb 9 '18 at 3:15
• @jonk this I understand, that's why I like this approach. But is there any downside to connecting the grounds of the camera and pi? I have now managed to make the circuit work, having connected the grounds of the two circuits and will go to the store today to get a reed switch and try this approach out. I think both approaches work fine for me, but if someone can help explain any advantages/ disadvantages of connecting two circuits' grounds together, that'd help me chose an accepted answer :) – Matt Feb 10 '18 at 8:24

The low current shouldn't be an issue (though that 2.6 Megaohm resistor may be, you want to saturate the transistor base, use a standard 4.7k of your ICE is low.). But not connecting the grounds would be.

If you don't want to connect the grounds, then use optocouplers instead. Avoids the ground issue and provides optical isolation.

• Thanks for the rapid response. 2.6MegaOhm was just what I first calculated based on the gain, but I did work that all the way down to nothing. Can you maybe explain a little about connecting ground? You give alternatives (which I'll research, since I don't know what they are), but why would I not want to connect the grounds? Are there cases where I would/wouldn't want to do this? – Matt Feb 8 '18 at 20:34
• Optoisolation is needed sometimes due to the difference in the circuit, or ground loops. An opto also tends to work better in these situations (based on reading, don't know the specific reasoning tho). The grounds need to be connected for transistors because of the difference in voltages, a common ground reference makes the two grounds equal. The current needs to flow back to its source. – Passerby Feb 8 '18 at 20:44
• @Matt as to the gain, yes, you may have calculated it based on the gain, but there is no harm in using more. For a switch, you want to saturate the base, which means giving it more current than needed. This ensures the transistor is in the saturation region where it dissipates less power, vs the linear region. – Passerby Feb 8 '18 at 20:47
• Also connecting the BJT's in emitter-follower configuration is not going to make them work like switches. – The Photon Feb 8 '18 at 21:55

Normally , Logic levels are defined by $V_{ih(min)} V_{il(max)}$ input high and low limits and input current and the camera may be no different.

Both of your schematics are current buffers where the voltage follows the input minus the Vbe of 0.65V.

Typically the inverting collector output is used as a switch to Emitter ground and input voltage depnds on your load current such that according to Ohm's law Ic/Ib = 20 or so. and not hFE.

Verify your camera contact voltage (Open) and current(closed) =68uA.

The camera uses a pullup resistor, so you wont need one. If 3.3V then R=3.3V/68uA ~ 0.05M (50k) So then if you drive the transistor base with 3~5V @100k~1000k range will be optimum value. (E=0V C=out) Then 0V input to release shutter.

simulate this circuit – Schematic created using CircuitLab

use twisted pair for input and output for noise immunity.