Shop OBEX P1 Docs P2 Docs Learn Events
Optoisolators — Parallax Forums

Optoisolators

blakrapterblakrapter Posts: 38
edited 2006-07-12 01:32 in BASIC Stamp
Hello everyone,

I plan to isolate my stamp from a 12vdc source by using optoisolators.· I origionally planned to use a 4n35 simply because I found an example circuit on the Parallax site to step the voltage down and isolate the BS2 from a 12vdc source.· I went to Jameco to order some and discovered they have over 100 optoisolators/couplers.· Not all of them are 4n35s, but I don't know what to look for.· What specs do I need to look for when choosing such an isolator?· Is it really critical?

Also, I will need about 12 of these circuits for 12 inputs.· Does anyone make an array of these isolators·so I won't have to have 12 ICs, 12 resistors (all example circuits i have seen use a resistor), etc?

To give you a rundown on what this is for; I am programming BS2 for control of automotive accessories in a 10-15VDC environment· I plan to use:

12 12VDC inputs isolated with the optoisolators mentioned above
8 high current 12VDC outputs using DC-16 for relays, solenoids, etc
1 high current 12VDC motor control using a couple of·MOSFET transitors and PWM to drive a 25 amp 12VDC motor

Any obvious problems with this setup?· Am I missing anything?

