• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

opto isolator

Not open for further replies.


New Member
I need some help with a very basic circuit.

I have a small gumstix computer with a GPIO port that I can vary from 0 power to 3.3 volts / 80milliamps.

This is the computer - Gumstix - dream, design, deliver

I need to use this port to trigger the push to talk on a walkie talkie.

I have purchased this board - SparkFun Electronics - Opto-isolator Breakout

I also bought a relay - SparkFun Electronics - Relay SPDT Sealed - Mini

I decided to try and build one step at a time as I do not know what I'm doing!

HEre is the back of the optoisolator board - http://www.sparkfun.com/commerce/images/products/09118-02-L.jpg

My plan was to plug the GPIO port to IN1 and a ground on the gumstix computer to GND on the optoisolator baord. On the other side of the optoisolator I would wire the OUT1 to HVG over the push to talk; thus setting the voltage on the GPIO port to 3.3 would result in transmitting over the radio. This does not work but here is what I did.

To test I replaced the radio with the dc motor from a hand held fan wired to a 9v battery. I replaced the gumstix GPIO port with 3 watch batteries which produce 4 volts / 80 milliamps (close enough :)

I started simple and hooked up the fan to the relay. I then used the 3 small watch batteries to trigger the relay. Success! The fan goes off and on. The relay works and is wired correctly.

I then took my optoisolator and tested it separately. I took the 9 volt battery and plugged into HV and HVG. Using my multimeter I get 9volts and maybe 2 amps across the HV to HVG circuit. Checking the OUT1 to HVG I get nothing.

I plugged in my 4 volt / 80 milliamp watch batteries to IN1 and GND. I still get 9V / 2A from HV to HVG, and now I get 9V / 80milliamps across out1 to HVG.

That sort of makes sense.

Now I am thinking easy enough. 9V / 80milliamps will trigger the relay so lets plug the relay into OUT1 and HVG. To my dismay, plugging the relay in drops the voltage to .5 volts on OUT1. I have no clue why this happens.

Next I thought... lets read the wikipedia article on a transistor and try putting one in front of the relay :)

So I wired the OUT1 to the base, emitter to HVG, collector to relay and relay ground to HVG. No luck.

I think I am close to solving this but just need a little shove in the correct direction.

This will be used for the telemetry system for a high altitude balloon.

Launch I Can’t Believe it’s Not NASA

My wife is thrilled with my project :rolleyes:


Well-Known Member
Most Helpful Member
Any chance of posting a sketch showing how you had it connected with the 'radio' and opto.?:)

Use the 'manage attachments' button lower down the reply window to post an image.


New Member
do I get points for worst diagram ever?

So with the ground for the relay removed I get 9 volts / 80is milliamps which is fine for the relay.

Ground the relay on the battery or the HVG and I get .5 volts so not enough to throw the relay.
Clearly there is something about the GND on OUT1 I am not understanding.
Last edited:


New Member
Interesting. If I use OUT1 as a ground and wire the other side of the relay coil to the positive on the battery it works as expected except backwards. When I apply power to IN1 the radio is off. When I remove power from IN1 the radio would be on and the relay closed.

I'll waste 3.3V / 80 milliamps per hour for the entire flight and the radio will be on while the computer is booting up so this is not ideal but it works.

Thoughts? Someone here can make sense of all this :)
Last edited:


New Member
looking at the schematic of the unit the signal in has to be hi in order to ground the base of yr output transistor which will turn that transistor off so the collector will be hi....remove the 10k resistors fit 1n4007 diodes in their place (anode to collector cathode to supply) and connect yr relay across the diode ....so if you ground the input side of the circuit via yr 220 r resisistor the opto output will swing hi and that will turn yr transistor on and switch yr relay iv included a schematic to show you the connections an also an alternative schematic which switches yr relay the instant you apply a signal(hi going) to the input....pay no attention to component refrences they were 4 my convenience when i quickly did the schematic for you


Last edited:


New Member
I'm only using one of the inputs. Looking at this schematic -

Can I hook the GPIO (3.3 volt source) to IN2 the gumstix (3.3V source) instead of IN1 and connect OUT2 to the base of Q2 (pin 8 of the opto-coupler).

Just one little wire to connect!

I got this suggestion from someone at sparkfun with the reasoning being - Without any drive (or logic 0) on IN2, Q1 will be on taking the base of Q1 to 0 volts (keeping Q1 off). When the processor drives IN2 to logic 1, Q2 turns off and Q1 will turn on keying the radio.


New Member
hmmmm.... it works. Its a son of a gun to solder to the tiny ping on the optoisolator but it works.
Not open for further replies.

Latest threads

EE World Online Articles