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

Optoisolator

firewaterfirewater Posts: 25
edited 2007-09-14 19:38 in BASIC Stamp
I am trying to hook up a optoisolator to my Basic Stamp 2.
It's a 4N25-6:· http://www.isocom.electronents.com/datasheets/4n25.pdf
I am following the digram from here http://www.wiring.org.co/learning/examples/Optocoupler_4N35.html
but it's not working. I have pins 5 and 6 attached to my DMM and I'am getting no voltage.
I know the optocoupler in the example is a different model but in the·it has the same pin outs.
http://www.fairchildsemi.com/ds/4N/4N35.pdf
I tryed different resistor values and another IC (package of 8)
confused.gif
·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-06 22:10
    Connect the collector to a positive supply, and the emitter, through a 4.7K resistor to the supply common. Then measure the voltage at the emitter vs. the supply common as you power the LED on and off.

    An optocoupler is a switch. It doesn't produce any voltage at its output by itself.

    -Phil
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-09-06 22:12
    That output stage is a transistor. You won't sense anything across it without power to it. Treat it like an active-low switch - use a 10K pull-up from collector to Vdd and connect the emitter to Vss. When the LED side is on you should see around 0.3V, when off, around 5V (Vdd).


    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting Software
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • FranklinFranklin Posts: 4,747
    edited 2007-09-07 01:56
    firewater, as people say above (please read) the outputs s1 and s2 have no voltage (or at least not much) put a good ohmmeter across these pins and you should see a high resistance when the pin is low and a low resistance when the pin is high.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-07 02:24
    Here's a schematic that shows what we're talking about.

    -Phil
    553 x 200 - 2K
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-09-07 03:30
    Attached is how I normally connect. Phil, doesn't having the R on the emitter greatly affect it's sensitivity and saturation ability since hfe * 4.7K can be quite high?

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting Software
    Southern Illinois University Carbondale, Electronic Systems Technologies
    300 x 172 - 6K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-07 03:56
    Martin,

    It doesn't matter either way. Think of the transistor as an isolated current amplifier. It doesn't really "know" how it's emitter and collector are connected — only that for a certain amount of received light, it will pass a certain amount of current. The equivalent to a bipolar transistor's gain (hFE) is the opto's current transfer ratio (CTR) expressed in the datasheets as a percentage (ICE/Ifwd * 100%). Whether the expressed current is converted to a voltage at the emitter or at the collector is immaterial, due to the isolation.

    -Phil
  • pwillardpwillard Posts: 321
    edited 2007-09-13 15:30
    You are not thinking of·the transistor on the output of the optoisolator they way you should.· It does exibit some DIODE characteristics so your measurements points are important.· You were basically measuring Vss on two sides of a resistor.· In that case, you would have been better measuring Current (not Voltage).

    Think of it this way.· When the LED in the opto is LIT, it allows the transistor to conduct, thus supplying the cathode of the LED (in this case) with a path to VSS (gnd).· If the transistor is off (unlit by the internal LED), the external·LED won't get a path to VSS so it will go out.·

    Also, an ISOLATOR is designed to be part of a totally independent circuit, as I've shown.· This is it's intended purpose.

    See if this works better for you.

    (EDIT: Pins were wrong on opto... fixed.)

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.

    Post Edited (pwillard) : 9/13/2007 3:56:26 PM GMT
    831 x 530 - 35K
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-09-14 10:14
    I use the 4N35 to isolate the stamp from coils and motors (which could give stamp-scrambling flyback voltage when their electromagnetic field collapse) that work and higher voltages and amperages.

    attachment.php?attachmentid=49305

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 9/14/2007 10:20:52 AM GMT
    1184 x 984 - 57K
  • pwillardpwillard Posts: 321
    edited 2007-09-14 14:39
    Another example attached.



    Remember: - Don't·connect the output side of the optoisolator with the same power supply (+5VDC & Vss [noparse][[/noparse]GND]) used to supply the microcontroller! To do so is to completely defeat the objective of the optoisolation - as it allows back EMF spikes from motors and relays to propagate back through the power supply to the microcontroller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
    648 x 405 - 26K
  • firewaterfirewater Posts: 25
    edited 2007-09-14 19:17
    Yes Pwillard, I realized just after I did that it was wrong to go to the same power supply,frustration I guess. It's working now.Thank you. Also I'am curious, what progam are you using to draw that schematic?
  • pwillardpwillard Posts: 321
    edited 2007-09-14 19:38
    Many people might say bad things about my choice of schematic and PCB software beacuse it's not integrated, elegant, not EAGLE, high-end, whatever.· I use what I like.· ;-)

    I use SPLAN and Sprint Layout software products from ABACOM.

    http://www.abacom-online.de/uk/html/produkte.html

    The main reason I like them is·because with both products I can create custom shapes in a very short amount of time.· I've used EAGLE for years·and know it well but I prefer a product I can get quick hobbyist results from instead of spending a lot of time "in the tool".




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
Sign In or Register to comment.