Connect with us

Need help understanding how to use opto-isolator

Discussion in 'Electronic Basics' started by mjohnson, Apr 21, 2005.

Scroll to continue with content
  1. mjohnson

    mjohnson Guest

    I want to build an automatic garage door closer with an alarm clock and
    my garage door remote. I realize that I could just buy something but I
    want to build it so I can learn something and have some fun (and
    frustration).

    Here is a block diagram of what I am imagining:
    http://img98.echo.cx/img98/3411/phase12nt.jpg

    My question is what do I need to do to take the output voltage at the
    clock's buzzer to activate the interface circuit. The voltage I read
    on the buzzer when it's going off is 395mV (.395V). If for example, I
    just want to turn on an LED (baby steps right) what would I need to do
    to couple the alarm clock to the LED circuit?

    I'm assuming that the actual coupling of the LED circuit to the buzzer
    will represent a new load to the alarm clock which it wasn't designed
    to take. So my guess is that I would need an opto-isolator and run the
    LED circuit on it's own power supply? But is 395mV is enough to drive
    the opto-isolator?

    thanks for your time and help!
     
  2. The voltage applied to the buzzer is undoubtedly
    higher than 395 mV. That might be its DC value,
    but if you measure AC, you will find quite a bit
    more RMS.
    The LED can be driven with a small fraction of the
    power consumed by the buzzer, so your concern is
    not one that should take much more your time.
    Put a 1k limiting resistor in series with the LED,
    put the combination across the buzzer, then
    measure DC voltage across the resistor when the
    buzzer goes off. You'll see more than you might
    have expected.
    You're welcome.
     
  3. John Fields

    John Fields Guest

    ---
    I posted a circuit to another thread, (a ircuit to swith a relay by
    alarm clock) which might work for you with a few modifications, so
    could you post some more information about your system? Specifically,
    on your remote control are the OPEN and CLOSE functions separate or
    does a single button toggle them?

    What supply voltages do you have to work with?

    Do you need the output which is going to the remote to stay on for as
    long as the alarm clock provides an output or do you just need a
    pulse? If a pulse, how long a pulse?

    Could you post some information as to what you used to measure the
    395mV and how you went about it? That is, was it an AC or DC meter?
    Did you measure the voltage across the buzzer, or from one of its
    terminals to ground?

    I'm assuming that you're planning on paralleling the contacts on the
    remote's keypad with whatever will be actuating it. Am I right?
     
  4. mjohnson

    mjohnson Guest

    Specifically, on your remote control are the OPEN and CLOSE functions
    separate or does a single button toggle them?

    It's a toggle switch, I need it "pressed" for a little less than a
    second for it to activate the garage door then I have to let it go or
    else the motor won't respond. So I would imagine I need a pluse that
    last about 800 to 900 milliseconds.

    The alarm clock runs off 3V DC. I measured the DC voltage with a
    multimeter between the two solder points on the buzzer itself -- so it
    was across the buzzer. Should I be measuring it someplace else?
    remote's keypad with whatever will be actuating it. Am I right?

    I wanted to extend two leads from the solder points on the buzzer to an
    opto-isolator which would activate the "pulse" to the garage door
    remote through an intermediate circuit.

    Here's a new diagram, as well as front/back images of the remote.

    http://img195.echo.cx/img195/4791/diagram6yf.jpg

    Front side of the remote:
    http://img195.echo.cx/img195/1594/remotefront5nd.jpg

    Back side of the remote (red lines are show the traces)
    http://img195.echo.cx/img195/6156/remoteback8tt.jpg

    I'm having a hard time getting a for the voltage accross the toggle
    switch on the remote. I read 0 no matter if the switch is toggled or
    not. I am probably not laying my probes across the switch correctly.
    Do I need to touch both pairs of connectors at the same time?

    I'm assuming that I would use an opto-isolator to interface the pluse
    circuit to the remote and that the output of the opto-isolator will be
    enough to activiate the remote? I guess I'll just have to try it an
    see.

    I was going to use an 4N27 opto-isolator
    (www.vishay.com/document/83519/83519.pdf) between the clock and between
    the remote.

    thanks again, let me know if y'all have any thoughts or questions...
     
  5. John Fields

    John Fields Guest

    ---
    Across the buzzer should be OK, but 395mV sounds awfully low, so I
    suspect it's being driven by AC. Measure it with your meter set to AC
    VOLTS and see what you get.
    ---
    ---
    Before anything can happen we need to find out definitively what's
    happening at the buzzer when the alarm goes off, or we need to find a
    signal somewhere in the clock which changes state when the alarm goes
    off. Either that or couple to the clock acoustically in order to
    detect the sound of the buzzer and use that to trigger the chain of
    events leading to the activation of the remote.
    ---
    ---
    No, it looks like you only have to get across the terminals with trace
    connected to them. But, since we don't know how the switch is being
    used in the circuit, it would be best to use relay contacts (instead
    of the out of an optocoupler) across the switch terminals in order to
    activate the remote. Test it by shorting the terminals momentarily
    and see if it works the door. If it does, then relay contacts will be
    fine.
    ---
    ---
    I wouldn't use an opto because of the current required for its LED and
    the uncertainty of being able to use its transistor output to trigger
    the remote.

    Here's what I see as a much simpler solution, with only the clock
    output needing to be defined in order to make it work:

    INTERFACE
    BATTERY
    CLOCK 4.5V REMOTE
    BATTERY | BATTERY
    3V +---------+---------+ 3V
    | | | | |
    +--+--+ +--+--+ +--+--+ +--+--+ +--+---+
    |CLOCK|---|ALARM|---|1SEC |---|REED |---|REMOTE|
    +-----+ | DET | |MONO | |RELAY|---|SWITCH|
    +-----+ +-----+ +-----+ +------+
     
  6. (To the OP:) I concur with that good advice.

    ....
    The power needed to drive a buzzer will be many
    times larger than what needs to be picked off to
    activate another circuit, (many mW versus uW).

    ....
    Some such uncertainty is warranted, but I suggest that
    there is reason to believe an opto-isolator will be fine.
    The cheap (typically membrane) switches used in many
    remotes are not asked to carry much current and, to
    conserve battery power, large value pull-{up,down}
    resistors are used. If a replacement for the contanct
    had to carry more than 100 uA, I would be surprised.
    The CTR (current transfer ratio) for opto-isolaters is
    often guaranteed to be 100% or better, so a similar
    current is all that the LED would need. Finally, the
    signal sent thru the opto-isolator can be time limited
    to just over what is needed for the remote in order to
    conserve the battery.
    The opto-isolator would plug into that with little
    change except reduction of the 4.5V battery drain
    (unless my power surmises are completely wrong).
     
  7. John Fields

    John Fields Guest

    ---
    Depends. The OP's advocating using the signal driving the buzzer to
    also drive the LED in an opto, which will be milliwatts VS milliwatts.
    ---
    ---
    Not necessarily, CTR falls off quickly as LED forward current
    diminishes and there are temperature effects which need to be taken
    into consideration which can largely be ignored with a comparator-reed
    switch solution. Also, with the reed switch solution there is no
    saturation voltage VS LED If problem since it's either on or off.
    ---
    ---
    Either solution will require the generation of a timed pulse to the
    remote, so that's probably a wash.
    ---
    ---
    Could be. I'll defer judgement and wait until the OP comes back with
    something definitive on the buzzer signal to post my design. If he
    doesn't, I can always fall back on the acoustic thing I've already
    posted. You may want to ask him about the current being conducted by
    the remote's switch switch to see whether you can use an opto in
    there. An easy way to determine the current would be to jump the
    switch contacts with a milli/microammeter...
     
  8. I was not addressing use of the optoisolator in that
    position. However, if the current taken through the
    opto LED is limited to a few 100 uA, such usage
    would still be a small fraction of the buzzer power.
    As you point out, CTR would be reduced, but no
    more than a few uA of output would be needed.

    All the alarms with buzzers I have heard are very
    loud (and annoying). It is hard to imagine getting
    that without using many 10s of mW.
    I agree that the reed relay is simpler to apply. For that
    reason alone, it may well be most suitable for the OP's
    project. My suggestion about an optoisolator in its
    place is more like a feasable alternative than any kind
    of compelling improvement. Reed relays are fragile
    and, if their leads are not carefully heat-sunk during
    soldering, they can fail quickly or slowly as a result.
    That, together with a dislike of moving parts, made
    me think it might be an attractive alternative.
    Seems reasonable.
    Yes.
     
  9. John Fields

    John Fields Guest

    ---
    That's not the point. As you've already stated, large value pullups
    or pull-down resistors may be used in the remote in order to conserve
    battery power during switching, and it's precisely that which makes
    using an opto in other than a saturated mode problematical. Consider:

    +V
    |
    [100k]
    |
    +----->Eout
    |
    O |
    |<-
    O |
    |
    GND

    In this case, if the load on Eout is insignificant, (CMOS, say) Eout
    will be either +V or, assumong GND is at 0V, 0V.

    However, in this case:

    +V
    |
    [100k]
    |
    +----->Eout
    |
    C A
    B <--[LED]
    E K
    |
    GND

    Eout will depend on the collector-to-emitter resistance of the
    transistor, and if it isn't driven low enough (if the current through
    the LED isn't high enough) Eout may not cross the switching threshold
    of the driven device.

    The problem can also be exacerbated by the use of cheap conductive
    rubber switches which require a substantially lower value pullup.

    Additionally, if the remote used pull-down resistors, the opto's
    transistor would be operating as a follower which, with only a 3V
    supply available in the remote, would complicate matters even more.

    All of these problems go away with the mechanical contacts of a reed
    relay.
    ---
    ---
    Yeah, right! I can just see millions of through-hole reed relays
    going through wave-solder machines with little heat sinks attached to
    their leads, LOL. Worse yet, millions of surface-mount units going
    through soldering ovens with no heat sinks attached...
    ---
     
  10. I've seen commercial uses of photo-transistors
    used as switches with 1M pullups. The transistors
    themselves do fine at such levels, suffering only
    slight beta reduction. Saturation resistance is
    very nearly inversely proportional to excess
    base current (or the equivalent photocurrent
    for a phototransistor), so I see no reason to
    expect the problem you allude to here.

    As for using the phototransistor in a mode
    other than saturated (or nearly off), I have
    not suggested that. It might be useful, when
    the receiver can deal with a non-switching
    input, but that is not the case for the position
    I suggested the opto for.
    I thought pullup values would go up in that case,
    at least when expressed in Ohms. What makes
    you say they would go lower?
    The output transistor can be, and often is, used as a two
    terminal switch. Even if a base-emitter resistor is added
    to control switching speed or leakage, (not needed here),
    it can be used that way. Whether it pulls high or low is
    not a complication and no follower need be created.
    Most or all of them go away on their own.
    Ok, that's funny. I was thinking of the bare reed
    switches which, due to their glass envelope, are
    fragile. Obviously, they are not so fragile when
    packaged.

    I guess that's not so funny.
     
  11. [Brasfield had suggested an optoisolator in parallel with
    a button on a remote.]
    [Points made and responded to elsewhere cut.]
    Brasfield once wrote:
    ... I suggest that there is reason to believe an opto-isolator will be fine.
    and later wrote:
    ... I agree that the reed relay is simpler to apply. For that
    reason alone, it may well be most suitable for the OP's project.

    It occurs to me now that the most problematical attribute
    of the optoisolator in that position is its capacitance. If
    that had an effect only at button pushing speeds, it would
    hardly matter. But it is quite likely that the buttons on the
    remote at in a matrix and scanned via pulses applied to
    the matrix and responses sampled shortly after changes.
    The commonly large capacitance of the phototransistors
    used in optoisolators could interfere with such scanning.

    The reed relay is more certain to work for that reason.
     
  12. John Fields

    John Fields Guest

    ---
    Without adequate drive the phototransistor will never go into
    saturation, so whether the output of the opto can pull the driven load
    down (or up) far enough to cross the switching threshold becomes the
    problem.
    ---
    ---
    I know you haven't suggested that, but it may well be the position the
    opto finds itself in if there's not enough photocurrent to drive its
    output into saturation. That is, operating linearly, its
    collector-to-emitter resistance may be too high to cause the driven
    device's switching threshold to be exceeded.
    ---
    ---
    Yes, you're right. I got it backwards.
    ---
    ---
    That's not the point. If the driven device uses pull-downs and
    expects its input to be driven high, then the opto's output (the
    emitter) becomes a follower, of necessity.

    You might be right though, if the LED drive current is high enough,
    but with the microamp drive levels you're proposing, I don't think so.

    Run this:

    Version 4
    SHEET 1 880 680
    WIRE -192 208 -192 176
    WIRE -192 400 -192 288
    WIRE -112 176 -192 176
    WIRE -16 400 -16 272
    WIRE 32 176 -32 176
    WIRE 32 272 -16 272
    WIRE 288 240 224 240
    WIRE 288 272 288 240
    WIRE 288 400 288 352
    WIRE 384 176 224 176
    WIRE 384 192 384 176
    WIRE 384 400 384 272
    FLAG 384 400 0
    FLAG 288 400 0
    FLAG -192 400 0
    FLAG -16 400 0
    SYMBOL Optos\\4N25A 128 240 R0
    SYMATTR InstName U1
    SYMBOL voltage 384 176 R0
    WINDOW 123 0 0 Left 0
    WINDOW 39 0 0 Left 0
    SYMATTR InstName V1
    SYMATTR Value 3
    SYMBOL res 272 256 R0
    SYMATTR InstName R1
    SYMATTR Value 100k
    SYMBOL voltage -192 192 R0
    WINDOW 123 0 0 Left 0
    WINDOW 39 0 0 Left 0
    SYMATTR InstName V2
    SYMATTR Value 4.5
    SYMBOL res -16 160 R90
    WINDOW 0 0 56 VBottom 0
    WINDOW 3 32 56 VTop 0
    SYMATTR InstName R2
    SYMATTR Value 100k
    TEXT -226 506 Left 0 !.tran 0 .1 0
    ---
    I disagree. Doing it your way requires knowing the values of the
    pullups and/or pull-down resistors, the contact resistance of the
    switch(es), the switching thresholds of the driven device, the drive
    level and voltage available from the buzzer to drive the OPTO LED (if
    that's how you were planning to do it) and...

    My way only requires me to know what the drive voltage to the buzzer
    is, or if there's an ALARM ON signal available, what its voltage is.
    ---
     
  13. mike

    mike Guest

    Why do you need the remote? If you're close enough to sense the door
    state, you're close enough to use the wired actuation.

    Only you and your insurance company can determine what should be in the
    door sensor block.

    I can tell you from personal experience that unattended operation of a
    garage door is a BAD idea. Once had the door hang up on a gasoline can.
    It hung up on the (sharp)edge of the door brace, so a sensor along the
    bottom of the door wouldn't have helped.
    Once had a broom handle hang up in the door guides. Kids, pets,
    newspaper, bicycle...
    It's no fun to have the door close as you're driving in from that late
    night on the town.
    Yes, if you put enough safety interlocks and timeouts, you can make it
    as safe as you think you need.

    A much easier/safer way would be to use the door state sensor to inhibit
    the alarm. If the alarm goes off, get off your butt and go close the door.
    More technology/automation is not always a good thing.

    If you're determined to do this, stick a scope on the buzzer and see
    what's actually there. Some clocks use DC on a buzzer module. Others
    drive the piezo directly with AC. YMMV.

    Also do a LOT of testing on what happens to the clock with various power
    line glitches/outages, battery failure...Interesting things can happen
    to a battery powered clock as temperature variations, as might be
    encountered in a garage, change the battery voltage slightly near the
    cutoff point.

    This is one of those situations with a very low probability of having a
    very BIG problem. Multiply the numbers and you'll feel very
    safe...until it fails.
    mike
    --
    Return address is VALID but some sites block emails
    with links. Delete this sig when replying.
    ..
    Wanted, PCMCIA SCSI Card for HP m820 CDRW.
    FS 500MHz Tek DSOscilloscope TDS540 Make Offer
    Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121
    Wanted 12" LCD for Compaq Armada 7770MT.
    Bunch of stuff For Sale and Wanted at the link below.
    MAKE THE OBVIOUS CHANGES TO THE LINK
    ht<removethis>tp://www.geocities.com/SiliconValley/Monitor/4710/
     
  14. I think we can noisily agree that using sufficient
    current is necessary with the optoisolator and
    that it should be more or less saturated when
    used to replace a switch.

    I think we have merely a terminolgy issue here.
    You are willing to call a two terminal circuit a
    follower. I use the term for common {emitter,
    source, cathode} amplifiers.

    However, maybe you think the underlying facts
    impact the operation, and that being a follower
    limits the voltage in the pullup configuration more
    than in the pulldown configuration. In that case,
    I suggest you connect a 1T resistor from the
    base of the 4N25A in your simulation to ground
    and run it, then observe the base voltage. You
    may be surprised to see it more positive than the
    other two terminals by about a diode drop.
    I've only made one explicit statement about the
    LED current, suggesting it might be "limited to
    a few 100 uA". More on this in a moment.
    Interesting. It certainly demonstrates the reduction
    of CTR at lower currents. When I reduce the LED
    current setting resistor to 36K to get about 100 uA
    thru the LED, the output saturates nicely. And with
    that 1T resistor, the base goes to 3.53 V.
    I've already agreed that the relay solution is easier
    to apply. My reason for stating so is exactly the
    sort of required knowing you mention. For that
    reason, (and the capacitance issue I've posted), I
    think your solution is entirely appropriate for the
    OP's purpose.
    Ok, that's funny too. I could quibble about centuries
    being the proper unit of measurement. (What falls
    between millenia and eons?) I never claimed my
    dislike of moving parts was rational!
     
  15. mjohnson

    mjohnson Guest

    The alarm clock is powered by two AAA batteries and has a piezo buzzer
    so I don't think there's any AC involved.
     

  16. The piezo device requires AC to do anything
    above DC. The sound you hear from it is at
    the same frequency applied to the buzzer.
     
  17. That doesn't necessarily follow. Piezo buzzers come in two flavours:

    1. Basic component, requiring connection to an external oscillator
    (which, of course, delivers AC).

    2. With built-in oscillator, requiring DC.
     

  18. Of course, AC is involved then, too.

    Mr. Johnson has already mentioned observing 395 mV on the
    buzzer when it is sounding. That is not likely to be enough to
    run the latter kind of buzzer, so I conclude that his buzzer is
    being fed with narrow pulses at whatever voltage the clock's
    logic device is powered by.

    It is also apparent that the repeated advice he has been given
    to measure the AC signal on the buzzer has not been taken.
    That ought to reduce interest in this thread, I would think.
     
  19. mjohnson

    mjohnson Guest

    I guess I'm not sure how to measure the AC then. My multimeter has an
    ACV seeting for 200 and 750. I might not understand how to use the
    meter. Is that what what I use to measure the VC and do I measure it
    across at the two leads attached to the buzzer?

    Sorry for my ignorance...
     
  20. If that is 200 and 750 VAC, you'll have to observe
    carefully to see the few volts likely across that buzzer.
    It may not go that low if it is a moving needle type.

    I suggest that you put a small diode in series with your
    meter, use the same DC setting you got the 395 mV
    with, and measure in both directions across the buzzer.
    You will probably see several volts when it sounds.
    That will represent approximately the peak voltage
    applied, minus a small diode drop (400 - 500 mV).
    No need for that. Please understand that my earlier
    comment was a little frustration showing due to an
    excess of speculation when what is really needed is
    some real data.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-