Thanks!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-08 23:54
    Hello,

    ·· I don't know if these are still made, but this guy used a bunch of Optos in an Electric Car Battery Monitor.· He lists the part number he used for monitoring/isolating the 12V from the A/D converter.

    http://genki.home.ionet.net/BattMon/BattMonArticle.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-07-09 00:00
    Chris,

    Thanks for the info.· After I posted my question, I bumped around on Jameco's site for a little while and found these:

    http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=273607

    and

    http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=320830

    These look like they will work as far as having multiple isolators in a single package, but I am unsure about their electrical characteristics.· "Forward Voltage" and "Reverse Current" is just jibber jabber to my mechanical mind...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 00:43
    For the most part you need to know a few things...The Forward Voltage/Current...This applies to the LED, and you will need it to calculate the proper resistor to use on the LED side.· You will have to take into account the highest voltage (usually around 14.5V, assuming automotive application) that will go into the LED when choosing this resistor.· The formula will be:

    R = (VIN - VLED) / ILED

    This will give you the value of the resistor you need.· R = Resistor Value in Ohms.· VIN is the car voltage.· VLED is the Forward Voltage of the LED.· ILED is the forward current of the LED (No maximum, but nominal).

    The other thing you want (for ease of use) is an NPN on the output.· This will provide good interface to your I/O pin and, depending on the Opto may require only a 10K pull-up resistor.· I recently posted an Opto Diagram that is essentially the same as what's in the isolator.· See this thread...I hope this helps.

    http://forums.parallax.com/showthread.php?p=594783


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-09 01:23
  • steve_bsteve_b Posts: 1,563
    edited 2006-07-09 03:46
    Is there ever an issue with a multi-opto'd IC causing other channels to stop working?

    I certainly wouldn't try to put 32I/O's through a 32 opto isolated array (if one was produced).....I'm more apt to pair off groups of signals to isolate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 03:55
    Steve,

    ·· Since they're isolated it shouldn't be a problem.· Although I have to admit, all the ones I have used are single units, such as the classic TIL111...I think that was the part...age...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • steve_bsteve_b Posts: 1,563
    edited 2006-07-09 03:57
    I go with the dual opto's....
    To me, it makes more sense to spend $1 (or whatever) on 20 opto's and have to replace individual ones when they go, rather than paying $6 for a multi one and having to replace that whole multi-array when a single opto fails.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 04:15
    Steve,

    ·· Makes sense...I used 4 of the TIL111s before in one board, so...I certainly understand your point.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-09 10:29
    Yes! Consider their purpose [noparse][[/noparse]to die first].
    Of course, these are all DIP and in sockets. Otherwise, you find yourself with significant downtime.

    BTW, if the Stamp can drive an appropriate 5V relay via a darlington or FET, you can exploit the·'mechanical isolation' of the relay on the 12volt side.· The darlington or FET would likely be the failure component if their were a short circuit, so you achieve the same thing [noparse][[/noparse]protecting the BasicStamp], but without 'complete' isolation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 7/9/2006 10:36:12 AM GMT
  • blakrapterblakrapter Posts: 38
    edited 2006-07-09 15:20
    Thank you all of the help!

    Chris,

    You mentioned I will want a NPN for ease of use.· Why is this?· I think of everything as mechanical, but I thought a NPN transistor acts basically as a relay - apply voltage to the base and current and voltage flows through.· Thats basically the same thing I am doing with the optoisolator.· Why do I need to do it again?· Is it a polarity thing?· If so, why can't I change the polarity at the optoisolator collector?

    I am sorry for these questions that seem simple to everyone else, but I am SLOWLY learning.

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 16:18
    Correct, you could sort of think of it that way...But an NPN transistor switches the low side of circuit, whereas a PNP is made to switch the high side...It's too involved to get into (transistor theory)...Beau Schwabe has an excellent explanation somewhere on here (Beau?)· In any event, as you can see from the TIL111 datasheet it's an NPN output.· I think most are.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-07-09 16:58
    Chris,

    Thank you again for the info. I guess my real question is, why can't I use a BS2 input pin to read directly from the output of the optoisolator instead of sending it through the transistor to switch it from a high input to a low input signal? That is the purpose of the npn transistor, correct?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 17:04
    I think you misunderstood me...The transistor is built into the Opto...You have no choice but to read the output.· Most of the time this line is pulled high.· When the input is on the output is driven LOW.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • blakrapterblakrapter Posts: 38
    edited 2006-07-09 18:15
    Oh, hahahaha, I see what you mean now.· I origionally thought you suggested that I add a NPN transistor to that circuit that already contained one transistor built into the isolator, which is what threw me off.· To clarify, you suggested that I make sure the optoisolator I select utilizes a NPN transistor, not a PNP transistor, correct?

    Ok, to add another dumb question to the mix, I have found 2 different configurations of photoresistors (at least in the single packages).· One I know is an NPN, the other I think it is by looking at the arrow, but I am not sure b/c it does not say.

    1st one:
    http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=40985

    2nd one:
    http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=320813

    The first one is the standard optoisolator.· What is pin 6 used for?· It appears to be the base of the transistor, but isn't that supposed to be all contained internally and "turn on" only when the internal LED is on?· If so, will pin 6 just not be used in my circuit, or am I missing something?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 18:30
    You are correct...That is an external connection to the base.· You wouldn't be using that, but there are certain situations where you might need it for something.· In your case no.· That first one (4N25?) is an NPN output though.

    Okay the second one is NPN as well.· And easy way to remember by the diagram (This is how I learned) is that the arrow always points to the N channel and is always the emitter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-07-09 18:45
    Thanks Chris,

    In the case of using an Opto-Isolator, the NPN vs. PNP preference sort of gets tossed out the window. This is primarily due to the isolation of the transistor "gate".
    You can think of an Opto with a transistor output (NPN or PNP) as a "gated" diode. When the transistor is "ON" (Input LED is ON) the connecting circuit sees a
    diode across the C-E junction. When the transistor is "OFF" (Input LED is OFF) the connecting circuit sees an open circuit.


    The problem with using a PNP is when you do NOT have gate isolation, and you have to consider that the B-E junction acts like a diode regardless of the transistor
    being turned ON or OFF. The main concern only happens if you are trying to switch different supply voltage levels.


    The link below explains this a little bit...

    http://forums.parallax.com/showthread.php?p=552069

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 19:22
    Beau,

    ·· Yeah, I don't recall ever seeing a PNP-based opto...Nor have I used one, so I don't really have any experience with their usage, although, as the OP linked, some have the base brought out to a pin and can act as a standard transistor on the output side.· I believe we used the base lead in a few applications to sort or pre-bias the output to a certain level when no input was present.· Being the transistor guru we should get a tutorial by you and make it a sticky thread in the Sandbox or something.· =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-07-09 21:09
    The tutorial sounds like a good idea Chris, let me think about it for a little bit.

    On the Opto usage note: I have used DigiKey's 25xx and 27xx series Opto's in the past with satisfying results....
    And as a side note, at least on the Quad Opto versions, if you blow the LED on the input or the transistor on the
    output, the other Opto's "seem" to be unaffected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • blakrapterblakrapter Posts: 38
    edited 2006-07-09 22:05
    Thanks guys, you are awesome!
  • Rob7Rob7 Posts: 275
    edited 2006-07-09 23:25
    Blakrapter,

    Here is a curcuit I find works great for my experiments, You can use PNP Proximity, NPN Proximity,Open Collector Photo-Transistor or a panel switch by jumpering the selected header. I am currently useing this for my Propeller Tru PLC functionality project. The output is 24vdc and can handle 1 amp. The drawnings were created on Express.PCB. My labtop motherboard died last week so I only have hard copies of my paperwork until I can get my labtop repaired or the hard drive copied. The Input board is 5 volt input, with the output·you can change the resistor for any voltage you need.

    Enjoy,

    Rob7
    2338 x 1700 - 163K
    1552 x 1164 - 366K
    1700 x 2338 - 170K
    2338 x 1700 - 324K
    1700 x 2338 - 158K
  • Rob7Rob7 Posts: 275
    edited 2006-07-10 22:19
    Blakrapter,

    A Pic Of my Output PLC 24V board. The schematic is displayed on the previous post.



    Rob7
    1552 x 1164 - 521K
  • steve_bsteve_b Posts: 1,563
    edited 2006-07-11 04:00
    If there was ever a case of opto-isolation....it would've been today.

    A big thunder storm came through today and our radar tower got tagged a few times. Everything went wonky!

    Some things were opto-isolated....some weren't....the things that weren't...RIP! The things that were, well, although they suffered damage and are basically useless, they did protect downstream equipment.
    So that little $2 MOV or what-have-you is definately worth saving 1000's on the equipment that didn't go up!

    it was a really cool storm. I had walked in to the room where the conduits came through the wall and a flash of light lit up the window followed by a huge boom. I dam near pooped myself! haha

    Just remember the other 'poor-mans' isolation component.
    Tranzorbs....they come in various voltage ratings.
    Basically they look like diode's (and I suppose they act like them) and they are designed to short to ground when the voltage rises above their rating.
    I can't remember if they're a one time use, but I've certainly seen some that just had the leads left in place (big poof)!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

    Post Edited (steve_b) : 7/11/2006 1:40:51 PM GMT
  • blakrapterblakrapter Posts: 38
    edited 2006-07-12 01:32
    Thanks for all of your help guys!· I am ordering stuff tomorrow or the next day, so around next week i will be here asking a billion questions!·· Thanks again!
Sign In or Register to comment.